Skip to content

[llvm-readobj][COFF] Add support for more CET and hotpatch flags #150967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 29, 2025

Conversation

kkent030315
Copy link
Contributor

@kkent030315 kkent030315 commented Jul 28, 2025

Split out the COFF dumper from issue #150761.

  • Added IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT_STRICT_MODE
  • Added IMAGE_DLL_CHARACTERISTICS_EX_CET_SET_CONTEXT_IP_VALIDATION_RELAXED_MODE
  • Added IMAGE_DLL_CHARACTERISTICS_EX_CET_DYNAMIC_APIS_ALLOW_IN_PROC_ONLY
  • Added IMAGE_DLL_CHARACTERISTICS_EX_CET_RESERVED_1
  • Added IMAGE_DLL_CHARACTERISTICS_EX_CET_RESERVED_2
  • Added IMAGE_DLL_CHARACTERISTICS_EX_FORWARD_CFI_COMPAT
  • Added IMAGE_DLL_CHARACTERISTICS_EX_HOTPATCH_COMPATIBLE

Split out the COFF dumper from issue llvm#150761.

- Decreased the size of existing `has-cet.exe`.
- Added `IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT_STRICT_MODE`
- Added `IMAGE_DLL_CHARACTERISTICS_EX_CET_SET_CONTEXT_IP_VALIDATION_RELAXED_MODE`
- Added `IMAGE_DLL_CHARACTERISTICS_EX_CET_DYNAMIC_APIS_ALLOW_IN_PROC_ONLY`
- Added `IMAGE_DLL_CHARACTERISTICS_EX_CET_RESERVED_1`
- Added `IMAGE_DLL_CHARACTERISTICS_EX_CET_RESERVED_2`
- Added `IMAGE_DLL_CHARACTERISTICS_EX_FORWARD_CFI_COMPAT`
- Added `IMAGE_DLL_CHARACTERISTICS_EX_HOTPATCH_COMPATIBLE`
@llvmbot
Copy link
Member

llvmbot commented Jul 28, 2025

@llvm/pr-subscribers-llvm-binary-utilities

Author: None (kkent030315)

Changes

Split out the COFF dumper from issue #150761.

  • Decreased the size of existing has-cet.exe.
  • Added IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT_STRICT_MODE
  • Added IMAGE_DLL_CHARACTERISTICS_EX_CET_SET_CONTEXT_IP_VALIDATION_RELAXED_MODE
  • Added IMAGE_DLL_CHARACTERISTICS_EX_CET_DYNAMIC_APIS_ALLOW_IN_PROC_ONLY
  • Added IMAGE_DLL_CHARACTERISTICS_EX_CET_RESERVED_1
  • Added IMAGE_DLL_CHARACTERISTICS_EX_CET_RESERVED_2
  • Added IMAGE_DLL_CHARACTERISTICS_EX_FORWARD_CFI_COMPAT
  • Added IMAGE_DLL_CHARACTERISTICS_EX_HOTPATCH_COMPATIBLE

Full diff: https://github.com/llvm/llvm-project/pull/150967.diff

11 Files Affected:

  • (modified) llvm/include/llvm/BinaryFormat/COFF.h (+18-1)
  • (modified) llvm/test/tools/llvm-readobj/COFF/Inputs/has-cet.exe ()
  • (added) llvm/test/tools/llvm-readobj/COFF/Inputs/has-cetdynamicapisinproc.exe ()
  • (added) llvm/test/tools/llvm-readobj/COFF/Inputs/has-cetipvalidationrelaxed.exe ()
  • (added) llvm/test/tools/llvm-readobj/COFF/Inputs/has-cetstrict.exe ()
  • (added) llvm/test/tools/llvm-readobj/COFF/Inputs/has-hotpatchcompatible.exe ()
  • (added) llvm/test/tools/llvm-readobj/COFF/cetcompatstrict.test (+16)
  • (added) llvm/test/tools/llvm-readobj/COFF/cetdynamicapisinproc.test (+16)
  • (added) llvm/test/tools/llvm-readobj/COFF/cetipvalidationrelaxed.test (+16)
  • (added) llvm/test/tools/llvm-readobj/COFF/hotpatchcompatible.test (+16)
  • (modified) llvm/tools/llvm-readobj/COFFDumper.cpp (+10-1)
