summaryrefslogtreecommitdiff
path: root/lldb/test/API/functionalities/disassembler-variables
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/API/functionalities/disassembler-variables')
-rw-r--r--lldb/test/API/functionalities/disassembler-variables/Makefile32
-rw-r--r--lldb/test/API/functionalities/disassembler-variables/TestVariableAnnotationsDisassembler.py118
-rw-r--r--lldb/test/API/functionalities/disassembler-variables/d_original_example.s461
-rw-r--r--lldb/test/API/functionalities/disassembler-variables/live_across_call.s371
-rw-r--r--lldb/test/API/functionalities/disassembler-variables/loop_reg_rotate.s557
-rw-r--r--lldb/test/API/functionalities/disassembler-variables/regs_fp_params.s304
-rw-r--r--lldb/test/API/functionalities/disassembler-variables/regs_int_params.s312
-rw-r--r--lldb/test/API/functionalities/disassembler-variables/regs_mixed_params.s375
-rw-r--r--lldb/test/API/functionalities/disassembler-variables/seed_reg_const_undef.s289
9 files changed, 2819 insertions, 0 deletions
diff --git a/lldb/test/API/functionalities/disassembler-variables/Makefile b/lldb/test/API/functionalities/disassembler-variables/Makefile
new file mode 100644
index 000000000000..3d4bcd22fa65
--- /dev/null
+++ b/lldb/test/API/functionalities/disassembler-variables/Makefile
@@ -0,0 +1,32 @@
+# List all assembler inputs stable test fixtures.
+ASM_SOURCES := \
+ d_original_example.s \
+ regs_int_params.s \
+ regs_fp_params.s \
+ regs_mixed_params.s \
+ live_across_call.s \
+ loop_reg_rotate.s \
+ seed_reg_const_undef.s
+
+ASM_OBJS := $(ASM_SOURCES:.s=.o)
+
+# Provide a tiny dummy so the harness can link an exe without ASM_OBJS.
+C_SOURCES := dummy_main.c
+
+# Generating the dummy source on demand.
+dummy_main.c:
+ @echo 'int main(void){return 0;}' > $@
+
+# Assemble .s → .o using the configured compiler.
+%.o: %.s
+ $(CC) -c -x assembler $< -o $@
+
+# Default target: build all .o fixtures and the dummy exe.
+.PHONY: all
+all: $(ASM_OBJS) $(EXE)
+
+# Keeping things tidy.
+clean::
+ $(RM) -f $(ASM_OBJS) dummy_main.c
+
+include Makefile.rules
diff --git a/lldb/test/API/functionalities/disassembler-variables/TestVariableAnnotationsDisassembler.py b/lldb/test/API/functionalities/disassembler-variables/TestVariableAnnotationsDisassembler.py
new file mode 100644
index 000000000000..f107efbdddde
--- /dev/null
+++ b/lldb/test/API/functionalities/disassembler-variables/TestVariableAnnotationsDisassembler.py
@@ -0,0 +1,118 @@
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+import lldb
+import os
+import re
+
+
+# Requires ELF assembler directives (.section … @progbits, .ident, etc.);
+# not compatible with COFF/Mach-O toolchains.
+@skipUnlessPlatform(["linux", "android", "freebsd", "netbsd"])
+class TestVariableAnnotationsDisassembler(TestBase):
+ def _build_obj(self, obj_name: str) -> str:
+ # Let the Makefile build all .o’s (pattern rule). Then grab the one we need.
+ self.build()
+ obj = self.getBuildArtifact(obj_name)
+ self.assertTrue(os.path.exists(obj), f"missing object: {obj}")
+ return obj
+
+ def _create_target(self, path):
+ target = self.dbg.CreateTarget(path)
+ self.assertTrue(target, f"failed to create target for {path}")
+ return target
+
+ def _disassemble_verbose_symbol(self, symname):
+ self.runCmd(f"disassemble -n {symname} -v", check=True)
+ return self.res.GetOutput()
+
+ @skipIf(archs=no_match(["x86_64"]))
+ def test_d_original_example_O1(self):
+ obj = self._build_obj("d_original_example.o")
+ target = self._create_target(obj)
+ out = self._disassemble_verbose_symbol("main")
+ print(out)
+ self.assertIn("argc = ", out)
+ self.assertIn("argv = ", out)
+ self.assertIn("i = ", out)
+ self.assertNotIn("<decoding error>", out)
+
+ @no_debug_info_test
+ @skipIf(archs=no_match(["x86_64"]))
+ def test_regs_int_params(self):
+ obj = self._build_obj("regs_int_params.o")
+ target = self._create_target(obj)
+ out = self._disassemble_verbose_symbol("regs_int_params")
+ print(out)
+ self.assertRegex(out, r"\ba\s*=\s*(DW_OP_reg5\b|RDI\b)")
+ self.assertRegex(out, r"\bb\s*=\s*(DW_OP_reg4\b|RSI\b)")
+ self.assertRegex(out, r"\bc\s*=\s*(DW_OP_reg1\b|RDX\b)")
+ self.assertRegex(out, r"\bd\s*=\s*(DW_OP_reg2\b|RCX\b)")
+ self.assertRegex(out, r"\be\s*=\s*(DW_OP_reg8\b|R8\b)")
+ self.assertRegex(out, r"\bf\s*=\s*(DW_OP_reg9\b|R9\b)")
+ self.assertNotIn("<decoding error>", out)
+
+ @no_debug_info_test
+ @skipIf(archs=no_match(["x86_64"]))
+ def test_regs_fp_params(self):
+ obj = self._build_obj("regs_fp_params.o")
+ target = self._create_target(obj)
+ out = self._disassemble_verbose_symbol("regs_fp_params")
+ print(out)
+ self.assertRegex(out, r"\ba\s*=\s*(DW_OP_reg17\b|XMM0\b)")
+ self.assertRegex(out, r"\bb\s*=\s*(DW_OP_reg18\b|XMM1\b)")
+ self.assertRegex(out, r"\bc\s*=\s*(DW_OP_reg19\b|XMM2\b)")
+ self.assertRegex(out, r"\bd\s*=\s*(DW_OP_reg20\b|XMM3\b)")
+ self.assertRegex(out, r"\be\s*=\s*(DW_OP_reg21\b|XMM4\b)")
+ self.assertRegex(out, r"\bf\s*=\s*(DW_OP_reg22\b|XMM5\b)")
+ self.assertNotIn("<decoding error>", out)
+
+ @no_debug_info_test
+ @skipIf(archs=no_match(["x86_64"]))
+ def test_regs_mixed_params(self):
+ obj = self._build_obj("regs_mixed_params.o")
+ target = self._create_target(obj)
+ out = self._disassemble_verbose_symbol("regs_mixed_params")
+ print(out)
+ self.assertRegex(out, r"\ba\s*=\s*(DW_OP_reg5\b|RDI\b)")
+ self.assertRegex(out, r"\bb\s*=\s*(DW_OP_reg4\b|RSI\b)")
+ self.assertRegex(out, r"\bx\s*=\s*(DW_OP_reg17\b|XMM0\b|DW_OP_reg\d+\b)")
+ self.assertRegex(out, r"\by\s*=\s*(DW_OP_reg18\b|XMM1\b|DW_OP_reg\d+\b)")
+ self.assertRegex(out, r"\bc\s*=\s*(DW_OP_reg1\b|RDX\b)")
+ self.assertRegex(out, r"\bz\s*=\s*(DW_OP_reg19\b|XMM2\b|DW_OP_reg\d+\b)")
+ self.assertNotIn("<decoding error>", out)
+
+ @no_debug_info_test
+ @skipIf(archs=no_match(["x86_64"]))
+ def test_live_across_call(self):
+ obj = self._build_obj("live_across_call.o")
+ target = self._create_target(obj)
+ out = self._disassemble_verbose_symbol("live_across_call")
+ print(out)
+ self.assertRegex(out, r"\bx\s*=\s*(DW_OP_reg5\b|RDI\b)")
+ self.assertIn("call", out)
+ self.assertRegex(out, r"\br\s*=\s*(DW_OP_reg0\b|RAX\b|DW_OP_reg\d+\b)")
+ self.assertNotIn("<decoding error>", out)
+
+ @no_debug_info_test
+ @skipIf(archs=no_match(["x86_64"]))
+ def test_loop_reg_rotate(self):
+ obj = self._build_obj("loop_reg_rotate.o")
+ target = self._create_target(obj)
+ out = self._disassemble_verbose_symbol("loop_reg_rotate")
+ print(out)
+ self.assertRegex(out, r"\bn\s*=\s*(DW_OP_reg\d+\b|R[A-Z0-9]+)")
+ self.assertRegex(out, r"\bseed\s*=\s*(DW_OP_reg\d+\b|R[A-Z0-9]+)")
+ self.assertRegex(out, r"\bk\s*=\s*(DW_OP_reg\d+\b|R[A-Z0-9]+)")
+ self.assertRegex(out, r"\bj\s*=\s*(DW_OP_reg\d+\b|R[A-Z0-9]+)")
+ self.assertRegex(out, r"\bi\s*=\s*(DW_OP_reg\d+\b|R[A-Z0-9]+)")
+ self.assertNotIn("<decoding error>", out)
+
+ @no_debug_info_test
+ @skipIf(archs=no_match(["x86_64"]))
+ def test_seed_reg_const_undef(self):
+ obj = self._build_obj("seed_reg_const_undef.o")
+ target = self._create_target(obj)
+ out = self._disassemble_verbose_symbol("main")
+ print(out)
+ self.assertRegex(out, r"\b(i|argc)\s*=\s*(DW_OP_reg\d+\b|R[A-Z0-9]+)")
+ self.assertNotIn("<decoding error>", out)
diff --git a/lldb/test/API/functionalities/disassembler-variables/d_original_example.s b/lldb/test/API/functionalities/disassembler-variables/d_original_example.s
new file mode 100644
index 000000000000..c38742cfc683
--- /dev/null
+++ b/lldb/test/API/functionalities/disassembler-variables/d_original_example.s
@@ -0,0 +1,461 @@
+/* Original C (for context):
+* #include <stdio.h>
+*
+* int main(int argc, char **argv) {
+* for (int i = 1; i < argc; ++i)
+* puts(argv[i]);
+* return 0;
+* }
+*/
+ .file "d_original_example.c"
+ .text
+ .globl main # -- Begin function main
+ .p2align 4
+ .type main,@function
+main: # @main
+.Lfunc_begin0:
+ .file 0 "." "d_original_example.c" md5 0x25192a1d5a6018cf37d369f9004fab00
+ .cfi_startproc
+# %bb.0: # %entry
+ #DEBUG_VALUE: main:argc <- $edi
+ #DEBUG_VALUE: main:argv <- $rsi
+ #DEBUG_VALUE: i <- 1
+ .loc 0 4 21 prologue_end # d_original_example.c:4:21
+ cmpl $2, %edi
+.Ltmp0:
+ .loc 0 4 3 is_stmt 0 # d_original_example.c:4:3
+ jl .LBB0_4
+.Ltmp1:
+# %bb.1: # %for.body.preheader
+ #DEBUG_VALUE: main:argc <- $edi
+ #DEBUG_VALUE: main:argv <- $rsi
+ #DEBUG_VALUE: i <- 1
+ pushq %rbp
+ .cfi_def_cfa_offset 16
+ .cfi_offset %rbp, -16
+ movq %rsp, %rbp
+ .cfi_def_cfa_register %rbp
+ pushq %r15
+ pushq %r14
+ pushq %rbx
+ pushq %rax
+ .cfi_offset %rbx, -40
+ .cfi_offset %r14, -32
+ .cfi_offset %r15, -24
+ movq %rsi, %rbx
+.Ltmp2:
+ .loc 0 4 21 # d_original_example.c:4:21
+ movl %edi, %r14d
+.Ltmp3:
+ #DEBUG_VALUE: main:argc <- $r14d
+ .loc 0 0 21 # d_original_example.c:0:21
+ movl $1, %r15d
+.Ltmp4:
+ .p2align 4
+.LBB0_2: # %for.body
+ # =>This Inner Loop Header: Depth=1
+ #DEBUG_VALUE: main:argc <- $r14d
+ #DEBUG_VALUE: main:argv <- $rbx
+ #DEBUG_VALUE: i <- $r15
+ .loc 0 5 10 is_stmt 1 # d_original_example.c:5:10
+ movq (%rbx,%r15,8), %rdi
+ .loc 0 5 5 is_stmt 0 # d_original_example.c:5:5
+ callq puts@PLT
+.Ltmp5:
+ .loc 0 4 29 is_stmt 1 # d_original_example.c:4:29
+ incq %r15
+.Ltmp6:
+ #DEBUG_VALUE: i <- $r15
+ .loc 0 4 21 is_stmt 0 # d_original_example.c:4:21
+ cmpq %r15, %r14
+.Ltmp7:
+ .loc 0 4 3 # d_original_example.c:4:3
+ jne .LBB0_2
+.Ltmp8:
+# %bb.3:
+ #DEBUG_VALUE: main:argc <- $r14d
+ #DEBUG_VALUE: main:argv <- $rbx
+ #DEBUG_VALUE: i <- $r15
+ .loc 0 0 3 # d_original_example.c:0:3
+ addq $8, %rsp
+ popq %rbx
+.Ltmp9:
+ #DEBUG_VALUE: main:argv <- [DW_OP_LLVM_entry_value 1] $rsi
+ popq %r14
+.Ltmp10:
+ #DEBUG_VALUE: main:argc <- [DW_OP_LLVM_entry_value 1] $edi
+ popq %r15
+ popq %rbp
+ .cfi_def_cfa %rsp, 8
+ .cfi_restore %rbx
+ .cfi_restore %r14
+ .cfi_restore %r15
+ .cfi_restore %rbp
+.Ltmp11:
+.LBB0_4: # %for.cond.cleanup
+ #DEBUG_VALUE: main:argc <- [DW_OP_LLVM_entry_value 1] $edi
+ #DEBUG_VALUE: main:argv <- [DW_OP_LLVM_entry_value 1] $rsi
+ .loc 0 6 3 is_stmt 1 # d_original_example.c:6:3
+ xorl %eax, %eax
+ retq
+.Ltmp12:
+.Lfunc_end0:
+ .size main, .Lfunc_end0-main
+ .cfi_endproc
+ .file 1 "/usr/include" "stdio.h" md5 0xf31eefcc3f15835fc5a4023a625cf609
+ # -- End function
+ .section .debug_loclists,"",@progbits
+ .long .Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length
+.Ldebug_list_header_start0:
+ .short 5 # Version
+ .byte 8 # Address size
+ .byte 0 # Segment selector size
+ .long 3 # Offset entry count
+.Lloclists_table_base0:
+ .long .Ldebug_loc0-.Lloclists_table_base0
+ .long .Ldebug_loc1-.Lloclists_table_base0
+ .long .Ldebug_loc2-.Lloclists_table_base0
+.Ldebug_loc0:
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Lfunc_begin0-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp3-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 85 # super-register DW_OP_reg5
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp3-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp10-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 94 # super-register DW_OP_reg14
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp10-.Lfunc_begin0 # starting offset
+ .uleb128 .Lfunc_end0-.Lfunc_begin0 # ending offset
+ .byte 4 # Loc expr size
+ .byte 163 # DW_OP_entry_value
+ .byte 1 # 1
+ .byte 85 # super-register DW_OP_reg5
+ .byte 159 # DW_OP_stack_value
+ .byte 0 # DW_LLE_end_of_list
+.Ldebug_loc1:
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Lfunc_begin0-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp4-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 84 # DW_OP_reg4
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp4-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp9-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 83 # DW_OP_reg3
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp9-.Lfunc_begin0 # starting offset
+ .uleb128 .Lfunc_end0-.Lfunc_begin0 # ending offset
+ .byte 4 # Loc expr size
+ .byte 163 # DW_OP_entry_value
+ .byte 1 # 1
+ .byte 84 # DW_OP_reg4
+ .byte 159 # DW_OP_stack_value
+ .byte 0 # DW_LLE_end_of_list
+.Ldebug_loc2:
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Lfunc_begin0-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp4-.Lfunc_begin0 # ending offset
+ .byte 3 # Loc expr size
+ .byte 17 # DW_OP_consts
+ .byte 1 # 1
+ .byte 159 # DW_OP_stack_value
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp4-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp8-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 95 # DW_OP_reg15
+ .byte 0 # DW_LLE_end_of_list
+.Ldebug_list_header_end0:
+ .section .debug_abbrev,"",@progbits
+ .byte 1 # Abbreviation Code
+ .byte 17 # DW_TAG_compile_unit
+ .byte 1 # DW_CHILDREN_yes
+ .byte 37 # DW_AT_producer
+ .byte 37 # DW_FORM_strx1
+ .byte 19 # DW_AT_language
+ .byte 5 # DW_FORM_data2
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 114 # DW_AT_str_offsets_base
+ .byte 23 # DW_FORM_sec_offset
+ .byte 16 # DW_AT_stmt_list
+ .byte 23 # DW_FORM_sec_offset
+ .byte 27 # DW_AT_comp_dir
+ .byte 37 # DW_FORM_strx1
+ .byte 17 # DW_AT_low_pc
+ .byte 27 # DW_FORM_addrx
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 115 # DW_AT_addr_base
+ .byte 23 # DW_FORM_sec_offset
+ .ascii "\214\001" # DW_AT_loclists_base
+ .byte 23 # DW_FORM_sec_offset
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 2 # Abbreviation Code
+ .byte 46 # DW_TAG_subprogram
+ .byte 1 # DW_CHILDREN_yes
+ .byte 17 # DW_AT_low_pc
+ .byte 27 # DW_FORM_addrx
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 64 # DW_AT_frame_base
+ .byte 24 # DW_FORM_exprloc
+ .byte 122 # DW_AT_call_all_calls
+ .byte 25 # DW_FORM_flag_present
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 39 # DW_AT_prototyped
+ .byte 25 # DW_FORM_flag_present
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 63 # DW_AT_external
+ .byte 25 # DW_FORM_flag_present
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 3 # Abbreviation Code
+ .byte 5 # DW_TAG_formal_parameter
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 34 # DW_FORM_loclistx
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 4 # Abbreviation Code
+ .byte 11 # DW_TAG_lexical_block
+ .byte 1 # DW_CHILDREN_yes
+ .byte 17 # DW_AT_low_pc
+ .byte 27 # DW_FORM_addrx
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 5 # Abbreviation Code
+ .byte 52 # DW_TAG_variable
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 34 # DW_FORM_loclistx
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 6 # Abbreviation Code
+ .byte 72 # DW_TAG_call_site
+ .byte 0 # DW_CHILDREN_no
+ .byte 127 # DW_AT_call_origin
+ .byte 19 # DW_FORM_ref4
+ .byte 125 # DW_AT_call_return_pc
+ .byte 27 # DW_FORM_addrx
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 7 # Abbreviation Code
+ .byte 46 # DW_TAG_subprogram
+ .byte 1 # DW_CHILDREN_yes
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 5 # DW_FORM_data2
+ .byte 39 # DW_AT_prototyped
+ .byte 25 # DW_FORM_flag_present
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 60 # DW_AT_declaration
+ .byte 25 # DW_FORM_flag_present
+ .byte 63 # DW_AT_external
+ .byte 25 # DW_FORM_flag_present
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 8 # Abbreviation Code
+ .byte 5 # DW_TAG_formal_parameter
+ .byte 0 # DW_CHILDREN_no
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 9 # Abbreviation Code
+ .byte 36 # DW_TAG_base_type
+ .byte 0 # DW_CHILDREN_no
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 62 # DW_AT_encoding
+ .byte 11 # DW_FORM_data1
+ .byte 11 # DW_AT_byte_size
+ .byte 11 # DW_FORM_data1
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 10 # Abbreviation Code
+ .byte 15 # DW_TAG_pointer_type
+ .byte 0 # DW_CHILDREN_no
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 11 # Abbreviation Code
+ .byte 38 # DW_TAG_const_type
+ .byte 0 # DW_CHILDREN_no
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 0 # EOM(3)
+ .section .debug_info,"",@progbits
+.Lcu_begin0:
+ .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
+.Ldebug_info_start0:
+ .short 5 # DWARF version number
+ .byte 1 # DWARF Unit Type
+ .byte 8 # Address Size (in bytes)
+ .long .debug_abbrev # Offset Into Abbrev. Section
+ .byte 1 # Abbrev [1] 0xc:0x7f DW_TAG_compile_unit
+ .byte 0 # DW_AT_producer
+ .short 29 # DW_AT_language
+ .byte 1 # DW_AT_name
+ .long .Lstr_offsets_base0 # DW_AT_str_offsets_base
+ .long .Lline_table_start0 # DW_AT_stmt_list
+ .byte 2 # DW_AT_comp_dir
+ .byte 0 # DW_AT_low_pc
+ .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
+ .long .Laddr_table_base0 # DW_AT_addr_base
+ .long .Lloclists_table_base0 # DW_AT_loclists_base
+ .byte 2 # Abbrev [2] 0x27:0x38 DW_TAG_subprogram
+ .byte 0 # DW_AT_low_pc
+ .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
+ .byte 1 # DW_AT_frame_base
+ .byte 86
+ # DW_AT_call_all_calls
+ .byte 6 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 3 # DW_AT_decl_line
+ # DW_AT_prototyped
+ .long 110 # DW_AT_type
+ # DW_AT_external
+ .byte 3 # Abbrev [3] 0x36:0x9 DW_TAG_formal_parameter
+ .byte 0 # DW_AT_location
+ .byte 7 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 3 # DW_AT_decl_line
+ .long 110 # DW_AT_type
+ .byte 3 # Abbrev [3] 0x3f:0x9 DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 8 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 3 # DW_AT_decl_line
+ .long 128 # DW_AT_type
+ .byte 4 # Abbrev [4] 0x48:0x10 DW_TAG_lexical_block
+ .byte 0 # DW_AT_low_pc
+ .long .Ltmp8-.Lfunc_begin0 # DW_AT_high_pc
+ .byte 5 # Abbrev [5] 0x4e:0x9 DW_TAG_variable
+ .byte 2 # DW_AT_location
+ .byte 9 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 4 # DW_AT_decl_line
+ .long 110 # DW_AT_type
+ .byte 0 # End Of Children Mark
+ .byte 6 # Abbrev [6] 0x58:0x6 DW_TAG_call_site
+ .long 95 # DW_AT_call_origin
+ .byte 1 # DW_AT_call_return_pc
+ .byte 0 # End Of Children Mark
+ .byte 7 # Abbrev [7] 0x5f:0xf DW_TAG_subprogram
+ .byte 3 # DW_AT_name
+ .byte 1 # DW_AT_decl_file
+ .short 661 # DW_AT_decl_line
+ # DW_AT_prototyped
+ .long 110 # DW_AT_type
+ # DW_AT_declaration
+ # DW_AT_external
+ .byte 8 # Abbrev [8] 0x68:0x5 DW_TAG_formal_parameter
+ .long 114 # DW_AT_type
+ .byte 0 # End Of Children Mark
+ .byte 9 # Abbrev [9] 0x6e:0x4 DW_TAG_base_type
+ .byte 4 # DW_AT_name
+ .byte 5 # DW_AT_encoding
+ .byte 4 # DW_AT_byte_size
+ .byte 10 # Abbrev [10] 0x72:0x5 DW_TAG_pointer_type
+ .long 119 # DW_AT_type
+ .byte 11 # Abbrev [11] 0x77:0x5 DW_TAG_const_type
+ .long 124 # DW_AT_type
+ .byte 9 # Abbrev [9] 0x7c:0x4 DW_TAG_base_type
+ .byte 5 # DW_AT_name
+ .byte 6 # DW_AT_encoding
+ .byte 1 # DW_AT_byte_size
+ .byte 10 # Abbrev [10] 0x80:0x5 DW_TAG_pointer_type
+ .long 133 # DW_AT_type
+ .byte 10 # Abbrev [10] 0x85:0x5 DW_TAG_pointer_type
+ .long 124 # DW_AT_type
+ .byte 0 # End Of Children Mark
+.Ldebug_info_end0:
+ .section .debug_str_offsets,"",@progbits
+ .long 44 # Length of String Offsets Set
+ .short 5
+ .short 0
+.Lstr_offsets_base0:
+ .section .debug_str,"MS",@progbits,1
+.Linfo_string0:
+ .asciz "clang version 22.0.0git (https://github.com/UltimateForce21/llvm-project.git 79c0a9e1e7da0f727c41d27c9c6ff8a28bb7d06f)" # string offset=0
+.Linfo_string1:
+ .asciz "d_original_example.c" # string offset=119
+.Linfo_string2:
+ .asciz "." # string offset=140
+.Linfo_string3:
+ .asciz "puts" # string offset=142
+.Linfo_string4:
+ .asciz "int" # string offset=147
+.Linfo_string5:
+ .asciz "char" # string offset=151
+.Linfo_string6:
+ .asciz "main" # string offset=156
+.Linfo_string7:
+ .asciz "argc" # string offset=161
+.Linfo_string8:
+ .asciz "argv" # string offset=166
+.Linfo_string9:
+ .asciz "i" # string offset=171
+ .section .debug_str_offsets,"",@progbits
+ .long .Linfo_string0
+ .long .Linfo_string1
+ .long .Linfo_string2
+ .long .Linfo_string3
+ .long .Linfo_string4
+ .long .Linfo_string5
+ .long .Linfo_string6
+ .long .Linfo_string7
+ .long .Linfo_string8
+ .long .Linfo_string9
+ .section .debug_addr,"",@progbits
+ .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
+.Ldebug_addr_start0:
+ .short 5 # DWARF version number
+ .byte 8 # Address size
+ .byte 0 # Segment selector size
+.Laddr_table_base0:
+ .quad .Lfunc_begin0
+ .quad .Ltmp5
+.Ldebug_addr_end0:
+ .ident "clang version 22.0.0git (https://github.com/UltimateForce21/llvm-project.git 79c0a9e1e7da0f727c41d27c9c6ff8a28bb7d06f)"
+ .section ".note.GNU-stack","",@progbits
+ .addrsig
+ .section .debug_line,"",@progbits
+.Lline_table_start0:
diff --git a/lldb/test/API/functionalities/disassembler-variables/live_across_call.s b/lldb/test/API/functionalities/disassembler-variables/live_across_call.s
new file mode 100644
index 000000000000..cd9f08afe6fd
--- /dev/null
+++ b/lldb/test/API/functionalities/disassembler-variables/live_across_call.s
@@ -0,0 +1,371 @@
+/* Original C (for context):
+* // Declare a real external call so the compiler must respect ABI clobbers.
+* extern int leaf(int) __attribute__((noinline));
+*
+* __attribute__((noinline))
+* int live_across_call(int x) {
+* volatile int a = x; // a starts in a GPR (from arg)
+* asm volatile("" :: "r"(a)); // keep 'a' live in a register
+* int r = leaf(a); // 'a' is live across the call
+* asm volatile("" :: "r"(a), "r"(r));// still live afterwards
+* return a + r;
+* }
+*/
+ .file "live_across_call.c"
+ .text
+ .globl live_across_call # -- Begin function live_across_call
+ .p2align 4
+ .type live_across_call,@function
+live_across_call: # @live_across_call
+.Lfunc_begin0:
+ .file 0 "." "live_across_call.c" md5 0x351c37295026edf0d468774d35f47e5e
+ .loc 0 5 0 # live_across_call.c:5:0
+ .cfi_startproc
+# %bb.0: # %entry
+ #DEBUG_VALUE: live_across_call:x <- $edi
+ pushq %rbp
+ .cfi_def_cfa_offset 16
+ .cfi_offset %rbp, -16
+ movq %rsp, %rbp
+ .cfi_def_cfa_register %rbp
+ subq $16, %rsp
+.Ltmp0:
+ .loc 0 6 16 prologue_end # live_across_call.c:6:16
+ movl %edi, -4(%rbp)
+ .loc 0 7 26 # live_across_call.c:7:26
+ movl -4(%rbp), %eax
+ .loc 0 7 3 is_stmt 0 # live_across_call.c:7:3
+ #APP
+ #NO_APP
+ .loc 0 8 16 is_stmt 1 # live_across_call.c:8:16
+ movl -4(%rbp), %edi
+.Ltmp1:
+ #DEBUG_VALUE: live_across_call:x <- [DW_OP_LLVM_entry_value 1] $edi
+ .loc 0 8 11 is_stmt 0 # live_across_call.c:8:11
+ callq leaf@PLT
+.Ltmp2:
+ #DEBUG_VALUE: live_across_call:r <- $eax
+ .loc 0 9 26 is_stmt 1 # live_across_call.c:9:26
+ movl -4(%rbp), %ecx
+ .loc 0 9 3 is_stmt 0 # live_across_call.c:9:3
+ #APP
+ #NO_APP
+ .loc 0 10 12 is_stmt 1 # live_across_call.c:10:12
+ addl -4(%rbp), %eax
+.Ltmp3:
+ .loc 0 10 3 epilogue_begin is_stmt 0 # live_across_call.c:10:3
+ addq $16, %rsp
+ popq %rbp
+ .cfi_def_cfa %rsp, 8
+ retq
+.Ltmp4:
+.Lfunc_end0:
+ .size live_across_call, .Lfunc_end0-live_across_call
+ .cfi_endproc
+ # -- End function
+ .section .debug_loclists,"",@progbits
+ .long .Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length
+.Ldebug_list_header_start0:
+ .short 5 # Version
+ .byte 8 # Address size
+ .byte 0 # Segment selector size
+ .long 2 # Offset entry count
+.Lloclists_table_base0:
+ .long .Ldebug_loc0-.Lloclists_table_base0
+ .long .Ldebug_loc1-.Lloclists_table_base0
+.Ldebug_loc0:
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Lfunc_begin0-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp1-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 85 # super-register DW_OP_reg5
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp1-.Lfunc_begin0 # starting offset
+ .uleb128 .Lfunc_end0-.Lfunc_begin0 # ending offset
+ .byte 4 # Loc expr size
+ .byte 163 # DW_OP_entry_value
+ .byte 1 # 1
+ .byte 85 # super-register DW_OP_reg5
+ .byte 159 # DW_OP_stack_value
+ .byte 0 # DW_LLE_end_of_list
+.Ldebug_loc1:
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp2-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp3-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 80 # super-register DW_OP_reg0
+ .byte 0 # DW_LLE_end_of_list
+.Ldebug_list_header_end0:
+ .section .debug_abbrev,"",@progbits
+ .byte 1 # Abbreviation Code
+ .byte 17 # DW_TAG_compile_unit
+ .byte 1 # DW_CHILDREN_yes
+ .byte 37 # DW_AT_producer
+ .byte 37 # DW_FORM_strx1
+ .byte 19 # DW_AT_language
+ .byte 5 # DW_FORM_data2
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 114 # DW_AT_str_offsets_base
+ .byte 23 # DW_FORM_sec_offset
+ .byte 16 # DW_AT_stmt_list
+ .byte 23 # DW_FORM_sec_offset
+ .byte 27 # DW_AT_comp_dir
+ .byte 37 # DW_FORM_strx1
+ .byte 17 # DW_AT_low_pc
+ .byte 27 # DW_FORM_addrx
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 115 # DW_AT_addr_base
+ .byte 23 # DW_FORM_sec_offset
+ .ascii "\214\001" # DW_AT_loclists_base
+ .byte 23 # DW_FORM_sec_offset
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 2 # Abbreviation Code
+ .byte 46 # DW_TAG_subprogram
+ .byte 1 # DW_CHILDREN_yes
+ .byte 17 # DW_AT_low_pc
+ .byte 27 # DW_FORM_addrx
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 64 # DW_AT_frame_base
+ .byte 24 # DW_FORM_exprloc
+ .byte 122 # DW_AT_call_all_calls
+ .byte 25 # DW_FORM_flag_present
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 39 # DW_AT_prototyped
+ .byte 25 # DW_FORM_flag_present
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 63 # DW_AT_external
+ .byte 25 # DW_FORM_flag_present
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 3 # Abbreviation Code
+ .byte 5 # DW_TAG_formal_parameter
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 34 # DW_FORM_loclistx
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 4 # Abbreviation Code
+ .byte 52 # DW_TAG_variable
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 24 # DW_FORM_exprloc
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 5 # Abbreviation Code
+ .byte 52 # DW_TAG_variable
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 34 # DW_FORM_loclistx
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 6 # Abbreviation Code
+ .byte 72 # DW_TAG_call_site
+ .byte 0 # DW_CHILDREN_no
+ .byte 127 # DW_AT_call_origin
+ .byte 19 # DW_FORM_ref4
+ .byte 125 # DW_AT_call_return_pc
+ .byte 27 # DW_FORM_addrx
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 7 # Abbreviation Code
+ .byte 46 # DW_TAG_subprogram
+ .byte 1 # DW_CHILDREN_yes
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 39 # DW_AT_prototyped
+ .byte 25 # DW_FORM_flag_present
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 60 # DW_AT_declaration
+ .byte 25 # DW_FORM_flag_present
+ .byte 63 # DW_AT_external
+ .byte 25 # DW_FORM_flag_present
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 8 # Abbreviation Code
+ .byte 5 # DW_TAG_formal_parameter
+ .byte 0 # DW_CHILDREN_no
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 9 # Abbreviation Code
+ .byte 36 # DW_TAG_base_type
+ .byte 0 # DW_CHILDREN_no
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 62 # DW_AT_encoding
+ .byte 11 # DW_FORM_data1
+ .byte 11 # DW_AT_byte_size
+ .byte 11 # DW_FORM_data1
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 10 # Abbreviation Code
+ .byte 53 # DW_TAG_volatile_type
+ .byte 0 # DW_CHILDREN_no
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 0 # EOM(3)
+ .section .debug_info,"",@progbits
+.Lcu_begin0:
+ .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
+.Ldebug_info_start0:
+ .short 5 # DWARF version number
+ .byte 1 # DWARF Unit Type
+ .byte 8 # Address Size (in bytes)
+ .long .debug_abbrev # Offset Into Abbrev. Section
+ .byte 1 # Abbrev [1] 0xc:0x66 DW_TAG_compile_unit
+ .byte 0 # DW_AT_producer
+ .short 29 # DW_AT_language
+ .byte 1 # DW_AT_name
+ .long .Lstr_offsets_base0 # DW_AT_str_offsets_base
+ .long .Lline_table_start0 # DW_AT_stmt_list
+ .byte 2 # DW_AT_comp_dir
+ .byte 0 # DW_AT_low_pc
+ .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
+ .long .Laddr_table_base0 # DW_AT_addr_base
+ .long .Lloclists_table_base0 # DW_AT_loclists_base
+ .byte 2 # Abbrev [2] 0x27:0x33 DW_TAG_subprogram
+ .byte 0 # DW_AT_low_pc
+ .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
+ .byte 1 # DW_AT_frame_base
+ .byte 86
+ # DW_AT_call_all_calls
+ .byte 5 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 5 # DW_AT_decl_line
+ # DW_AT_prototyped
+ .long 104 # DW_AT_type
+ # DW_AT_external
+ .byte 3 # Abbrev [3] 0x36:0x9 DW_TAG_formal_parameter
+ .byte 0 # DW_AT_location
+ .byte 7 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 5 # DW_AT_decl_line
+ .long 104 # DW_AT_type
+ .byte 4 # Abbrev [4] 0x3f:0xb DW_TAG_variable
+ .byte 2 # DW_AT_location
+ .byte 145
+ .byte 124
+ .byte 6 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 6 # DW_AT_decl_line
+ .long 108 # DW_AT_type
+ .byte 5 # Abbrev [5] 0x4a:0x9 DW_TAG_variable
+ .byte 1 # DW_AT_location
+ .byte 8 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 8 # DW_AT_decl_line
+ .long 104 # DW_AT_type
+ .byte 6 # Abbrev [6] 0x53:0x6 DW_TAG_call_site
+ .long 90 # DW_AT_call_origin
+ .byte 1 # DW_AT_call_return_pc
+ .byte 0 # End Of Children Mark
+ .byte 7 # Abbrev [7] 0x5a:0xe DW_TAG_subprogram
+ .byte 3 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ # DW_AT_prototyped
+ .long 104 # DW_AT_type
+ # DW_AT_declaration
+ # DW_AT_external
+ .byte 8 # Abbrev [8] 0x62:0x5 DW_TAG_formal_parameter
+ .long 104 # DW_AT_type
+ .byte 0 # End Of Children Mark
+ .byte 9 # Abbrev [9] 0x68:0x4 DW_TAG_base_type
+ .byte 4 # DW_AT_name
+ .byte 5 # DW_AT_encoding
+ .byte 4 # DW_AT_byte_size
+ .byte 10 # Abbrev [10] 0x6c:0x5 DW_TAG_volatile_type
+ .long 104 # DW_AT_type
+ .byte 0 # End Of Children Mark
+.Ldebug_info_end0:
+ .section .debug_str_offsets,"",@progbits
+ .long 40 # Length of String Offsets Set
+ .short 5
+ .short 0
+.Lstr_offsets_base0:
+ .section .debug_str,"MS",@progbits,1
+.Linfo_string0:
+ .asciz "clang version 22.0.0git (https://github.com/UltimateForce21/llvm-project.git 79c0a9e1e7da0f727c41d27c9c6ff8a28bb7d06f)" # string offset=0
+.Linfo_string1:
+ .asciz "live_across_call.c" # string offset=119
+.Linfo_string2:
+ .asciz "." # string offset=138
+.Linfo_string3:
+ .asciz "leaf" # string offset=140
+.Linfo_string4:
+ .asciz "int" # string offset=145
+.Linfo_string5:
+ .asciz "live_across_call" # string offset=149
+.Linfo_string6:
+ .asciz "a" # string offset=166
+.Linfo_string7:
+ .asciz "x" # string offset=168
+.Linfo_string8:
+ .asciz "r" # string offset=170
+ .section .debug_str_offsets,"",@progbits
+ .long .Linfo_string0
+ .long .Linfo_string1
+ .long .Linfo_string2
+ .long .Linfo_string3
+ .long .Linfo_string4
+ .long .Linfo_string5
+ .long .Linfo_string6
+ .long .Linfo_string7
+ .long .Linfo_string8
+ .section .debug_addr,"",@progbits
+ .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
+.Ldebug_addr_start0:
+ .short 5 # DWARF version number
+ .byte 8 # Address size
+ .byte 0 # Segment selector size
+.Laddr_table_base0:
+ .quad .Lfunc_begin0
+ .quad .Ltmp2
+.Ldebug_addr_end0:
+ .ident "clang version 22.0.0git (https://github.com/UltimateForce21/llvm-project.git 79c0a9e1e7da0f727c41d27c9c6ff8a28bb7d06f)"
+ .section ".note.GNU-stack","",@progbits
+ .addrsig
+ .section .debug_line,"",@progbits
+.Lline_table_start0:
diff --git a/lldb/test/API/functionalities/disassembler-variables/loop_reg_rotate.s b/lldb/test/API/functionalities/disassembler-variables/loop_reg_rotate.s
new file mode 100644
index 000000000000..c01e2b28fd2b
--- /dev/null
+++ b/lldb/test/API/functionalities/disassembler-variables/loop_reg_rotate.s
@@ -0,0 +1,557 @@
+/* Original C (for context):
+* __attribute__((noinline))
+* int loop_reg_rotate(int n, int seed) {
+* volatile int acc = seed; // keep as a named local
+* int i = 0, j = 1, k = 2; // extra pressure but not enough to spill
+*
+* for (int t = 0; t < n; ++t) {
+* // Mix uses so the allocator may reshuffle regs for 'acc'
+* acc = acc + i;
+* asm volatile("" :: "r"(acc)); // pin 'acc' live here
+* acc = acc ^ j;
+* asm volatile("" :: "r"(acc)); // and here
+* acc = acc + k;
+* i ^= acc; j += acc; k ^= j;
+* }
+*
+* asm volatile("" :: "r"(acc));
+* return acc + i + j + k;
+* }
+*/
+ .file "loop_reg_rotate.c"
+ .text
+ .globl loop_reg_rotate # -- Begin function loop_reg_rotate
+ .p2align 4
+ .type loop_reg_rotate,@function
+loop_reg_rotate: # @loop_reg_rotate
+.Lfunc_begin0:
+ .file 0 "." "loop_reg_rotate.c" md5 0x388f52de76e9442230e689fb9be1b4ef
+ .loc 0 2 0 # loop_reg_rotate.c:2:0
+ .cfi_startproc
+# %bb.0: # %entry
+ #DEBUG_VALUE: loop_reg_rotate:n <- $edi
+ #DEBUG_VALUE: loop_reg_rotate:seed <- $esi
+ pushq %rbp
+ .cfi_def_cfa_offset 16
+ .cfi_offset %rbp, -16
+ movq %rsp, %rbp
+ .cfi_def_cfa_register %rbp
+.Ltmp0:
+ .loc 0 3 16 prologue_end # loop_reg_rotate.c:3:16
+ movl %esi, -4(%rbp)
+.Ltmp1:
+ #DEBUG_VALUE: loop_reg_rotate:i <- 0
+ #DEBUG_VALUE: loop_reg_rotate:j <- 1
+ #DEBUG_VALUE: loop_reg_rotate:k <- 2
+ #DEBUG_VALUE: t <- 0
+ .loc 0 6 21 # loop_reg_rotate.c:6:21
+ testl %edi, %edi
+.Ltmp2:
+ .loc 0 6 3 is_stmt 0 # loop_reg_rotate.c:6:3
+ jle .LBB0_1
+.Ltmp3:
+# %bb.3: # %for.body.preheader
+ #DEBUG_VALUE: loop_reg_rotate:n <- $edi
+ #DEBUG_VALUE: loop_reg_rotate:seed <- $esi
+ #DEBUG_VALUE: loop_reg_rotate:i <- 0
+ #DEBUG_VALUE: loop_reg_rotate:j <- 1
+ #DEBUG_VALUE: loop_reg_rotate:k <- 2
+ #DEBUG_VALUE: t <- 0
+ .loc 0 0 3 # loop_reg_rotate.c:0:3
+ xorl %eax, %eax
+ movl $1, %edx
+ movl $2, %ecx
+.Ltmp4:
+ .p2align 4
+.LBB0_4: # %for.body
+ # =>This Inner Loop Header: Depth=1
+ #DEBUG_VALUE: loop_reg_rotate:n <- [DW_OP_LLVM_entry_value 1] $edi
+ #DEBUG_VALUE: loop_reg_rotate:seed <- [DW_OP_LLVM_entry_value 1] $esi
+ #DEBUG_VALUE: t <- [DW_OP_LLVM_arg 0, DW_OP_LLVM_arg 1, DW_OP_minus, DW_OP_consts 18446744073709551615, DW_OP_div, DW_OP_stack_value] undef, undef
+ #DEBUG_VALUE: loop_reg_rotate:k <- $ecx
+ #DEBUG_VALUE: loop_reg_rotate:j <- $edx
+ #DEBUG_VALUE: loop_reg_rotate:i <- $eax
+ .loc 0 8 9 is_stmt 1 # loop_reg_rotate.c:8:9
+ addl %eax, -4(%rbp)
+ .loc 0 9 28 # loop_reg_rotate.c:9:28
+ movl -4(%rbp), %esi
+ .loc 0 9 5 is_stmt 0 # loop_reg_rotate.c:9:5
+ #APP
+ #NO_APP
+ .loc 0 10 9 is_stmt 1 # loop_reg_rotate.c:10:9
+ xorl %edx, -4(%rbp)
+ .loc 0 11 28 # loop_reg_rotate.c:11:28
+ movl -4(%rbp), %esi
+ .loc 0 11 5 is_stmt 0 # loop_reg_rotate.c:11:5
+ #APP
+ #NO_APP
+ .loc 0 12 9 is_stmt 1 # loop_reg_rotate.c:12:9
+ addl %ecx, -4(%rbp)
+ .loc 0 13 7 # loop_reg_rotate.c:13:7
+ xorl -4(%rbp), %eax
+.Ltmp5:
+ #DEBUG_VALUE: loop_reg_rotate:i <- $eax
+ .loc 0 13 17 is_stmt 0 # loop_reg_rotate.c:13:17
+ addl -4(%rbp), %edx
+.Ltmp6:
+ #DEBUG_VALUE: loop_reg_rotate:j <- $edx
+ .loc 0 13 27 # loop_reg_rotate.c:13:27
+ xorl %edx, %ecx
+.Ltmp7:
+ #DEBUG_VALUE: loop_reg_rotate:k <- $ecx
+ #DEBUG_VALUE: t <- [DW_OP_LLVM_arg 0, DW_OP_LLVM_arg 1, DW_OP_minus, DW_OP_consts 18446744073709551615, DW_OP_div, DW_OP_consts 1, DW_OP_plus, DW_OP_stack_value] undef, undef
+ .loc 0 6 21 is_stmt 1 # loop_reg_rotate.c:6:21
+ decl %edi
+.Ltmp8:
+ .loc 0 6 3 is_stmt 0 # loop_reg_rotate.c:6:3
+ jne .LBB0_4
+ jmp .LBB0_2
+.Ltmp9:
+.LBB0_1:
+ #DEBUG_VALUE: loop_reg_rotate:n <- $edi
+ #DEBUG_VALUE: loop_reg_rotate:seed <- $esi
+ #DEBUG_VALUE: loop_reg_rotate:i <- 0
+ #DEBUG_VALUE: loop_reg_rotate:j <- 1
+ #DEBUG_VALUE: loop_reg_rotate:k <- 2
+ #DEBUG_VALUE: t <- 0
+ .loc 0 0 3 # loop_reg_rotate.c:0:3
+ movl $2, %ecx
+ movl $1, %edx
+ xorl %eax, %eax
+.Ltmp10:
+.LBB0_2: # %for.cond.cleanup
+ #DEBUG_VALUE: loop_reg_rotate:n <- [DW_OP_LLVM_entry_value 1] $edi
+ #DEBUG_VALUE: loop_reg_rotate:seed <- [DW_OP_LLVM_entry_value 1] $esi
+ .loc 0 16 26 is_stmt 1 # loop_reg_rotate.c:16:26
+ movl -4(%rbp), %esi
+ .loc 0 16 3 is_stmt 0 # loop_reg_rotate.c:16:3
+ #APP
+ #NO_APP
+ .loc 0 17 14 is_stmt 1 # loop_reg_rotate.c:17:14
+ addl %edx, %eax
+ .loc 0 17 18 is_stmt 0 # loop_reg_rotate.c:17:18
+ addl %ecx, %eax
+ .loc 0 17 22 # loop_reg_rotate.c:17:22
+ addl -4(%rbp), %eax
+ .loc 0 17 3 epilogue_begin # loop_reg_rotate.c:17:3
+ popq %rbp
+ .cfi_def_cfa %rsp, 8
+ retq
+.Ltmp11:
+.Lfunc_end0:
+ .size loop_reg_rotate, .Lfunc_end0-loop_reg_rotate
+ .cfi_endproc
+ # -- End function
+ .section .debug_loclists,"",@progbits
+ .long .Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length
+.Ldebug_list_header_start0:
+ .short 5 # Version
+ .byte 8 # Address size
+ .byte 0 # Segment selector size
+ .long 6 # Offset entry count
+.Lloclists_table_base0:
+ .long .Ldebug_loc0-.Lloclists_table_base0
+ .long .Ldebug_loc1-.Lloclists_table_base0
+ .long .Ldebug_loc2-.Lloclists_table_base0
+ .long .Ldebug_loc3-.Lloclists_table_base0
+ .long .Ldebug_loc4-.Lloclists_table_base0
+ .long .Ldebug_loc5-.Lloclists_table_base0
+.Ldebug_loc0:
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Lfunc_begin0-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp4-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 85 # super-register DW_OP_reg5
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp4-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp9-.Lfunc_begin0 # ending offset
+ .byte 4 # Loc expr size
+ .byte 163 # DW_OP_entry_value
+ .byte 1 # 1
+ .byte 85 # super-register DW_OP_reg5
+ .byte 159 # DW_OP_stack_value
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp9-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp10-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 85 # super-register DW_OP_reg5
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp10-.Lfunc_begin0 # starting offset
+ .uleb128 .Lfunc_end0-.Lfunc_begin0 # ending offset
+ .byte 4 # Loc expr size
+ .byte 163 # DW_OP_entry_value
+ .byte 1 # 1
+ .byte 85 # super-register DW_OP_reg5
+ .byte 159 # DW_OP_stack_value
+ .byte 0 # DW_LLE_end_of_list
+.Ldebug_loc1:
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Lfunc_begin0-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp4-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 84 # super-register DW_OP_reg4
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp4-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp9-.Lfunc_begin0 # ending offset
+ .byte 4 # Loc expr size
+ .byte 163 # DW_OP_entry_value
+ .byte 1 # 1
+ .byte 84 # super-register DW_OP_reg4
+ .byte 159 # DW_OP_stack_value
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp9-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp10-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 84 # super-register DW_OP_reg4
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp10-.Lfunc_begin0 # starting offset
+ .uleb128 .Lfunc_end0-.Lfunc_begin0 # ending offset
+ .byte 4 # Loc expr size
+ .byte 163 # DW_OP_entry_value
+ .byte 1 # 1
+ .byte 84 # super-register DW_OP_reg4
+ .byte 159 # DW_OP_stack_value
+ .byte 0 # DW_LLE_end_of_list
+.Ldebug_loc2:
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp1-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp4-.Lfunc_begin0 # ending offset
+ .byte 3 # Loc expr size
+ .byte 17 # DW_OP_consts
+ .byte 0 # 0
+ .byte 159 # DW_OP_stack_value
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp4-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp9-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 80 # super-register DW_OP_reg0
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp9-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp10-.Lfunc_begin0 # ending offset
+ .byte 3 # Loc expr size
+ .byte 17 # DW_OP_consts
+ .byte 0 # 0
+ .byte 159 # DW_OP_stack_value
+ .byte 0 # DW_LLE_end_of_list
+.Ldebug_loc3:
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp1-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp4-.Lfunc_begin0 # ending offset
+ .byte 3 # Loc expr size
+ .byte 17 # DW_OP_consts
+ .byte 1 # 1
+ .byte 159 # DW_OP_stack_value
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp4-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp9-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 81 # super-register DW_OP_reg1
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp9-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp10-.Lfunc_begin0 # ending offset
+ .byte 3 # Loc expr size
+ .byte 17 # DW_OP_consts
+ .byte 1 # 1
+ .byte 159 # DW_OP_stack_value
+ .byte 0 # DW_LLE_end_of_list
+.Ldebug_loc4:
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp1-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp4-.Lfunc_begin0 # ending offset
+ .byte 3 # Loc expr size
+ .byte 17 # DW_OP_consts
+ .byte 2 # 2
+ .byte 159 # DW_OP_stack_value
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp4-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp9-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 82 # super-register DW_OP_reg2
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp9-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp10-.Lfunc_begin0 # ending offset
+ .byte 3 # Loc expr size
+ .byte 17 # DW_OP_consts
+ .byte 2 # 2
+ .byte 159 # DW_OP_stack_value
+ .byte 0 # DW_LLE_end_of_list
+.Ldebug_loc5:
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp1-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp4-.Lfunc_begin0 # ending offset
+ .byte 3 # Loc expr size
+ .byte 17 # DW_OP_consts
+ .byte 0 # 0
+ .byte 159 # DW_OP_stack_value
+ .byte 0 # DW_LLE_end_of_list
+.Ldebug_list_header_end0:
+ .section .debug_abbrev,"",@progbits
+ .byte 1 # Abbreviation Code
+ .byte 17 # DW_TAG_compile_unit
+ .byte 1 # DW_CHILDREN_yes
+ .byte 37 # DW_AT_producer
+ .byte 37 # DW_FORM_strx1
+ .byte 19 # DW_AT_language
+ .byte 5 # DW_FORM_data2
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 114 # DW_AT_str_offsets_base
+ .byte 23 # DW_FORM_sec_offset
+ .byte 16 # DW_AT_stmt_list
+ .byte 23 # DW_FORM_sec_offset
+ .byte 27 # DW_AT_comp_dir
+ .byte 37 # DW_FORM_strx1
+ .byte 17 # DW_AT_low_pc
+ .byte 27 # DW_FORM_addrx
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 115 # DW_AT_addr_base
+ .byte 23 # DW_FORM_sec_offset
+ .ascii "\214\001" # DW_AT_loclists_base
+ .byte 23 # DW_FORM_sec_offset
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 2 # Abbreviation Code
+ .byte 46 # DW_TAG_subprogram
+ .byte 1 # DW_CHILDREN_yes
+ .byte 17 # DW_AT_low_pc
+ .byte 27 # DW_FORM_addrx
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 64 # DW_AT_frame_base
+ .byte 24 # DW_FORM_exprloc
+ .byte 122 # DW_AT_call_all_calls
+ .byte 25 # DW_FORM_flag_present
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 39 # DW_AT_prototyped
+ .byte 25 # DW_FORM_flag_present
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 63 # DW_AT_external
+ .byte 25 # DW_FORM_flag_present
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 3 # Abbreviation Code
+ .byte 5 # DW_TAG_formal_parameter
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 34 # DW_FORM_loclistx
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 4 # Abbreviation Code
+ .byte 52 # DW_TAG_variable
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 24 # DW_FORM_exprloc
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 5 # Abbreviation Code
+ .byte 52 # DW_TAG_variable
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 34 # DW_FORM_loclistx
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 6 # Abbreviation Code
+ .byte 11 # DW_TAG_lexical_block
+ .byte 1 # DW_CHILDREN_yes
+ .byte 17 # DW_AT_low_pc
+ .byte 27 # DW_FORM_addrx
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 7 # Abbreviation Code
+ .byte 36 # DW_TAG_base_type
+ .byte 0 # DW_CHILDREN_no
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 62 # DW_AT_encoding
+ .byte 11 # DW_FORM_data1
+ .byte 11 # DW_AT_byte_size
+ .byte 11 # DW_FORM_data1
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 8 # Abbreviation Code
+ .byte 53 # DW_TAG_volatile_type
+ .byte 0 # DW_CHILDREN_no
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 0 # EOM(3)
+ .section .debug_info,"",@progbits
+.Lcu_begin0:
+ .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
+.Ldebug_info_start0:
+ .short 5 # DWARF version number
+ .byte 1 # DWARF Unit Type
+ .byte 8 # Address Size (in bytes)
+ .long .debug_abbrev # Offset Into Abbrev. Section
+ .byte 1 # Abbrev [1] 0xc:0x7d DW_TAG_compile_unit
+ .byte 0 # DW_AT_producer
+ .short 29 # DW_AT_language
+ .byte 1 # DW_AT_name
+ .long .Lstr_offsets_base0 # DW_AT_str_offsets_base
+ .long .Lline_table_start0 # DW_AT_stmt_list
+ .byte 2 # DW_AT_comp_dir
+ .byte 0 # DW_AT_low_pc
+ .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
+ .long .Laddr_table_base0 # DW_AT_addr_base
+ .long .Lloclists_table_base0 # DW_AT_loclists_base
+ .byte 2 # Abbrev [2] 0x27:0x58 DW_TAG_subprogram
+ .byte 0 # DW_AT_low_pc
+ .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
+ .byte 1 # DW_AT_frame_base
+ .byte 86
+ # DW_AT_call_all_calls
+ .byte 3 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ # DW_AT_prototyped
+ .long 127 # DW_AT_type
+ # DW_AT_external
+ .byte 3 # Abbrev [3] 0x36:0x9 DW_TAG_formal_parameter
+ .byte 0 # DW_AT_location
+ .byte 6 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 127 # DW_AT_type
+ .byte 3 # Abbrev [3] 0x3f:0x9 DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 7 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 127 # DW_AT_type
+ .byte 4 # Abbrev [4] 0x48:0xb DW_TAG_variable
+ .byte 2 # DW_AT_location
+ .byte 145
+ .byte 124
+ .byte 5 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 3 # DW_AT_decl_line
+ .long 131 # DW_AT_type
+ .byte 5 # Abbrev [5] 0x53:0x9 DW_TAG_variable
+ .byte 2 # DW_AT_location
+ .byte 8 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 4 # DW_AT_decl_line
+ .long 127 # DW_AT_type
+ .byte 5 # Abbrev [5] 0x5c:0x9 DW_TAG_variable
+ .byte 3 # DW_AT_location
+ .byte 9 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 4 # DW_AT_decl_line
+ .long 127 # DW_AT_type
+ .byte 5 # Abbrev [5] 0x65:0x9 DW_TAG_variable
+ .byte 4 # DW_AT_location
+ .byte 10 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 4 # DW_AT_decl_line
+ .long 127 # DW_AT_type
+ .byte 6 # Abbrev [6] 0x6e:0x10 DW_TAG_lexical_block
+ .byte 1 # DW_AT_low_pc
+ .long .Ltmp9-.Ltmp1 # DW_AT_high_pc
+ .byte 5 # Abbrev [5] 0x74:0x9 DW_TAG_variable
+ .byte 5 # DW_AT_location
+ .byte 11 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 6 # DW_AT_decl_line
+ .long 127 # DW_AT_type
+ .byte 0 # End Of Children Mark
+ .byte 0 # End Of Children Mark
+ .byte 7 # Abbrev [7] 0x7f:0x4 DW_TAG_base_type
+ .byte 4 # DW_AT_name
+ .byte 5 # DW_AT_encoding
+ .byte 4 # DW_AT_byte_size
+ .byte 8 # Abbrev [8] 0x83:0x5 DW_TAG_volatile_type
+ .long 127 # DW_AT_type
+ .byte 0 # End Of Children Mark
+.Ldebug_info_end0:
+ .section .debug_str_offsets,"",@progbits
+ .long 52 # Length of String Offsets Set
+ .short 5
+ .short 0
+.Lstr_offsets_base0:
+ .section .debug_str,"MS",@progbits,1
+.Linfo_string0:
+ .asciz "clang version 22.0.0git (https://github.com/UltimateForce21/llvm-project.git 79c0a9e1e7da0f727c41d27c9c6ff8a28bb7d06f)" # string offset=0
+.Linfo_string1:
+ .asciz "loop_reg_rotate.c" # string offset=119
+.Linfo_string2:
+ .asciz "." # string offset=137
+.Linfo_string3:
+ .asciz "loop_reg_rotate" # string offset=139
+.Linfo_string4:
+ .asciz "int" # string offset=155
+.Linfo_string5:
+ .asciz "acc" # string offset=159
+.Linfo_string6:
+ .asciz "n" # string offset=163
+.Linfo_string7:
+ .asciz "seed" # string offset=165
+.Linfo_string8:
+ .asciz "i" # string offset=170
+.Linfo_string9:
+ .asciz "j" # string offset=172
+.Linfo_string10:
+ .asciz "k" # string offset=174
+.Linfo_string11:
+ .asciz "t" # string offset=176
+ .section .debug_str_offsets,"",@progbits
+ .long .Linfo_string0
+ .long .Linfo_string1
+ .long .Linfo_string2
+ .long .Linfo_string3
+ .long .Linfo_string4
+ .long .Linfo_string5
+ .long .Linfo_string6
+ .long .Linfo_string7
+ .long .Linfo_string8
+ .long .Linfo_string9
+ .long .Linfo_string10
+ .long .Linfo_string11
+ .section .debug_addr,"",@progbits
+ .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
+.Ldebug_addr_start0:
+ .short 5 # DWARF version number
+ .byte 8 # Address size
+ .byte 0 # Segment selector size
+.Laddr_table_base0:
+ .quad .Lfunc_begin0
+ .quad .Ltmp1
+.Ldebug_addr_end0:
+ .ident "clang version 22.0.0git (https://github.com/UltimateForce21/llvm-project.git 79c0a9e1e7da0f727c41d27c9c6ff8a28bb7d06f)"
+ .section ".note.GNU-stack","",@progbits
+ .addrsig
+ .section .debug_line,"",@progbits
+.Lline_table_start0:
diff --git a/lldb/test/API/functionalities/disassembler-variables/regs_fp_params.s b/lldb/test/API/functionalities/disassembler-variables/regs_fp_params.s
new file mode 100644
index 000000000000..502ab151e0c5
--- /dev/null
+++ b/lldb/test/API/functionalities/disassembler-variables/regs_fp_params.s
@@ -0,0 +1,304 @@
+/* Original C (for context):
+* __attribute__((noinline))
+* double regs_fp_params(double a, double b, double c, double d, double e, double f) {
+* asm volatile("" :: "x"(a), "x"(b), "x"(c), "x"(d), "x"(e), "x"(f));
+* return a + b + c + d + e + f;
+* }*/
+ .file "regs_fp_params.c"
+ .text
+ .globl regs_fp_params # -- Begin function regs_fp_params
+ .p2align 4
+ .type regs_fp_params,@function
+regs_fp_params: # @regs_fp_params
+.Lfunc_begin0:
+ .file 0 "." "regs_fp_params.c" md5 0xdd883927454b0ea1cdce7b3c16c6a643
+ .loc 0 2 0 # regs_fp_params.c:2:0
+ .cfi_startproc
+# %bb.0: # %entry
+ #DEBUG_VALUE: regs_fp_params:a <- $xmm0
+ #DEBUG_VALUE: regs_fp_params:b <- $xmm1
+ #DEBUG_VALUE: regs_fp_params:c <- $xmm2
+ #DEBUG_VALUE: regs_fp_params:d <- $xmm3
+ #DEBUG_VALUE: regs_fp_params:e <- $xmm4
+ #DEBUG_VALUE: regs_fp_params:f <- $xmm5
+ pushq %rbp
+ .cfi_def_cfa_offset 16
+ .cfi_offset %rbp, -16
+ movq %rsp, %rbp
+ .cfi_def_cfa_register %rbp
+.Ltmp0:
+ .loc 0 3 3 prologue_end # regs_fp_params.c:3:3
+ #APP
+ #NO_APP
+ .loc 0 4 12 # regs_fp_params.c:4:12
+ addsd %xmm1, %xmm0
+.Ltmp1:
+ #DEBUG_VALUE: regs_fp_params:a <- [DW_OP_LLVM_entry_value 1] $xmm0
+ .loc 0 4 16 is_stmt 0 # regs_fp_params.c:4:16
+ addsd %xmm2, %xmm0
+ .loc 0 4 20 # regs_fp_params.c:4:20
+ addsd %xmm3, %xmm0
+ .loc 0 4 24 # regs_fp_params.c:4:24
+ addsd %xmm4, %xmm0
+ .loc 0 4 28 # regs_fp_params.c:4:28
+ addsd %xmm5, %xmm0
+ .loc 0 4 3 epilogue_begin # regs_fp_params.c:4:3
+ popq %rbp
+ .cfi_def_cfa %rsp, 8
+ retq
+.Ltmp2:
+.Lfunc_end0:
+ .size regs_fp_params, .Lfunc_end0-regs_fp_params
+ .cfi_endproc
+ # -- End function
+ .section .debug_loclists,"",@progbits
+ .long .Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length
+.Ldebug_list_header_start0:
+ .short 5 # Version
+ .byte 8 # Address size
+ .byte 0 # Segment selector size
+ .long 1 # Offset entry count
+.Lloclists_table_base0:
+ .long .Ldebug_loc0-.Lloclists_table_base0
+.Ldebug_loc0:
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Lfunc_begin0-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp1-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 97 # DW_OP_reg17
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp1-.Lfunc_begin0 # starting offset
+ .uleb128 .Lfunc_end0-.Lfunc_begin0 # ending offset
+ .byte 4 # Loc expr size
+ .byte 163 # DW_OP_entry_value
+ .byte 1 # 1
+ .byte 97 # DW_OP_reg17
+ .byte 159 # DW_OP_stack_value
+ .byte 0 # DW_LLE_end_of_list
+.Ldebug_list_header_end0:
+ .section .debug_abbrev,"",@progbits
+ .byte 1 # Abbreviation Code
+ .byte 17 # DW_TAG_compile_unit
+ .byte 1 # DW_CHILDREN_yes
+ .byte 37 # DW_AT_producer
+ .byte 37 # DW_FORM_strx1
+ .byte 19 # DW_AT_language
+ .byte 5 # DW_FORM_data2
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 114 # DW_AT_str_offsets_base
+ .byte 23 # DW_FORM_sec_offset
+ .byte 16 # DW_AT_stmt_list
+ .byte 23 # DW_FORM_sec_offset
+ .byte 27 # DW_AT_comp_dir
+ .byte 37 # DW_FORM_strx1
+ .byte 17 # DW_AT_low_pc
+ .byte 27 # DW_FORM_addrx
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 115 # DW_AT_addr_base
+ .byte 23 # DW_FORM_sec_offset
+ .ascii "\214\001" # DW_AT_loclists_base
+ .byte 23 # DW_FORM_sec_offset
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 2 # Abbreviation Code
+ .byte 46 # DW_TAG_subprogram
+ .byte 1 # DW_CHILDREN_yes
+ .byte 17 # DW_AT_low_pc
+ .byte 27 # DW_FORM_addrx
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 64 # DW_AT_frame_base
+ .byte 24 # DW_FORM_exprloc
+ .byte 122 # DW_AT_call_all_calls
+ .byte 25 # DW_FORM_flag_present
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 39 # DW_AT_prototyped
+ .byte 25 # DW_FORM_flag_present
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 63 # DW_AT_external
+ .byte 25 # DW_FORM_flag_present
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 3 # Abbreviation Code
+ .byte 5 # DW_TAG_formal_parameter
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 34 # DW_FORM_loclistx
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 4 # Abbreviation Code
+ .byte 5 # DW_TAG_formal_parameter
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 24 # DW_FORM_exprloc
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 5 # Abbreviation Code
+ .byte 36 # DW_TAG_base_type
+ .byte 0 # DW_CHILDREN_no
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 62 # DW_AT_encoding
+ .byte 11 # DW_FORM_data1
+ .byte 11 # DW_AT_byte_size
+ .byte 11 # DW_FORM_data1
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 0 # EOM(3)
+ .section .debug_info,"",@progbits
+.Lcu_begin0:
+ .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
+.Ldebug_info_start0:
+ .short 5 # DWARF version number
+ .byte 1 # DWARF Unit Type
+ .byte 8 # Address Size (in bytes)
+ .long .debug_abbrev # Offset Into Abbrev. Section
+ .byte 1 # Abbrev [1] 0xc:0x6b DW_TAG_compile_unit
+ .byte 0 # DW_AT_producer
+ .short 29 # DW_AT_language
+ .byte 1 # DW_AT_name
+ .long .Lstr_offsets_base0 # DW_AT_str_offsets_base
+ .long .Lline_table_start0 # DW_AT_stmt_list
+ .byte 2 # DW_AT_comp_dir
+ .byte 0 # DW_AT_low_pc
+ .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
+ .long .Laddr_table_base0 # DW_AT_addr_base
+ .long .Lloclists_table_base0 # DW_AT_loclists_base
+ .byte 2 # Abbrev [2] 0x27:0x4b DW_TAG_subprogram
+ .byte 0 # DW_AT_low_pc
+ .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
+ .byte 1 # DW_AT_frame_base
+ .byte 86
+ # DW_AT_call_all_calls
+ .byte 3 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ # DW_AT_prototyped
+ .long 114 # DW_AT_type
+ # DW_AT_external
+ .byte 3 # Abbrev [3] 0x36:0x9 DW_TAG_formal_parameter
+ .byte 0 # DW_AT_location
+ .byte 5 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 114 # DW_AT_type
+ .byte 4 # Abbrev [4] 0x3f:0xa DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 98
+ .byte 6 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 114 # DW_AT_type
+ .byte 4 # Abbrev [4] 0x49:0xa DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 99
+ .byte 7 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 114 # DW_AT_type
+ .byte 4 # Abbrev [4] 0x53:0xa DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 100
+ .byte 8 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 114 # DW_AT_type
+ .byte 4 # Abbrev [4] 0x5d:0xa DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 101
+ .byte 9 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 114 # DW_AT_type
+ .byte 4 # Abbrev [4] 0x67:0xa DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 102
+ .byte 10 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 114 # DW_AT_type
+ .byte 0 # End Of Children Mark
+ .byte 5 # Abbrev [5] 0x72:0x4 DW_TAG_base_type
+ .byte 4 # DW_AT_name
+ .byte 4 # DW_AT_encoding
+ .byte 8 # DW_AT_byte_size
+ .byte 0 # End Of Children Mark
+.Ldebug_info_end0:
+ .section .debug_str_offsets,"",@progbits
+ .long 48 # Length of String Offsets Set
+ .short 5
+ .short 0
+.Lstr_offsets_base0:
+ .section .debug_str,"MS",@progbits,1
+.Linfo_string0:
+ .asciz "clang version 22.0.0git (https://github.com/UltimateForce21/llvm-project.git 79c0a9e1e7da0f727c41d27c9c6ff8a28bb7d06f)" # string offset=0
+.Linfo_string1:
+ .asciz "regs_fp_params.c" # string offset=119
+.Linfo_string2:
+ .asciz "." # string offset=136
+.Linfo_string3:
+ .asciz "regs_fp_params" # string offset=138
+.Linfo_string4:
+ .asciz "double" # string offset=153
+.Linfo_string5:
+ .asciz "a" # string offset=160
+.Linfo_string6:
+ .asciz "b" # string offset=162
+.Linfo_string7:
+ .asciz "c" # string offset=164
+.Linfo_string8:
+ .asciz "d" # string offset=166
+.Linfo_string9:
+ .asciz "e" # string offset=168
+.Linfo_string10:
+ .asciz "f" # string offset=170
+ .section .debug_str_offsets,"",@progbits
+ .long .Linfo_string0
+ .long .Linfo_string1
+ .long .Linfo_string2
+ .long .Linfo_string3
+ .long .Linfo_string4
+ .long .Linfo_string5
+ .long .Linfo_string6
+ .long .Linfo_string7
+ .long .Linfo_string8
+ .long .Linfo_string9
+ .long .Linfo_string10
+ .section .debug_addr,"",@progbits
+ .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
+.Ldebug_addr_start0:
+ .short 5 # DWARF version number
+ .byte 8 # Address size
+ .byte 0 # Segment selector size
+.Laddr_table_base0:
+ .quad .Lfunc_begin0
+.Ldebug_addr_end0:
+ .ident "clang version 22.0.0git (https://github.com/UltimateForce21/llvm-project.git 79c0a9e1e7da0f727c41d27c9c6ff8a28bb7d06f)"
+ .section ".note.GNU-stack","",@progbits
+ .addrsig
+ .section .debug_line,"",@progbits
+.Lline_table_start0:
diff --git a/lldb/test/API/functionalities/disassembler-variables/regs_int_params.s b/lldb/test/API/functionalities/disassembler-variables/regs_int_params.s
new file mode 100644
index 000000000000..0b2a60e2b4d5
--- /dev/null
+++ b/lldb/test/API/functionalities/disassembler-variables/regs_int_params.s
@@ -0,0 +1,312 @@
+/* Original C (for context):
+* __attribute__((noinline))
+* int regs_int_params(int a, int b, int c, int d, int e, int f) {
+* // Keep all params in regs; avoid spilling to the stack.
+* // The compiler will usually keep a..f in the 6 integer-arg regs.
+* asm volatile("" :: "r"(a), "r"(b), "r"(c), "r"(d), "r"(e), "r"(f));
+* return a + b + c + d + e + f;
+* }
+*/
+ .file "regs_int_params.c"
+ .text
+ .globl regs_int_params # -- Begin function regs_int_params
+ .p2align 4
+ .type regs_int_params,@function
+regs_int_params: # @regs_int_params
+.Lfunc_begin0:
+ .file 0 "." "regs_int_params.c" md5 0xcf39432098ab893043cc8b4606354bd2
+ .loc 0 2 0 # regs_int_params.c:2:0
+ .cfi_startproc
+# %bb.0: # %entry
+ #DEBUG_VALUE: regs_int_params:a <- $edi
+ #DEBUG_VALUE: regs_int_params:b <- $esi
+ #DEBUG_VALUE: regs_int_params:c <- $edx
+ #DEBUG_VALUE: regs_int_params:d <- $ecx
+ #DEBUG_VALUE: regs_int_params:e <- $r8d
+ #DEBUG_VALUE: regs_int_params:f <- $r9d
+ pushq %rbp
+ .cfi_def_cfa_offset 16
+ .cfi_offset %rbp, -16
+ movq %rsp, %rbp
+ .cfi_def_cfa_register %rbp
+ # kill: def $r9d killed $r9d def $r9
+ # kill: def $r8d killed $r8d def $r8
+ # kill: def $ecx killed $ecx def $rcx
+ # kill: def $edx killed $edx def $rdx
+ # kill: def $esi killed $esi def $rsi
+ # kill: def $edi killed $edi def $rdi
+.Ltmp0:
+ .loc 0 5 3 prologue_end # regs_int_params.c:5:3
+ #APP
+ #NO_APP
+ .loc 0 6 12 # regs_int_params.c:6:12
+ addl %edi, %esi
+.Ltmp1:
+ #DEBUG_VALUE: regs_int_params:b <- [DW_OP_LLVM_entry_value 1] $esi
+ .loc 0 6 16 is_stmt 0 # regs_int_params.c:6:16
+ leal (%rdx,%rcx), %eax
+ .loc 0 6 20 # regs_int_params.c:6:20
+ addl %esi, %eax
+ .loc 0 6 28 # regs_int_params.c:6:28
+ addl %r8d, %eax
+ addl %r9d, %eax
+ .loc 0 6 3 epilogue_begin # regs_int_params.c:6:3
+ popq %rbp
+ .cfi_def_cfa %rsp, 8
+ retq
+.Ltmp2:
+.Lfunc_end0:
+ .size regs_int_params, .Lfunc_end0-regs_int_params
+ .cfi_endproc
+ # -- End function
+ .section .debug_loclists,"",@progbits
+ .long .Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length
+.Ldebug_list_header_start0:
+ .short 5 # Version
+ .byte 8 # Address size
+ .byte 0 # Segment selector size
+ .long 1 # Offset entry count
+.Lloclists_table_base0:
+ .long .Ldebug_loc0-.Lloclists_table_base0
+.Ldebug_loc0:
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Lfunc_begin0-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp1-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 84 # super-register DW_OP_reg4
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp1-.Lfunc_begin0 # starting offset
+ .uleb128 .Lfunc_end0-.Lfunc_begin0 # ending offset
+ .byte 4 # Loc expr size
+ .byte 163 # DW_OP_entry_value
+ .byte 1 # 1
+ .byte 84 # super-register DW_OP_reg4
+ .byte 159 # DW_OP_stack_value
+ .byte 0 # DW_LLE_end_of_list
+.Ldebug_list_header_end0:
+ .section .debug_abbrev,"",@progbits
+ .byte 1 # Abbreviation Code
+ .byte 17 # DW_TAG_compile_unit
+ .byte 1 # DW_CHILDREN_yes
+ .byte 37 # DW_AT_producer
+ .byte 37 # DW_FORM_strx1
+ .byte 19 # DW_AT_language
+ .byte 5 # DW_FORM_data2
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 114 # DW_AT_str_offsets_base
+ .byte 23 # DW_FORM_sec_offset
+ .byte 16 # DW_AT_stmt_list
+ .byte 23 # DW_FORM_sec_offset
+ .byte 27 # DW_AT_comp_dir
+ .byte 37 # DW_FORM_strx1
+ .byte 17 # DW_AT_low_pc
+ .byte 27 # DW_FORM_addrx
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 115 # DW_AT_addr_base
+ .byte 23 # DW_FORM_sec_offset
+ .ascii "\214\001" # DW_AT_loclists_base
+ .byte 23 # DW_FORM_sec_offset
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 2 # Abbreviation Code
+ .byte 46 # DW_TAG_subprogram
+ .byte 1 # DW_CHILDREN_yes
+ .byte 17 # DW_AT_low_pc
+ .byte 27 # DW_FORM_addrx
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 64 # DW_AT_frame_base
+ .byte 24 # DW_FORM_exprloc
+ .byte 122 # DW_AT_call_all_calls
+ .byte 25 # DW_FORM_flag_present
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 39 # DW_AT_prototyped
+ .byte 25 # DW_FORM_flag_present
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 63 # DW_AT_external
+ .byte 25 # DW_FORM_flag_present
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 3 # Abbreviation Code
+ .byte 5 # DW_TAG_formal_parameter
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 24 # DW_FORM_exprloc
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 4 # Abbreviation Code
+ .byte 5 # DW_TAG_formal_parameter
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 34 # DW_FORM_loclistx
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 5 # Abbreviation Code
+ .byte 36 # DW_TAG_base_type
+ .byte 0 # DW_CHILDREN_no
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 62 # DW_AT_encoding
+ .byte 11 # DW_FORM_data1
+ .byte 11 # DW_AT_byte_size
+ .byte 11 # DW_FORM_data1
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 0 # EOM(3)
+ .section .debug_info,"",@progbits
+.Lcu_begin0:
+ .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
+.Ldebug_info_start0:
+ .short 5 # DWARF version number
+ .byte 1 # DWARF Unit Type
+ .byte 8 # Address Size (in bytes)
+ .long .debug_abbrev # Offset Into Abbrev. Section
+ .byte 1 # Abbrev [1] 0xc:0x6b DW_TAG_compile_unit
+ .byte 0 # DW_AT_producer
+ .short 29 # DW_AT_language
+ .byte 1 # DW_AT_name
+ .long .Lstr_offsets_base0 # DW_AT_str_offsets_base
+ .long .Lline_table_start0 # DW_AT_stmt_list
+ .byte 2 # DW_AT_comp_dir
+ .byte 0 # DW_AT_low_pc
+ .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
+ .long .Laddr_table_base0 # DW_AT_addr_base
+ .long .Lloclists_table_base0 # DW_AT_loclists_base
+ .byte 2 # Abbrev [2] 0x27:0x4b DW_TAG_subprogram
+ .byte 0 # DW_AT_low_pc
+ .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
+ .byte 1 # DW_AT_frame_base
+ .byte 86
+ # DW_AT_call_all_calls
+ .byte 3 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ # DW_AT_prototyped
+ .long 114 # DW_AT_type
+ # DW_AT_external
+ .byte 3 # Abbrev [3] 0x36:0xa DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 85
+ .byte 5 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 114 # DW_AT_type
+ .byte 4 # Abbrev [4] 0x40:0x9 DW_TAG_formal_parameter
+ .byte 0 # DW_AT_location
+ .byte 6 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 114 # DW_AT_type
+ .byte 3 # Abbrev [3] 0x49:0xa DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 81
+ .byte 7 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 114 # DW_AT_type
+ .byte 3 # Abbrev [3] 0x53:0xa DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 82
+ .byte 8 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 114 # DW_AT_type
+ .byte 3 # Abbrev [3] 0x5d:0xa DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 88
+ .byte 9 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 114 # DW_AT_type
+ .byte 3 # Abbrev [3] 0x67:0xa DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 89
+ .byte 10 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 114 # DW_AT_type
+ .byte 0 # End Of Children Mark
+ .byte 5 # Abbrev [5] 0x72:0x4 DW_TAG_base_type
+ .byte 4 # DW_AT_name
+ .byte 5 # DW_AT_encoding
+ .byte 4 # DW_AT_byte_size
+ .byte 0 # End Of Children Mark
+.Ldebug_info_end0:
+ .section .debug_str_offsets,"",@progbits
+ .long 48 # Length of String Offsets Set
+ .short 5
+ .short 0
+.Lstr_offsets_base0:
+ .section .debug_str,"MS",@progbits,1
+.Linfo_string0:
+ .asciz "clang version 22.0.0git (https://github.com/UltimateForce21/llvm-project.git 79c0a9e1e7da0f727c41d27c9c6ff8a28bb7d06f)" # string offset=0
+.Linfo_string1:
+ .asciz "regs_int_params.c" # string offset=119
+.Linfo_string2:
+ .asciz "." # string offset=137
+.Linfo_string3:
+ .asciz "regs_int_params" # string offset=139
+.Linfo_string4:
+ .asciz "int" # string offset=155
+.Linfo_string5:
+ .asciz "a" # string offset=159
+.Linfo_string6:
+ .asciz "b" # string offset=161
+.Linfo_string7:
+ .asciz "c" # string offset=163
+.Linfo_string8:
+ .asciz "d" # string offset=165
+.Linfo_string9:
+ .asciz "e" # string offset=167
+.Linfo_string10:
+ .asciz "f" # string offset=169
+ .section .debug_str_offsets,"",@progbits
+ .long .Linfo_string0
+ .long .Linfo_string1
+ .long .Linfo_string2
+ .long .Linfo_string3
+ .long .Linfo_string4
+ .long .Linfo_string5
+ .long .Linfo_string6
+ .long .Linfo_string7
+ .long .Linfo_string8
+ .long .Linfo_string9
+ .long .Linfo_string10
+ .section .debug_addr,"",@progbits
+ .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
+.Ldebug_addr_start0:
+ .short 5 # DWARF version number
+ .byte 8 # Address size
+ .byte 0 # Segment selector size
+.Laddr_table_base0:
+ .quad .Lfunc_begin0
+.Ldebug_addr_end0:
+ .ident "clang version 22.0.0git (https://github.com/UltimateForce21/llvm-project.git 79c0a9e1e7da0f727c41d27c9c6ff8a28bb7d06f)"
+ .section ".note.GNU-stack","",@progbits
+ .addrsig
+ .section .debug_line,"",@progbits
+.Lline_table_start0:
diff --git a/lldb/test/API/functionalities/disassembler-variables/regs_mixed_params.s b/lldb/test/API/functionalities/disassembler-variables/regs_mixed_params.s
new file mode 100644
index 000000000000..691180b42f24
--- /dev/null
+++ b/lldb/test/API/functionalities/disassembler-variables/regs_mixed_params.s
@@ -0,0 +1,375 @@
+/* Original C (for context):
+* __attribute__((noinline))
+* double regs_mixed_params(int a, int b, double x, double y, int c, double z) {
+* // Keep everything live; avoid spills.
+* asm volatile("" :: "r"(a), "r"(b), "x"(x), "x"(y), "r"(c), "x"(z));
+* // Some mixing so values stay in regs long enough to annotate.
+* double r = (double)(a + b + c) + x + y + z;
+* asm volatile("" :: "x"(r), "r"(a), "x"(x));
+* return r;
+* }
+*/
+ .file "regs_mixed_params.c"
+ .file 0 "." "regs_mixed_params.c" md5 0x73c4bda40238ae460aaecb3a6a2603cf
+ .text
+ .globl regs_mixed_params # -- Begin function regs_mixed_params
+ .p2align 4
+ .type regs_mixed_params,@function
+regs_mixed_params: # @regs_mixed_params
+.Lfunc_begin0:
+ .loc 0 2 0 # regs_mixed_params.c:2:0
+ .cfi_startproc
+# %bb.0: # %entry
+ #DEBUG_VALUE: regs_mixed_params:a <- $edi
+ #DEBUG_VALUE: regs_mixed_params:b <- $esi
+ #DEBUG_VALUE: regs_mixed_params:x <- $xmm0
+ #DEBUG_VALUE: regs_mixed_params:y <- $xmm1
+ #DEBUG_VALUE: regs_mixed_params:c <- $edx
+ #DEBUG_VALUE: regs_mixed_params:z <- $xmm2
+ pushq %rbp
+ .cfi_def_cfa_offset 16
+ .cfi_offset %rbp, -16
+ movq %rsp, %rbp
+ .cfi_def_cfa_register %rbp
+.Ltmp0:
+ .loc 0 4 3 prologue_end # regs_mixed_params.c:4:3
+ #APP
+ #NO_APP
+ .loc 0 6 25 # regs_mixed_params.c:6:25
+ addl %edi, %esi
+.Ltmp1:
+ #DEBUG_VALUE: regs_mixed_params:b <- [DW_OP_LLVM_entry_value 1] $esi
+ .loc 0 6 29 is_stmt 0 # regs_mixed_params.c:6:29
+ addl %edx, %esi
+ .loc 0 6 14 # regs_mixed_params.c:6:14
+ cvtsi2sd %esi, %xmm4
+ .loc 0 6 34 # regs_mixed_params.c:6:34
+ movapd %xmm0, %xmm3
+ addsd %xmm4, %xmm3
+ .loc 0 6 38 # regs_mixed_params.c:6:38
+ addsd %xmm1, %xmm3
+ .loc 0 6 42 # regs_mixed_params.c:6:42
+ addsd %xmm2, %xmm3
+.Ltmp2:
+ #DEBUG_VALUE: regs_mixed_params:r <- $xmm3
+ .loc 0 7 3 is_stmt 1 # regs_mixed_params.c:7:3
+ #APP
+ #NO_APP
+ .loc 0 8 3 # regs_mixed_params.c:8:3
+ movapd %xmm3, %xmm0
+.Ltmp3:
+ #DEBUG_VALUE: regs_mixed_params:x <- [DW_OP_LLVM_entry_value 1] $xmm0
+ .loc 0 8 3 epilogue_begin is_stmt 0 # regs_mixed_params.c:8:3
+ popq %rbp
+ .cfi_def_cfa %rsp, 8
+ retq
+.Ltmp4:
+.Lfunc_end0:
+ .size regs_mixed_params, .Lfunc_end0-regs_mixed_params
+ .cfi_endproc
+ # -- End function
+ .section .debug_loclists,"",@progbits
+ .long .Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length
+.Ldebug_list_header_start0:
+ .short 5 # Version
+ .byte 8 # Address size
+ .byte 0 # Segment selector size
+ .long 3 # Offset entry count
+.Lloclists_table_base0:
+ .long .Ldebug_loc0-.Lloclists_table_base0
+ .long .Ldebug_loc1-.Lloclists_table_base0
+ .long .Ldebug_loc2-.Lloclists_table_base0
+.Ldebug_loc0:
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Lfunc_begin0-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp1-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 84 # super-register DW_OP_reg4
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp1-.Lfunc_begin0 # starting offset
+ .uleb128 .Lfunc_end0-.Lfunc_begin0 # ending offset
+ .byte 4 # Loc expr size
+ .byte 163 # DW_OP_entry_value
+ .byte 1 # 1
+ .byte 84 # super-register DW_OP_reg4
+ .byte 159 # DW_OP_stack_value
+ .byte 0 # DW_LLE_end_of_list
+.Ldebug_loc1:
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Lfunc_begin0-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp3-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 97 # DW_OP_reg17
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp3-.Lfunc_begin0 # starting offset
+ .uleb128 .Lfunc_end0-.Lfunc_begin0 # ending offset
+ .byte 4 # Loc expr size
+ .byte 163 # DW_OP_entry_value
+ .byte 1 # 1
+ .byte 97 # DW_OP_reg17
+ .byte 159 # DW_OP_stack_value
+ .byte 0 # DW_LLE_end_of_list
+.Ldebug_loc2:
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp2-.Lfunc_begin0 # starting offset
+ .uleb128 .Lfunc_end0-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 100 # DW_OP_reg20
+ .byte 0 # DW_LLE_end_of_list
+.Ldebug_list_header_end0:
+ .section .debug_abbrev,"",@progbits
+ .byte 1 # Abbreviation Code
+ .byte 17 # DW_TAG_compile_unit
+ .byte 1 # DW_CHILDREN_yes
+ .byte 37 # DW_AT_producer
+ .byte 37 # DW_FORM_strx1
+ .byte 19 # DW_AT_language
+ .byte 5 # DW_FORM_data2
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 114 # DW_AT_str_offsets_base
+ .byte 23 # DW_FORM_sec_offset
+ .byte 16 # DW_AT_stmt_list
+ .byte 23 # DW_FORM_sec_offset
+ .byte 27 # DW_AT_comp_dir
+ .byte 37 # DW_FORM_strx1
+ .byte 17 # DW_AT_low_pc
+ .byte 27 # DW_FORM_addrx
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 115 # DW_AT_addr_base
+ .byte 23 # DW_FORM_sec_offset
+ .ascii "\214\001" # DW_AT_loclists_base
+ .byte 23 # DW_FORM_sec_offset
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 2 # Abbreviation Code
+ .byte 36 # DW_TAG_base_type
+ .byte 0 # DW_CHILDREN_no
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 62 # DW_AT_encoding
+ .byte 11 # DW_FORM_data1
+ .byte 11 # DW_AT_byte_size
+ .byte 11 # DW_FORM_data1
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 3 # Abbreviation Code
+ .byte 46 # DW_TAG_subprogram
+ .byte 1 # DW_CHILDREN_yes
+ .byte 17 # DW_AT_low_pc
+ .byte 27 # DW_FORM_addrx
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 64 # DW_AT_frame_base
+ .byte 24 # DW_FORM_exprloc
+ .byte 122 # DW_AT_call_all_calls
+ .byte 25 # DW_FORM_flag_present
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 39 # DW_AT_prototyped
+ .byte 25 # DW_FORM_flag_present
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 63 # DW_AT_external
+ .byte 25 # DW_FORM_flag_present
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 4 # Abbreviation Code
+ .byte 5 # DW_TAG_formal_parameter
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 24 # DW_FORM_exprloc
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 5 # Abbreviation Code
+ .byte 5 # DW_TAG_formal_parameter
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 34 # DW_FORM_loclistx
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 6 # Abbreviation Code
+ .byte 52 # DW_TAG_variable
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 34 # DW_FORM_loclistx
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 0 # EOM(3)
+ .section .debug_info,"",@progbits
+.Lcu_begin0:
+ .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
+.Ldebug_info_start0:
+ .short 5 # DWARF version number
+ .byte 1 # DWARF Unit Type
+ .byte 8 # Address Size (in bytes)
+ .long .debug_abbrev # Offset Into Abbrev. Section
+ .byte 1 # Abbrev [1] 0xc:0x77 DW_TAG_compile_unit
+ .byte 0 # DW_AT_producer
+ .short 29 # DW_AT_language
+ .byte 1 # DW_AT_name
+ .long .Lstr_offsets_base0 # DW_AT_str_offsets_base
+ .long .Lline_table_start0 # DW_AT_stmt_list
+ .byte 2 # DW_AT_comp_dir
+ .byte 0 # DW_AT_low_pc
+ .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
+ .long .Laddr_table_base0 # DW_AT_addr_base
+ .long .Lloclists_table_base0 # DW_AT_loclists_base
+ .byte 2 # Abbrev [2] 0x27:0x4 DW_TAG_base_type
+ .byte 3 # DW_AT_name
+ .byte 4 # DW_AT_encoding
+ .byte 8 # DW_AT_byte_size
+ .byte 3 # Abbrev [3] 0x2b:0x53 DW_TAG_subprogram
+ .byte 0 # DW_AT_low_pc
+ .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
+ .byte 1 # DW_AT_frame_base
+ .byte 86
+ # DW_AT_call_all_calls
+ .byte 4 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ # DW_AT_prototyped
+ .long 39 # DW_AT_type
+ # DW_AT_external
+ .byte 4 # Abbrev [4] 0x3a:0xa DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 85
+ .byte 5 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 126 # DW_AT_type
+ .byte 5 # Abbrev [5] 0x44:0x9 DW_TAG_formal_parameter
+ .byte 0 # DW_AT_location
+ .byte 7 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 126 # DW_AT_type
+ .byte 5 # Abbrev [5] 0x4d:0x9 DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 8 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 39 # DW_AT_type
+ .byte 4 # Abbrev [4] 0x56:0xa DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 98
+ .byte 9 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 39 # DW_AT_type
+ .byte 4 # Abbrev [4] 0x60:0xa DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 81
+ .byte 10 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 126 # DW_AT_type
+ .byte 4 # Abbrev [4] 0x6a:0xa DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 99
+ .byte 11 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 39 # DW_AT_type
+ .byte 6 # Abbrev [6] 0x74:0x9 DW_TAG_variable
+ .byte 2 # DW_AT_location
+ .byte 12 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 6 # DW_AT_decl_line
+ .long 39 # DW_AT_type
+ .byte 0 # End Of Children Mark
+ .byte 2 # Abbrev [2] 0x7e:0x4 DW_TAG_base_type
+ .byte 6 # DW_AT_name
+ .byte 5 # DW_AT_encoding
+ .byte 4 # DW_AT_byte_size
+ .byte 0 # End Of Children Mark
+.Ldebug_info_end0:
+ .section .debug_str_offsets,"",@progbits
+ .long 56 # Length of String Offsets Set
+ .short 5
+ .short 0
+.Lstr_offsets_base0:
+ .section .debug_str,"MS",@progbits,1
+.Linfo_string0:
+ .asciz "clang version 22.0.0git (https://github.com/UltimateForce21/llvm-project.git 79c0a9e1e7da0f727c41d27c9c6ff8a28bb7d06f)" # string offset=0
+.Linfo_string1:
+ .asciz "regs_mixed_params.c" # string offset=119
+.Linfo_string2:
+ .asciz "." # string offset=139
+.Linfo_string3:
+ .asciz "double" # string offset=141
+.Linfo_string4:
+ .asciz "regs_mixed_params" # string offset=148
+.Linfo_string5:
+ .asciz "a" # string offset=166
+.Linfo_string6:
+ .asciz "int" # string offset=168
+.Linfo_string7:
+ .asciz "b" # string offset=172
+.Linfo_string8:
+ .asciz "x" # string offset=174
+.Linfo_string9:
+ .asciz "y" # string offset=176
+.Linfo_string10:
+ .asciz "c" # string offset=178
+.Linfo_string11:
+ .asciz "z" # string offset=180
+.Linfo_string12:
+ .asciz "r" # string offset=182
+ .section .debug_str_offsets,"",@progbits
+ .long .Linfo_string0
+ .long .Linfo_string1
+ .long .Linfo_string2
+ .long .Linfo_string3
+ .long .Linfo_string4
+ .long .Linfo_string5
+ .long .Linfo_string6
+ .long .Linfo_string7
+ .long .Linfo_string8
+ .long .Linfo_string9
+ .long .Linfo_string10
+ .long .Linfo_string11
+ .long .Linfo_string12
+ .section .debug_addr,"",@progbits
+ .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
+.Ldebug_addr_start0:
+ .short 5 # DWARF version number
+ .byte 8 # Address size
+ .byte 0 # Segment selector size
+.Laddr_table_base0:
+ .quad .Lfunc_begin0
+.Ldebug_addr_end0:
+ .ident "clang version 22.0.0git (https://github.com/UltimateForce21/llvm-project.git 79c0a9e1e7da0f727c41d27c9c6ff8a28bb7d06f)"
+ .section ".note.GNU-stack","",@progbits
+ .addrsig
+ .section .debug_line,"",@progbits
+.Lline_table_start0:
diff --git a/lldb/test/API/functionalities/disassembler-variables/seed_reg_const_undef.s b/lldb/test/API/functionalities/disassembler-variables/seed_reg_const_undef.s
new file mode 100644
index 000000000000..f85b8a712cbb
--- /dev/null
+++ b/lldb/test/API/functionalities/disassembler-variables/seed_reg_const_undef.s
@@ -0,0 +1,289 @@
+/* Original C (for context):
+* __attribute__((noinline))
+* int main(int argc, char **argv) {
+* int i = argc; // i in a reg (DW_OP_regN)
+* asm volatile("" :: "r"(i)); // keep i live here
+* i = 0; // i becomes const 0 (DW_OP_constu 0, stack_value)
+* asm volatile("" :: "r"(i)); // keep the const range materialized
+* return 0; // i ends -> <undef> after its range
+* }
+*/
+
+ .file "seed_reg_const_undef.c"
+ .text
+ .globl main # -- Begin function main
+ .p2align 4
+ .type main,@function
+main: # @main
+.Lfunc_begin0:
+ .file 0 "." "seed_reg_const_undef.c" md5 0x5e8dbf089d1bd72d395da802210b3138
+ .loc 0 3 0 # seed_reg_const_undef.c:3:0
+ .cfi_startproc
+# %bb.0: # %entry
+ #DEBUG_VALUE: main:argc <- $edi
+ #DEBUG_VALUE: main:argv <- $rsi
+ pushq %rbp
+ .cfi_def_cfa_offset 16
+ .cfi_offset %rbp, -16
+ movq %rsp, %rbp
+ .cfi_def_cfa_register %rbp
+.Ltmp0:
+ #DEBUG_VALUE: main:i <- $edi
+ .loc 0 5 3 prologue_end # seed_reg_const_undef.c:5:3
+ #APP
+ #NO_APP
+.Ltmp1:
+ #DEBUG_VALUE: main:i <- 0
+ .loc 0 7 3 # seed_reg_const_undef.c:7:3
+ xorl %eax, %eax
+ #APP
+ #NO_APP
+ .loc 0 8 3 # seed_reg_const_undef.c:8:3
+ xorl %eax, %eax
+ .loc 0 8 3 epilogue_begin is_stmt 0 # seed_reg_const_undef.c:8:3
+ popq %rbp
+ .cfi_def_cfa %rsp, 8
+ retq
+.Ltmp2:
+.Lfunc_end0:
+ .size main, .Lfunc_end0-main
+ .cfi_endproc
+ # -- End function
+ .section .debug_loclists,"",@progbits
+ .long .Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length
+.Ldebug_list_header_start0:
+ .short 5 # Version
+ .byte 8 # Address size
+ .byte 0 # Segment selector size
+ .long 1 # Offset entry count
+.Lloclists_table_base0:
+ .long .Ldebug_loc0-.Lloclists_table_base0
+.Ldebug_loc0:
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp0-.Lfunc_begin0 # starting offset
+ .uleb128 .Ltmp1-.Lfunc_begin0 # ending offset
+ .byte 1 # Loc expr size
+ .byte 85 # super-register DW_OP_reg5
+ .byte 4 # DW_LLE_offset_pair
+ .uleb128 .Ltmp1-.Lfunc_begin0 # starting offset
+ .uleb128 .Lfunc_end0-.Lfunc_begin0 # ending offset
+ .byte 3 # Loc expr size
+ .byte 17 # DW_OP_consts
+ .byte 0 # 0
+ .byte 159 # DW_OP_stack_value
+ .byte 0 # DW_LLE_end_of_list
+.Ldebug_list_header_end0:
+ .section .debug_abbrev,"",@progbits
+ .byte 1 # Abbreviation Code
+ .byte 17 # DW_TAG_compile_unit
+ .byte 1 # DW_CHILDREN_yes
+ .byte 37 # DW_AT_producer
+ .byte 37 # DW_FORM_strx1
+ .byte 19 # DW_AT_language
+ .byte 5 # DW_FORM_data2
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 114 # DW_AT_str_offsets_base
+ .byte 23 # DW_FORM_sec_offset
+ .byte 16 # DW_AT_stmt_list
+ .byte 23 # DW_FORM_sec_offset
+ .byte 27 # DW_AT_comp_dir
+ .byte 37 # DW_FORM_strx1
+ .byte 17 # DW_AT_low_pc
+ .byte 27 # DW_FORM_addrx
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 115 # DW_AT_addr_base
+ .byte 23 # DW_FORM_sec_offset
+ .ascii "\214\001" # DW_AT_loclists_base
+ .byte 23 # DW_FORM_sec_offset
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 2 # Abbreviation Code
+ .byte 46 # DW_TAG_subprogram
+ .byte 1 # DW_CHILDREN_yes
+ .byte 17 # DW_AT_low_pc
+ .byte 27 # DW_FORM_addrx
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 64 # DW_AT_frame_base
+ .byte 24 # DW_FORM_exprloc
+ .byte 122 # DW_AT_call_all_calls
+ .byte 25 # DW_FORM_flag_present
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 39 # DW_AT_prototyped
+ .byte 25 # DW_FORM_flag_present
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 63 # DW_AT_external
+ .byte 25 # DW_FORM_flag_present
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 3 # Abbreviation Code
+ .byte 5 # DW_TAG_formal_parameter
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 24 # DW_FORM_exprloc
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 4 # Abbreviation Code
+ .byte 52 # DW_TAG_variable
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 34 # DW_FORM_loclistx
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 5 # Abbreviation Code
+ .byte 36 # DW_TAG_base_type
+ .byte 0 # DW_CHILDREN_no
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 62 # DW_AT_encoding
+ .byte 11 # DW_FORM_data1
+ .byte 11 # DW_AT_byte_size
+ .byte 11 # DW_FORM_data1
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 6 # Abbreviation Code
+ .byte 15 # DW_TAG_pointer_type
+ .byte 0 # DW_CHILDREN_no
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 0 # EOM(3)
+ .section .debug_info,"",@progbits
+.Lcu_begin0:
+ .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
+.Ldebug_info_start0:
+ .short 5 # DWARF version number
+ .byte 1 # DWARF Unit Type
+ .byte 8 # Address Size (in bytes)
+ .long .debug_abbrev # Offset Into Abbrev. Section
+ .byte 1 # Abbrev [1] 0xc:0x5b DW_TAG_compile_unit
+ .byte 0 # DW_AT_producer
+ .short 29 # DW_AT_language
+ .byte 1 # DW_AT_name
+ .long .Lstr_offsets_base0 # DW_AT_str_offsets_base
+ .long .Lline_table_start0 # DW_AT_stmt_list
+ .byte 2 # DW_AT_comp_dir
+ .byte 0 # DW_AT_low_pc
+ .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
+ .long .Laddr_table_base0 # DW_AT_addr_base
+ .long .Lloclists_table_base0 # DW_AT_loclists_base
+ .byte 2 # Abbrev [2] 0x27:0x2d DW_TAG_subprogram
+ .byte 0 # DW_AT_low_pc
+ .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
+ .byte 1 # DW_AT_frame_base
+ .byte 86
+ # DW_AT_call_all_calls
+ .byte 3 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 3 # DW_AT_decl_line
+ # DW_AT_prototyped
+ .long 84 # DW_AT_type
+ # DW_AT_external
+ .byte 3 # Abbrev [3] 0x36:0xa DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 85
+ .byte 5 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 3 # DW_AT_decl_line
+ .long 84 # DW_AT_type
+ .byte 3 # Abbrev [3] 0x40:0xa DW_TAG_formal_parameter
+ .byte 1 # DW_AT_location
+ .byte 84
+ .byte 6 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 3 # DW_AT_decl_line
+ .long 88 # DW_AT_type
+ .byte 4 # Abbrev [4] 0x4a:0x9 DW_TAG_variable
+ .byte 0 # DW_AT_location
+ .byte 8 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 4 # DW_AT_decl_line
+ .long 84 # DW_AT_type
+ .byte 0 # End Of Children Mark
+ .byte 5 # Abbrev [5] 0x54:0x4 DW_TAG_base_type
+ .byte 4 # DW_AT_name
+ .byte 5 # DW_AT_encoding
+ .byte 4 # DW_AT_byte_size
+ .byte 6 # Abbrev [6] 0x58:0x5 DW_TAG_pointer_type
+ .long 93 # DW_AT_type
+ .byte 6 # Abbrev [6] 0x5d:0x5 DW_TAG_pointer_type
+ .long 98 # DW_AT_type
+ .byte 5 # Abbrev [5] 0x62:0x4 DW_TAG_base_type
+ .byte 7 # DW_AT_name
+ .byte 6 # DW_AT_encoding
+ .byte 1 # DW_AT_byte_size
+ .byte 0 # End Of Children Mark
+.Ldebug_info_end0:
+ .section .debug_str_offsets,"",@progbits
+ .long 40 # Length of String Offsets Set
+ .short 5
+ .short 0
+.Lstr_offsets_base0:
+ .section .debug_str,"MS",@progbits,1
+.Linfo_string0:
+ .asciz "clang version 22.0.0git (https://github.com/UltimateForce21/llvm-project.git 79c0a9e1e7da0f727c41d27c9c6ff8a28bb7d06f)" # string offset=0
+.Linfo_string1:
+ .asciz "seed_reg_const_undef.c" # string offset=119
+.Linfo_string2:
+ .asciz "." # string offset=142
+.Linfo_string3:
+ .asciz "main" # string offset=144
+.Linfo_string4:
+ .asciz "int" # string offset=149
+.Linfo_string5:
+ .asciz "argc" # string offset=153
+.Linfo_string6:
+ .asciz "argv" # string offset=158
+.Linfo_string7:
+ .asciz "char" # string offset=163
+.Linfo_string8:
+ .asciz "i" # string offset=168
+ .section .debug_str_offsets,"",@progbits
+ .long .Linfo_string0
+ .long .Linfo_string1
+ .long .Linfo_string2
+ .long .Linfo_string3
+ .long .Linfo_string4
+ .long .Linfo_string5
+ .long .Linfo_string6
+ .long .Linfo_string7
+ .long .Linfo_string8
+ .section .debug_addr,"",@progbits
+ .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
+.Ldebug_addr_start0:
+ .short 5 # DWARF version number
+ .byte 8 # Address size
+ .byte 0 # Segment selector size
+.Laddr_table_base0:
+ .quad .Lfunc_begin0
+.Ldebug_addr_end0:
+ .ident "clang version 22.0.0git (https://github.com/UltimateForce21/llvm-project.git 79c0a9e1e7da0f727c41d27c9c6ff8a28bb7d06f)"
+ .section ".note.GNU-stack","",@progbits
+ .addrsig
+ .section .debug_line,"",@progbits
+.Lline_table_start0: