[all-commits] [llvm/llvm-project] 992356: Add CodeView S_LABEL32 symbols for jump table targ...

sivadeilra via All-commits all-commits at lists.llvm.org
Mon Jul 7 12:26:52 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9923565fb8b9a6215e85ad1bb542c301332a502d
      https://github.com/llvm/llvm-project/commit/9923565fb8b9a6215e85ad1bb542c301332a502d
  Author: sivadeilra <ardavis at microsoft.com>
  Date:   2025-07-07 (Mon, 07 Jul 2025)

  Changed paths:
    M llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
    M llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h
    M llvm/test/DebugInfo/COFF/jump-table.ll

  Log Message:
  -----------
  Add CodeView S_LABEL32 symbols for jump table targets (for Windows debugging) (#146121)

This PR provides more information to debuggers and analysis tools on
Windows. It adds `S_LABEL32` symbols for each target BB of each jump
table. This allows debuggers to insert symbolic labels when
disassembling code. `S_LABEL32` symbol records indicate that a location
is definitely code, and can optionally associate a string label with the
code location. BBs generated for jump tables may or may not have string
labels, so it is acceptable for the "name" field within `S_LABEL32`
symbols to be an empty string.

More importantly, this PR allows Windows analysis tools, such as those
that generate hot-patches for the Windows kernel, to use these labels to
distinguish code basic blocks from data blocks. Microsoft's analysis
tools (similar to Bolt) rely on being able to identify all code blocks,
so that the tools can traverse all instructions and verify that
important requirements for hot-patching are met.

This PR has no effect on code generation. It only affects the CodeView
symbols that are emitted into OBJ files, which the linker then
repackages into PDB files.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list