diff --git a/llvm/include/llvm/BinaryFormat/COFF.h b/llvm/include/llvm/BinaryFormat/COFF.h
index f3b5d5e3f23c6..64fe2160f9970 100644
--- a/llvm/include/llvm/BinaryFormat/COFF.h
+++ b/llvm/include/llvm/BinaryFormat/COFF.h
@@ -694,7 +694,24 @@ enum DLLCharacteristics : unsigned {
 
 enum ExtendedDLLCharacteristics : unsigned {
   /// Image is CET compatible
-  IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT = 0x0001
+  IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT = 0x0001,
+  /// Image is CET compatible in strict mode
+  IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT_STRICT_MODE = 0x0002,
+  /// Image is CET compatible in such a way that context IP validation is
+  /// relaxed
+  IMAGE_DLL_CHARACTERISTICS_EX_CET_SET_CONTEXT_IP_VALIDATION_RELAXED_MODE =
+      0x0004,
+  /// Image is CET compatible in such a way that the use of
+  /// dynamic APIs is restricted to processes only
+  IMAGE_DLL_CHARACTERISTICS_EX_CET_DYNAMIC_APIS_ALLOW_IN_PROC_ONLY = 0x0008,
+  /// Reserved for future use. Not used by MSVC link.exe
+  IMAGE_DLL_CHARACTERISTICS_EX_CET_RESERVED_1 = 0x0010,
+  /// Reserved for future use. Not used by MSVC link.exe
+  IMAGE_DLL_CHARACTERISTICS_EX_CET_RESERVED_2 = 0x0020,
+  /// Image is CFI compatible.
+  IMAGE_DLL_CHARACTERISTICS_EX_FORWARD_CFI_COMPAT = 0x0040,
+  /// Image is hotpatch compatible.
+  IMAGE_DLL_CHARACTERISTICS_EX_HOTPATCH_COMPATIBLE = 0x0080,
 };
 
 enum DebugType : unsigned {
diff --git a/llvm/test/tools/llvm-readobj/COFF/Inputs/has-cet.exe b/llvm/test/tools/llvm-readobj/COFF/Inputs/has-cet.exe
index c77060d976d2f..08d8a2efc3b2e 100644
Binary files a/llvm/test/tools/llvm-readobj/COFF/Inputs/has-cet.exe and b/llvm/test/tools/llvm-readobj/COFF/Inputs/has-cet.exe differ
diff --git a/llvm/test/tools/llvm-readobj/COFF/Inputs/has-cetdynamicapisinproc.exe b/llvm/test/tools/llvm-readobj/COFF/Inputs/has-cetdynamicapisinproc.exe
new file mode 100644
index 0000000000000..a4e0fa8ab5539
Binary files /dev/null and b/llvm/test/tools/llvm-readobj/COFF/Inputs/has-cetdynamicapisinproc.exe differ
diff --git a/llvm/test/tools/llvm-readobj/COFF/Inputs/has-cetipvalidationrelaxed.exe b/llvm/test/tools/llvm-readobj/COFF/Inputs/has-cetipvalidationrelaxed.exe
new file mode 100644
index 0000000000000..f85bd9bb1839e
Binary files /dev/null and b/llvm/test/tools/llvm-readobj/COFF/Inputs/has-cetipvalidationrelaxed.exe differ
diff --git a/llvm/test/tools/llvm-readobj/COFF/Inputs/has-cetstrict.exe b/llvm/test/tools/llvm-readobj/COFF/Inputs/has-cetstrict.exe
new file mode 100644
index 0000000000000..18c51736ec8a0
Binary files /dev/null and b/llvm/test/tools/llvm-readobj/COFF/Inputs/has-cetstrict.exe differ
diff --git a/llvm/test/tools/llvm-readobj/COFF/Inputs/has-hotpatchcompatible.exe b/llvm/test/tools/llvm-readobj/COFF/Inputs/has-hotpatchcompatible.exe
new file mode 100644
index 0000000000000..bb554c7ef89b2
Binary files /dev/null and b/llvm/test/tools/llvm-readobj/COFF/Inputs/has-hotpatchcompatible.exe differ
diff --git a/llvm/test/tools/llvm-readobj/COFF/cetcompatstrict.test b/llvm/test/tools/llvm-readobj/COFF/cetcompatstrict.test
new file mode 100644
index 0000000000000..5b75bcd3db9ad
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/COFF/cetcompatstrict.test
@@ -0,0 +1,16 @@
+# To regenerate has-cetstrict.exe
+# $ echo int main() { return 0; } > has-cetstrict.c
+# $ cl has-cetstruct.c /link /cetcompatstrict
+RUN: llvm-readobj --coff-debug-directory %p/Inputs/has-cetstrict.exe | FileCheck %s
+
+CHECK:  DebugEntry {
+CHECK:    Characteristics: 0x0
+CHECK:    Type: ExtendedDLLCharacteristics (0x14)
+CHECK:    ExtendedCharacteristics [ (0x2)
+CHECK:      IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT_STRICT_MODE (0x2)
+CHECK:    ]
+CHECK:    RawData (
+CHECK:      0000: 02000000                             |....|
+CHECK:    )
+CHECK:  }
+
diff --git a/llvm/test/tools/llvm-readobj/COFF/cetdynamicapisinproc.test b/llvm/test/tools/llvm-readobj/COFF/cetdynamicapisinproc.test
new file mode 100644
index 0000000000000..18b3ec70177cb
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/COFF/cetdynamicapisinproc.test
@@ -0,0 +1,16 @@
+# To regenerate has-cetdynamicapisinproc.exe
+# $ echo int main() { return 0; } > has-cetdynamicapisinproc.c
+# $ cl has-cetdynamicapisinproc.c /link /cetdynamicapisinproc
+RUN: llvm-readobj --coff-debug-directory %p/Inputs/has-cetdynamicapisinproc.exe | FileCheck %s
+
+CHECK:  DebugEntry {
+CHECK:    Characteristics: 0x0
+CHECK:    Type: ExtendedDLLCharacteristics (0x14)
+CHECK:    ExtendedCharacteristics [ (0x8)
+CHECK:      IMAGE_DLL_CHARACTERISTICS_EX_CET_DYNAMIC_APIS_ALLOW_IN_PROC_ONLY (0x8)
+CHECK:    ]
+CHECK:    RawData (
+CHECK:      0000: 08000000                             |....|
+CHECK:    )
+CHECK:  }
+
diff --git a/llvm/test/tools/llvm-readobj/COFF/cetipvalidationrelaxed.test b/llvm/test/tools/llvm-readobj/COFF/cetipvalidationrelaxed.test
new file mode 100644
index 0000000000000..25cf1db3464f7
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/COFF/cetipvalidationrelaxed.test
@@ -0,0 +1,16 @@
+# To regenerate has-cetipvalidationrelaxed.exe
+# $ echo int main() { return 0; } > has-cetipvalidationrelaxed.c
+# $ cl has-cetipvalidationrelaxed.c /link /cetipvalidationrelaxed
+RUN: llvm-readobj --coff-debug-directory %p/Inputs/has-cetipvalidationrelaxed.exe | FileCheck %s
+
+CHECK:  DebugEntry {
+CHECK:    Characteristics: 0x0
+CHECK:    Type: ExtendedDLLCharacteristics (0x14)
+CHECK:    ExtendedCharacteristics [ (0x4)
+CHECK:      IMAGE_DLL_CHARACTERISTICS_EX_CET_SET_CONTEXT_IP_VALIDATION_RELAXED_MODE (0x4)
+CHECK:    ]
+CHECK:    RawData (
+CHECK:      0000: 04000000                             |....|
+CHECK:    )
+CHECK:  }
+
diff --git a/llvm/test/tools/llvm-readobj/COFF/hotpatchcompatible.test b/llvm/test/tools/llvm-readobj/COFF/hotpatchcompatible.test
new file mode 100644
index 0000000000000..87208d24f9fee
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/COFF/hotpatchcompatible.test
@@ -0,0 +1,16 @@
+# To regenerate has-hotpatchcompatible.exe
+# $ echo int main() { return 0; } > has-hotpatchcompatible.c
+# $ cl has-hotpatchcompatible.c /link /hotpatchcompatible
+RUN: llvm-readobj --coff-debug-directory %p/Inputs/has-hotpatchcompatible.exe | FileCheck %s
+
+CHECK:  DebugEntry {
+CHECK:    Characteristics: 0x0
+CHECK:    Type: ExtendedDLLCharacteristics (0x14)
+CHECK:    ExtendedCharacteristics [ (0x80)
+CHECK:      IMAGE_DLL_CHARACTERISTICS_EX_HOTPATCH_COMPATIBLE (0x80)
+CHECK:    ]
+CHECK:    RawData (
+CHECK:      0000: 80000000                             |....|
+CHECK:    )
+CHECK:  }
+
diff --git a/llvm/tools/llvm-readobj/COFFDumper.cpp b/llvm/tools/llvm-readobj/COFFDumper.cpp
index dce8e60bda1ef..96e0a634648e4 100644
--- a/llvm/tools/llvm-readobj/COFFDumper.cpp
+++ b/llvm/tools/llvm-readobj/COFFDumper.cpp
@@ -412,10 +412,19 @@ const EnumEntry<COFF::DLLCharacteristics> PEDLLCharacteristics[] = {
   LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE),
 };
 
+// clang-format off
 static const EnumEntry<COFF::ExtendedDLLCharacteristics>
     PEExtendedDLLCharacteristics[] = {
-        LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT),
+        LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT                                ),
+        LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT_STRICT_MODE                    ),
+        LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_EX_CET_SET_CONTEXT_IP_VALIDATION_RELAXED_MODE),
+        LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_EX_CET_DYNAMIC_APIS_ALLOW_IN_PROC_ONLY       ),
+        LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_EX_CET_RESERVED_1                            ),
+        LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_EX_CET_RESERVED_2                            ),
+        LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_EX_FORWARD_CFI_COMPAT                        ),
+        LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_DLL_CHARACTERISTICS_EX_HOTPATCH_COMPATIBLE                       ),
 };
