Files
TheRock/compiler/amd-llvm/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationServerLLGSTest.cpp
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

64 lines
3.2 KiB
C++

//===-- GDBRemoteCommunicationServerLLGSTest.cpp --------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "gtest/gtest.h"
#include "Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h"
using namespace lldb_private::process_gdb_remote;
TEST(GDBRemoteCommunicationServerLLGSTest, LLGSArgToURL) {
// LLGS new-style URLs should be passed through (indepenently of
// --reverse-connect)
EXPECT_EQ(LLGSArgToURL("listen://127.0.0.1:1234", false),
"listen://127.0.0.1:1234");
EXPECT_EQ(LLGSArgToURL("listen://127.0.0.1:1234", true),
"listen://127.0.0.1:1234");
EXPECT_EQ(LLGSArgToURL("connect://127.0.0.1:1234", false),
"connect://127.0.0.1:1234");
EXPECT_EQ(LLGSArgToURL("connect://127.0.0.1:1234", true),
"connect://127.0.0.1:1234");
// LLGS legacy listen URLs should be converted if !reverse_connect
EXPECT_EQ(LLGSArgToURL("tcp://127.0.0.1:1234", false),
"listen://127.0.0.1:1234");
EXPECT_EQ(LLGSArgToURL("unix:///tmp/foo", false), "unix-accept:///tmp/foo");
EXPECT_EQ(LLGSArgToURL("unix-abstract://foo", false),
"unix-abstract-accept://foo");
// LLGS listen host:port pairs should be converted to listen://
EXPECT_EQ(LLGSArgToURL("127.0.0.1:1234", false), "listen://127.0.0.1:1234");
EXPECT_EQ(LLGSArgToURL("[::1]:1234", false), "listen://[::1]:1234");
EXPECT_EQ(LLGSArgToURL("localhost:1234", false), "listen://localhost:1234");
EXPECT_EQ(LLGSArgToURL("*:1234", false), "listen://*:1234");
// LLGS listen :port special-case should be converted to listen://
EXPECT_EQ(LLGSArgToURL(":1234", false), "listen://localhost:1234");
// LLGS listen UNIX sockets should be converted to unix-accept://
EXPECT_EQ(LLGSArgToURL("/tmp/foo", false), "unix-accept:///tmp/foo");
EXPECT_EQ(LLGSArgToURL("127.0.0.1", false), "unix-accept://127.0.0.1");
EXPECT_EQ(LLGSArgToURL("[::1]", false), "unix-accept://[::1]");
EXPECT_EQ(LLGSArgToURL("[[::1]:1234]", false), "unix-accept://[[::1]:1234]");
EXPECT_EQ(LLGSArgToURL("localhost", false), "unix-accept://localhost");
EXPECT_EQ(LLGSArgToURL(":frobnicate", false), "unix-accept://:frobnicate");
// LLGS reverse connect host:port pairs should be converted to connect://
EXPECT_EQ(LLGSArgToURL("127.0.0.1:1234", true), "connect://127.0.0.1:1234");
EXPECT_EQ(LLGSArgToURL("[::1]:1234", true), "connect://[::1]:1234");
EXPECT_EQ(LLGSArgToURL("localhost:1234", true), "connect://localhost:1234");
// with LLGS reverse connect, anything else goes as unix-connect://
EXPECT_EQ(LLGSArgToURL("/tmp/foo", true), "unix-connect:///tmp/foo");
EXPECT_EQ(LLGSArgToURL("127.0.0.1", true), "unix-connect://127.0.0.1");
EXPECT_EQ(LLGSArgToURL("[::1]", true), "unix-connect://[::1]");
EXPECT_EQ(LLGSArgToURL("[[::1]:1234]", true), "unix-connect://[[::1]:1234]");
EXPECT_EQ(LLGSArgToURL("localhost", true), "unix-connect://localhost");
EXPECT_EQ(LLGSArgToURL(":frobnicate", true), "unix-connect://:frobnicate");
}