+// clang-format on
 
 static const EnumEntry<COFF::SectionCharacteristics>
 ImageSectionCharacteristics[] = {

@mstorsjo
Copy link
Member

Thanks, the direction looks good!

Decreased the size of existing has-cet.exe.

Can you elaborate a little about what has changed to make it that much smaller?

Instead of adding a handful of binaries, one for checking each individual flag, can we have one binary with as many flags set as possible within one file? Or are these flags mutually exclusive? (Or perhaps we don't need test coverage for every single possible flag, as long as we test some of them?)

@kkent030315
Copy link
Contributor Author

Thanks, the direction looks good!

Decreased the size of existing has-cet.exe.

Can you elaborate a little about what has changed to make it that much smaller?

With a combination of MSVC linker flags and a special stub, the binary being commited to the repo can be made much smaller (around ~5kb).

  • /ENTRY:raw_main: Avoid CRT wrappers being linked
  • /STUB:stub: A specifically crafted DOS stub (minimum possible size of 64 bytes -- which isless than the default)
    • 4D 5A 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      
  • /NOCOFFGRPINFO: No POGO metadata in debug directory
  • /EMITTOOLVERSIONINFO:NO: No Rich header
  • /EMITPOGOPHASEINFO: Eliminates ILTCG debug directory entry
  • /NOVCFEATURE: Eliminate IMAGE_DEBUG_TYPE_VC_FEATURE debug directory (contains tool version data but different one from Rich)
  • /MANIFEST:NO: No manifest.xml being made in .rsrc

Instead of adding a handful of binaries, one for checking each individual flag, can we have one binary with as many flags set as possible within one file? Or are these flags mutually exclusive? (Or perhaps we don't need test coverage for every single possible flag, as long as we test some of them?)

None of those flags are mutually exclusive. I will squash all those new has-*.exe into the one and will add comments on how-to generate the binary. But we'd probably want to keep every test file separated (or should I squash has-*.test into the one as well?).

@mstorsjo
Copy link
Member

With a combination of MSVC linker flags and a special stub, the binary being commited to the repo can be made much smaller (around ~5kb).

  • /ENTRY:raw_main: Avoid CRT wrappers being linked

  • /STUB:stub: A specifically crafted DOS stub (minimum possible size of 64 bytes -- which isless than the default)

    • 4D 5A 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      
  • /NOCOFFGRPINFO: No POGO metadata in debug directory

  • /EMITTOOLVERSIONINFO:NO: No Rich header

  • /EMITPOGOPHASEINFO: Eliminates ILTCG debug directory entry

  • /NOVCFEATURE: Eliminate IMAGE_DEBUG_TYPE_VC_FEATURE debug directory (contains tool version data but different one from Rich)

  • /MANIFEST:NO: No manifest.xml being made in .rsrc

Nice, and thanks for documenting it in the test scripts!

Instead of adding a handful of binaries, one for checking each individual flag, can we have one binary with as many flags set as possible within one file? Or are these flags mutually exclusive? (Or perhaps we don't need test coverage for every single possible flag, as long as we test some of them?)

None of those flags are mutually exclusive. I will squash all those new has-*.exe into the one and will add comments on how-to generate the binary. But we'd probably want to keep every test file separated (or should I squash has-*.test into the one as well?).

No, there's very little value to keeping multiple separate test files for just checking individual flags here; as we have one input file and one command, just check all flags in one test file. Other than that, this is starting to look good, thanks!

@kkent030315
Copy link
Contributor Author

No, there's very little value to keeping multiple separate test files for just checking individual flags here; as we have one input file and one command, just check all flags in one test file. Other than that, this is starting to look good, thanks!

Ok, sounds reasonable. Tests are now squashed :)

Copy link
Member

@mstorsjo mstorsjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mstorsjo mstorsjo merged commit 3212704 into llvm:main Jul 29, 2025
9 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 29, 2025

LLVM Buildbot has detected a new failure on builder lldb-aarch64-ubuntu running on linaro-lldb-aarch64-ubuntu while building llvm at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/21784

Here is the relevant piece of the build log for the reference
Step 6 (test) failure: build (failure)
...
PASS: lldb-unit :: ValueObject/./LLDBValueObjectTests/7/12 (2285 of 2294)
PASS: lldb-unit :: ValueObject/./LLDBValueObjectTests/9/12 (2286 of 2294)
PASS: lldb-unit :: tools/lldb-server/tests/./LLDBServerTests/0/2 (2287 of 2294)
PASS: lldb-unit :: tools/lldb-server/tests/./LLDBServerTests/1/2 (2288 of 2294)
PASS: lldb-unit :: Target/./TargetTests/11/14 (2289 of 2294)
PASS: lldb-unit :: Host/./HostTests/1/8 (2290 of 2294)
PASS: lldb-unit :: Host/./HostTests/7/8 (2291 of 2294)
PASS: lldb-unit :: Host/./HostTests/3/8 (2292 of 2294)
PASS: lldb-unit :: Process/gdb-remote/./ProcessGdbRemoteTests/8/9 (2293 of 2294)
UNRESOLVED: lldb-api :: tools/lldb-server/TestLldbGdbServer.py (2294 of 2294)
******************** TEST 'lldb-api :: tools/lldb-server/TestLldbGdbServer.py' FAILED ********************
Script:
--
/usr/bin/python3.10 /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./lib --env LLVM_INCLUDE_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/include --env LLVM_TOOLS_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin --arch aarch64 --build-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex --lldb-module-cache-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/lldb --compiler /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/clang --dsymutil /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/dsymutil --make /usr/bin/gmake --llvm-tools-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin --lldb-obj-root /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb --lldb-libs-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./lib --cmake-build-type Release /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/tools/lldb-server -p TestLldbGdbServer.py
--
Exit Code: 1

Command Output (stdout):
--
lldb version 22.0.0git (https://github.com/llvm/llvm-project.git revision 32127045c838fcc2aab816ee9126e69ec5e63135)
  clang revision 32127045c838fcc2aab816ee9126e69ec5e63135
  llvm revision 32127045c838fcc2aab816ee9126e69ec5e63135
Skipping the following test categories: ['libc++', 'msvcstl', 'dsym', 'gmodules', 'debugserver', 'objc']

--
Command Output (stderr):
--
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_Hc_then_Csignal_signals_correct_thread_launch_debugserver (TestLldbGdbServer.LldbGdbServerTestCase) (test case does not fall in any category of interest for this run) 
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_Hc_then_Csignal_signals_correct_thread_launch_llgs (TestLldbGdbServer.LldbGdbServerTestCase)
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_Hg_fails_on_another_pid_llgs (TestLldbGdbServer.LldbGdbServerTestCase)
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_Hg_fails_on_minus_one_pid_llgs (TestLldbGdbServer.LldbGdbServerTestCase)
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_Hg_fails_on_zero_pid_llgs (TestLldbGdbServer.LldbGdbServerTestCase)
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_Hg_switches_to_3_threads_launch_debugserver (TestLldbGdbServer.LldbGdbServerTestCase) (test case does not fall in any category of interest for this run) 
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_Hg_switches_to_3_threads_launch_llgs (TestLldbGdbServer.LldbGdbServerTestCase)
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_P_and_p_thread_suffix_work_debugserver (TestLldbGdbServer.LldbGdbServerTestCase) (test case does not fall in any category of interest for this run) 
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_P_and_p_thread_suffix_work_llgs (TestLldbGdbServer.LldbGdbServerTestCase)
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_P_writes_all_gpr_registers_debugserver (TestLldbGdbServer.LldbGdbServerTestCase) (test case does not fall in any category of interest for this run) 
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_P_writes_all_gpr_registers_llgs (TestLldbGdbServer.LldbGdbServerTestCase)
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_attach_commandline_continue_app_exits_debugserver (TestLldbGdbServer.LldbGdbServerTestCase) (test case does not fall in any category of interest for this run) 
lldb-server exiting...
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_attach_commandline_continue_app_exits_llgs (TestLldbGdbServer.LldbGdbServerTestCase)
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_c_packet_works_debugserver (TestLldbGdbServer.LldbGdbServerTestCase) (test case does not fall in any category of interest for this run) 
lldb-server exiting...
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_c_packet_works_llgs (TestLldbGdbServer.LldbGdbServerTestCase)
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_first_launch_stop_reply_thread_matches_first_qC_debugserver (TestLldbGdbServer.LldbGdbServerTestCase) (test case does not fall in any category of interest for this run) 
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_first_launch_stop_reply_thread_matches_first_qC_llgs (TestLldbGdbServer.LldbGdbServerTestCase)
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_hardware_breakpoint_set_and_remove_work_debugserver (TestLldbGdbServer.LldbGdbServerTestCase) (test case does not fall in any category of interest for this run) 
lldb-server exiting...
PASS: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_hardware_breakpoint_set_and_remove_work_llgs (TestLldbGdbServer.LldbGdbServerTestCase)

@kkent030315 kkent030315 deleted the addcoffexchara branch July 30, 2025 03:04
@mstorsjo
Copy link
Member

mstorsjo commented Jul 30, 2025

Actually, on second thought regarding the test binary - I don't think I see a specific reason why this binary can't just be synthesized using yaml2obj? To achieve that, you can run obj2yaml on the existing executable, then strip out unnecessary parts of the binary (for the purposes of this test, we don't really need any section contents in most sections - I guess this requires a debug directory in .rdata though, but we can cut out the unnecssary parts of it), and curate that into a small yaml file as input for the test. (And in many cases, the input can be in the test file itself instead of requiring a separate input file.)

@kkent030315
Copy link
Contributor Author

Actually, on second thought regarding the test binary - I don't think I see a specific reason why this binary can't just be synthesized using yaml2obj? To achieve that, you can run obj2yaml on the existing executable, then strip out unnecessary parts of the binary (for the purposes of this test, we don't really need any section contents in most sections - I guess this requires a debug directory in .rdata though, but we can cut out the unnecssary parts of it), and curate that into a small yaml file as input for the test. (And in many cases, the input can be in the test file itself instead of requiring a separate input file.)

Nice idea. I'll make a PR for that soon.

@mstorsjo
Copy link
Member

mstorsjo commented Aug 4, 2025

Actually, on second thought regarding the test binary - I don't think I see a specific reason why this binary can't just be synthesized using yaml2obj? To achieve that, you can run obj2yaml on the existing executable, then strip out unnecessary parts of the binary (for the purposes of this test, we don't really need any section contents in most sections - I guess this requires a debug directory in .rdata though, but we can cut out the unnecssary parts of it), and curate that into a small yaml file as input for the test. (And in many cases, the input can be in the test file itself instead of requiring a separate input file.)

Nice idea. I'll make a PR for that soon.

Any update on this?

@kkent030315
Copy link
Contributor Author

Actually, on second thought regarding the test binary - I don't think I see a specific reason why this binary can't just be synthesized using yaml2obj? To achieve that, you can run obj2yaml on the existing executable, then strip out unnecessary parts of the binary (for the purposes of this test, we don't really need any section contents in most sections - I guess this requires a debug directory in .rdata though, but we can cut out the unnecssary parts of it), and curate that into a small yaml file as input for the test. (And in many cases, the input can be in the test file itself instead of requiring a separate input file.)

Nice idea. I'll make a PR for that soon.

Any update on this?

The PR landed in #151978 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants