shafik updated this revision to Diff 284507. shafik added a comment. Updated to use llvm.org clang, remove header files from the main.c and add the commit hash for the clang so that it is easier to replicate the main.s in the future.
CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85376/new/ https://reviews.llvm.org/D85376 Files: lldb/source/Core/ValueObjectChild.cpp lldb/test/API/functionalities/data-formatter/valueobj-pass-by-reg/Makefile lldb/test/API/functionalities/data-formatter/valueobj-pass-by-reg/TestValueObjPassByRef.py lldb/test/API/functionalities/data-formatter/valueobj-pass-by-reg/main.s
Index: lldb/test/API/functionalities/data-formatter/valueobj-pass-by-reg/main.s =================================================================== --- /dev/null +++ lldb/test/API/functionalities/data-formatter/valueobj-pass-by-reg/main.s @@ -0,0 +1,611 @@ +## This was generated from the following code: +## +## We are testing how ValueObject deals with bit-fields when an argument is +## passed by register. Compiling at -O1 allows us to capture this case and +## test it. +## +## typedef union +## { +## unsigned raw; +## struct +## { +## unsigned a : 8; +## unsigned b : 8; +## unsigned c : 6; +## unsigned d : 2; +## unsigned e : 6; +## unsigned f : 2; +## } ; +## } U; +## +## unsigned f(U u) { +## asm(""); +## return u.raw; +## } +## +## int main() { +## U u; +## u.raw = 0x64A40101; +## +## return f(u); +## } +## +## Compiled as follows: +## +## +## clang -g -O1 main.c -o main +## clang -g -O1 main.c -S -o main.s +## +## clang is built from llvm.org and the last commit was: +## +## 86dea1f39bd127776b999e10dff212003068d30a +## + .section __TEXT,__text,regular,pure_instructions + .build_version macos, 10, 15 + .globl _f ## -- Begin function f + .p2align 4, 0x90 +_f: ## @f +Lfunc_begin0: + .file 1 "/Users/shafik/code" "main.c" + .loc 1 15 0 ## main.c:15:0 + .cfi_startproc +## %bb.0: ## %entry + ##DEBUG_VALUE: f:u <- $edi + pushq %rbp + .cfi_def_cfa_offset 16 + .cfi_offset %rbp, -16 + movq %rsp, %rbp + .cfi_def_cfa_register %rbp + movl %edi, %eax +Ltmp0: + ##DEBUG_VALUE: f:u <- $eax + .loc 1 16 3 prologue_end ## main.c:16:3 + ## InlineAsm Start + ## InlineAsm End + ##DEBUG_VALUE: f:u <- $eax + .loc 1 17 3 ## main.c:17:3 + popq %rbp + retq +Ltmp1: +Lfunc_end0: + .cfi_endproc + ## -- End function + .globl _main ## -- Begin function main + .p2align 4, 0x90 +_main: ## @main +Lfunc_begin1: + .loc 1 20 0 ## main.c:20:0 + .cfi_startproc +## %bb.0: ## %entry + pushq %rbp + .cfi_def_cfa_offset 16 + .cfi_offset %rbp, -16 + movq %rsp, %rbp + .cfi_def_cfa_register %rbp +Ltmp2: + ##DEBUG_VALUE: main:u <- 1688469761 + .loc 1 24 10 prologue_end ## main.c:24:10 + movl $1688469761, %edi ## imm = 0x64A40101 + callq _f +Ltmp3: + .loc 1 24 3 is_stmt 0 ## main.c:24:3 + movl $1688469761, %eax ## imm = 0x64A40101 + popq %rbp + retq +Ltmp4: +Lfunc_end1: + .cfi_endproc + ## -- End function + .section __DWARF,__debug_loc,regular,debug +Lsection_debug_loc: +Ldebug_loc0: +.set Lset0, Lfunc_begin0-Lfunc_begin0 + .quad Lset0 +.set Lset1, Ltmp0-Lfunc_begin0 + .quad Lset1 + .short 1 ## Loc expr size + .byte 85 ## super-register DW_OP_reg5 +.set Lset2, Ltmp0-Lfunc_begin0 + .quad Lset2 +.set Lset3, Lfunc_end0-Lfunc_begin0 + .quad Lset3 + .short 1 ## Loc expr size + .byte 80 ## super-register DW_OP_reg0 + .quad 0 + .quad 0 + .section __DWARF,__debug_abbrev,regular,debug +Lsection_abbrev: + .byte 1 ## Abbreviation Code + .byte 17 ## DW_TAG_compile_unit + .byte 1 ## DW_CHILDREN_yes + .byte 37 ## DW_AT_producer + .byte 14 ## DW_FORM_strp + .byte 19 ## DW_AT_language + .byte 5 ## DW_FORM_data2 + .byte 3 ## DW_AT_name + .byte 14 ## DW_FORM_strp + .ascii "\202|" ## DW_AT_LLVM_sysroot + .byte 14 ## DW_FORM_strp + .byte 16 ## DW_AT_stmt_list + .byte 23 ## DW_FORM_sec_offset + .byte 27 ## DW_AT_comp_dir + .byte 14 ## DW_FORM_strp + .ascii "\341\177" ## DW_AT_APPLE_optimized + .byte 25 ## DW_FORM_flag_present + .byte 17 ## DW_AT_low_pc + .byte 1 ## DW_FORM_addr + .byte 18 ## DW_AT_high_pc + .byte 6 ## DW_FORM_data4 + .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 1 ## DW_FORM_addr + .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 14 ## DW_FORM_strp + .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 + .ascii "\341\177" ## DW_AT_APPLE_optimized + .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 23 ## DW_FORM_sec_offset + .byte 3 ## DW_AT_name + .byte 14 ## DW_FORM_strp + .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 46 ## DW_TAG_subprogram + .byte 1 ## DW_CHILDREN_yes + .byte 17 ## DW_AT_low_pc + .byte 1 ## DW_FORM_addr + .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 14 ## DW_FORM_strp + .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 63 ## DW_AT_external + .byte 25 ## DW_FORM_flag_present + .ascii "\341\177" ## DW_AT_APPLE_optimized + .byte 25 ## DW_FORM_flag_present + .byte 0 ## EOM(1) + .byte 0 ## EOM(2) + .byte 5 ## Abbreviation Code + .byte 52 ## DW_TAG_variable + .byte 0 ## DW_CHILDREN_no + .byte 28 ## DW_AT_const_value + .byte 15 ## DW_FORM_udata + .byte 3 ## DW_AT_name + .byte 14 ## DW_FORM_strp + .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 1 ## DW_CHILDREN_yes + .byte 127 ## DW_AT_call_origin + .byte 19 ## DW_FORM_ref4 + .byte 125 ## DW_AT_call_return_pc + .byte 1 ## DW_FORM_addr + .byte 0 ## EOM(1) + .byte 0 ## EOM(2) + .byte 7 ## Abbreviation Code + .byte 73 ## DW_TAG_call_site_parameter + .byte 0 ## DW_CHILDREN_no + .byte 2 ## DW_AT_location + .byte 24 ## DW_FORM_exprloc + .byte 126 ## DW_AT_call_value + .byte 24 ## DW_FORM_exprloc + .byte 0 ## EOM(1) + .byte 0 ## EOM(2) + .byte 8 ## Abbreviation Code + .byte 36 ## DW_TAG_base_type + .byte 0 ## DW_CHILDREN_no + .byte 3 ## DW_AT_name + .byte 14 ## DW_FORM_strp + .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 9 ## Abbreviation Code + .byte 22 ## DW_TAG_typedef + .byte 0 ## DW_CHILDREN_no + .byte 73 ## DW_AT_type + .byte 19 ## DW_FORM_ref4 + .byte 3 ## DW_AT_name + .byte 14 ## DW_FORM_strp + .byte 58 ## DW_AT_decl_file + .byte 11 ## DW_FORM_data1 + .byte 59 ## DW_AT_decl_line + .byte 11 ## DW_FORM_data1 + .byte 0 ## EOM(1) + .byte 0 ## EOM(2) + .byte 10 ## Abbreviation Code + .byte 23 ## DW_TAG_union_type + .byte 1 ## DW_CHILDREN_yes + .byte 11 ## DW_AT_byte_size + .byte 11 ## DW_FORM_data1 + .byte 58 ## DW_AT_decl_file + .byte 11 ## DW_FORM_data1 + .byte 59 ## DW_AT_decl_line + .byte 11 ## DW_FORM_data1 + .byte 0 ## EOM(1) + .byte 0 ## EOM(2) + .byte 11 ## Abbreviation Code + .byte 13 ## DW_TAG_member + .byte 0 ## DW_CHILDREN_no + .byte 3 ## DW_AT_name + .byte 14 ## DW_FORM_strp + .byte 73 ## DW_AT_type + .byte 19 ## DW_FORM_ref4 + .byte 58 ## DW_AT_decl_file + .byte 11 ## DW_FORM_data1 + .byte 59 ## DW_AT_decl_line + .byte 11 ## DW_FORM_data1 + .byte 56 ## DW_AT_data_member_location + .byte 11 ## DW_FORM_data1 + .byte 0 ## EOM(1) + .byte 0 ## EOM(2) + .byte 12 ## Abbreviation Code + .byte 13 ## DW_TAG_member + .byte 0 ## DW_CHILDREN_no + .byte 73 ## DW_AT_type + .byte 19 ## DW_FORM_ref4 + .byte 58 ## DW_AT_decl_file + .byte 11 ## DW_FORM_data1 + .byte 59 ## DW_AT_decl_line + .byte 11 ## DW_FORM_data1 + .byte 56 ## DW_AT_data_member_location + .byte 11 ## DW_FORM_data1 + .byte 0 ## EOM(1) + .byte 0 ## EOM(2) + .byte 13 ## Abbreviation Code + .byte 19 ## DW_TAG_structure_type + .byte 1 ## DW_CHILDREN_yes + .byte 11 ## DW_AT_byte_size + .byte 11 ## DW_FORM_data1 + .byte 58 ## DW_AT_decl_file + .byte 11 ## DW_FORM_data1 + .byte 59 ## DW_AT_decl_line + .byte 11 ## DW_FORM_data1 + .byte 0 ## EOM(1) + .byte 0 ## EOM(2) + .byte 14 ## Abbreviation Code + .byte 13 ## DW_TAG_member + .byte 0 ## DW_CHILDREN_no + .byte 3 ## DW_AT_name + .byte 14 ## DW_FORM_strp + .byte 73 ## DW_AT_type + .byte 19 ## DW_FORM_ref4 + .byte 58 ## DW_AT_decl_file + .byte 11 ## DW_FORM_data1 + .byte 59 ## DW_AT_decl_line + .byte 11 ## DW_FORM_data1 + .byte 13 ## DW_AT_bit_size + .byte 11 ## DW_FORM_data1 + .byte 107 ## DW_AT_data_bit_offset + .byte 11 ## DW_FORM_data1 + .byte 0 ## EOM(1) + .byte 0 ## EOM(2) + .byte 0 ## EOM(3) + .section __DWARF,__debug_info,regular,debug +Lsection_info: +Lcu_begin0: +.set Lset4, Ldebug_info_end0-Ldebug_info_start0 ## Length of Unit + .long Lset4 +Ldebug_info_start0: + .short 4 ## DWARF version number +.set Lset5, Lsection_abbrev-Lsection_abbrev ## Offset Into Abbrev. Section + .long Lset5 + .byte 8 ## Address Size (in bytes) + .byte 1 ## Abbrev [1] 0xb:0x114 DW_TAG_compile_unit + .long 0 ## DW_AT_producer + .short 12 ## DW_AT_language + .long 105 ## DW_AT_name + .long 112 ## DW_AT_LLVM_sysroot +.set Lset6, Lline_table_start0-Lsection_line ## DW_AT_stmt_list + .long Lset6 + .long 114 ## DW_AT_comp_dir + ## DW_AT_APPLE_optimized + .quad Lfunc_begin0 ## DW_AT_low_pc +.set Lset7, Lfunc_end1-Lfunc_begin0 ## DW_AT_high_pc + .long Lset7 + .byte 2 ## Abbrev [2] 0x2e:0x29 DW_TAG_subprogram + .quad Lfunc_begin0 ## DW_AT_low_pc +.set Lset8, Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc + .long Lset8 + .byte 1 ## DW_AT_frame_base + .byte 86 + ## DW_AT_call_all_calls + .long 133 ## DW_AT_name + .byte 1 ## DW_AT_decl_file + .byte 15 ## DW_AT_decl_line + ## DW_AT_prototyped + .long 153 ## DW_AT_type + ## DW_AT_external + ## DW_AT_APPLE_optimized + .byte 3 ## Abbrev [3] 0x47:0xf DW_TAG_formal_parameter +.set Lset9, Ldebug_loc0-Lsection_debug_loc ## DW_AT_location + .long Lset9 + .long 157 ## DW_AT_name + .byte 1 ## DW_AT_decl_file + .byte 15 ## DW_AT_decl_line + .long 167 ## DW_AT_type + .byte 0 ## End Of Children Mark + .byte 4 ## Abbrev [4] 0x57:0x42 DW_TAG_subprogram + .quad Lfunc_begin1 ## DW_AT_low_pc +.set Lset10, Lfunc_end1-Lfunc_begin1 ## DW_AT_high_pc + .long Lset10 + .byte 1 ## DW_AT_frame_base + .byte 86 + ## DW_AT_call_all_calls + .long 135 ## DW_AT_name + .byte 1 ## DW_AT_decl_file + .byte 20 ## DW_AT_decl_line + .long 160 ## DW_AT_type + ## DW_AT_external + ## DW_AT_APPLE_optimized + .byte 5 ## Abbrev [5] 0x70:0x10 DW_TAG_variable + .ascii "\201\202\220\245\006" ## DW_AT_const_value + .long 157 ## DW_AT_name + .byte 1 ## DW_AT_decl_file + .byte 21 ## DW_AT_decl_line + .long 167 ## DW_AT_type + .byte 6 ## Abbrev [6] 0x80:0x18 DW_TAG_call_site + .long 46 ## DW_AT_call_origin + .quad Ltmp3 ## DW_AT_call_return_pc + .byte 7 ## Abbrev [7] 0x8d:0xa DW_TAG_call_site_parameter + .byte 1 ## DW_AT_location + .byte 85 + .byte 6 ## DW_AT_call_value + .byte 16 + .ascii "\201\202\220\245\006" + .byte 0 ## End Of Children Mark + .byte 0 ## End Of Children Mark + .byte 8 ## Abbrev [8] 0x99:0x7 DW_TAG_base_type + .long 140 ## DW_AT_name + .byte 7 ## DW_AT_encoding + .byte 4 ## DW_AT_byte_size + .byte 8 ## Abbrev [8] 0xa0:0x7 DW_TAG_base_type + .long 153 ## DW_AT_name + .byte 5 ## DW_AT_encoding + .byte 4 ## DW_AT_byte_size + .byte 9 ## Abbrev [9] 0xa7:0xb DW_TAG_typedef + .long 178 ## DW_AT_type + .long 159 ## DW_AT_name + .byte 1 ## DW_AT_decl_file + .byte 13 ## DW_AT_decl_line + .byte 10 ## Abbrev [10] 0xb2:0x6c DW_TAG_union_type + .byte 4 ## DW_AT_byte_size + .byte 1 ## DW_AT_decl_file + .byte 1 ## DW_AT_decl_line + .byte 11 ## Abbrev [11] 0xb6:0xc DW_TAG_member + .long 161 ## DW_AT_name + .long 153 ## DW_AT_type + .byte 1 ## DW_AT_decl_file + .byte 3 ## DW_AT_decl_line + .byte 0 ## DW_AT_data_member_location + .byte 12 ## Abbrev [12] 0xc2:0x8 DW_TAG_member + .long 202 ## DW_AT_type + .byte 1 ## DW_AT_decl_file + .byte 4 ## DW_AT_decl_line + .byte 0 ## DW_AT_data_member_location + .byte 13 ## Abbrev [13] 0xca:0x53 DW_TAG_structure_type + .byte 4 ## DW_AT_byte_size + .byte 1 ## DW_AT_decl_file + .byte 4 ## DW_AT_decl_line + .byte 14 ## Abbrev [14] 0xce:0xd DW_TAG_member + .long 165 ## DW_AT_name + .long 153 ## DW_AT_type + .byte 1 ## DW_AT_decl_file + .byte 6 ## DW_AT_decl_line + .byte 8 ## DW_AT_bit_size + .byte 0 ## DW_AT_data_bit_offset + .byte 14 ## Abbrev [14] 0xdb:0xd DW_TAG_member + .long 167 ## DW_AT_name + .long 153 ## DW_AT_type + .byte 1 ## DW_AT_decl_file + .byte 7 ## DW_AT_decl_line + .byte 8 ## DW_AT_bit_size + .byte 8 ## DW_AT_data_bit_offset + .byte 14 ## Abbrev [14] 0xe8:0xd DW_TAG_member + .long 169 ## DW_AT_name + .long 153 ## DW_AT_type + .byte 1 ## DW_AT_decl_file + .byte 8 ## DW_AT_decl_line + .byte 6 ## DW_AT_bit_size + .byte 16 ## DW_AT_data_bit_offset + .byte 14 ## Abbrev [14] 0xf5:0xd DW_TAG_member + .long 171 ## DW_AT_name + .long 153 ## DW_AT_type + .byte 1 ## DW_AT_decl_file + .byte 9 ## DW_AT_decl_line + .byte 2 ## DW_AT_bit_size + .byte 22 ## DW_AT_data_bit_offset + .byte 14 ## Abbrev [14] 0x102:0xd DW_TAG_member + .long 173 ## DW_AT_name + .long 153 ## DW_AT_type + .byte 1 ## DW_AT_decl_file + .byte 10 ## DW_AT_decl_line + .byte 6 ## DW_AT_bit_size + .byte 24 ## DW_AT_data_bit_offset + .byte 14 ## Abbrev [14] 0x10f:0xd DW_TAG_member + .long 133 ## DW_AT_name + .long 153 ## DW_AT_type + .byte 1 ## DW_AT_decl_file + .byte 11 ## DW_AT_decl_line + .byte 2 ## DW_AT_bit_size + .byte 30 ## DW_AT_data_bit_offset + .byte 0 ## End Of Children Mark + .byte 0 ## End Of Children Mark + .byte 0 ## End Of Children Mark +Ldebug_info_end0: + .section __DWARF,__debug_str,regular,debug +Linfo_string: + .asciz "clang version 12.0.0 (https://github.com/llvm/llvm-project.git 86dea1f39bd127776b999e10dff212003068d30a)" ## string offset=0 + .asciz "main.c" ## string offset=105 + .asciz "/" ## string offset=112 + .asciz "/Users/shafik/code" ## string offset=114 + .asciz "f" ## string offset=133 + .asciz "main" ## string offset=135 + .asciz "unsigned int" ## string offset=140 + .asciz "int" ## string offset=153 + .asciz "u" ## string offset=157 + .asciz "U" ## string offset=159 + .asciz "raw" ## string offset=161 + .asciz "a" ## string offset=165 + .asciz "b" ## string offset=167 + .asciz "c" ## string offset=169 + .asciz "d" ## string offset=171 + .asciz "e" ## string offset=173 + .section __DWARF,__apple_names,regular,debug +Lnames_begin: + .long 1212240712 ## Header Magic + .short 1 ## Header Version + .short 0 ## Header Hash Function + .long 2 ## Header Bucket Count + .long 2 ## Header Hash Count + .long 12 ## Header Data Length + .long 0 ## HeaderData Die Offset Base + .long 1 ## HeaderData Atom Count + .short 1 ## DW_ATOM_die_offset + .short 6 ## DW_FORM_data4 + .long 0 ## Bucket 0 + .long 1 ## Bucket 1 + .long 2090499946 ## Hash in Bucket 0 + .long 177675 ## Hash in Bucket 1 +.set Lset11, LNames0-Lnames_begin ## Offset in Bucket 0 + .long Lset11 +.set Lset12, LNames1-Lnames_begin ## Offset in Bucket 1 + .long Lset12 +LNames0: + .long 135 ## main + .long 1 ## Num DIEs + .long 87 + .long 0 +LNames1: + .long 133 ## f + .long 1 ## Num DIEs + .long 46 + .long 0 + .section __DWARF,__apple_objc,regular,debug +Lobjc_begin: + .long 1212240712 ## Header Magic + .short 1 ## Header Version + .short 0 ## Header Hash Function + .long 1 ## Header Bucket Count + .long 0 ## Header Hash Count + .long 12 ## Header Data Length + .long 0 ## HeaderData Die Offset Base + .long 1 ## HeaderData Atom Count + .short 1 ## DW_ATOM_die_offset + .short 6 ## DW_FORM_data4 + .long -1 ## Bucket 0 + .section __DWARF,__apple_namespac,regular,debug +Lnamespac_begin: + .long 1212240712 ## Header Magic + .short 1 ## Header Version + .short 0 ## Header Hash Function + .long 1 ## Header Bucket Count + .long 0 ## Header Hash Count + .long 12 ## Header Data Length + .long 0 ## HeaderData Die Offset Base + .long 1 ## HeaderData Atom Count + .short 1 ## DW_ATOM_die_offset + .short 6 ## DW_FORM_data4 + .long -1 ## Bucket 0 + .section __DWARF,__apple_types,regular,debug +Ltypes_begin: + .long 1212240712 ## Header Magic + .short 1 ## Header Version + .short 0 ## Header Hash Function + .long 3 ## Header Bucket Count + .long 3 ## Header Hash Count + .long 20 ## Header Data Length + .long 0 ## HeaderData Die Offset Base + .long 3 ## HeaderData Atom Count + .short 1 ## DW_ATOM_die_offset + .short 6 ## DW_FORM_data4 + .short 3 ## DW_ATOM_die_tag + .short 5 ## DW_FORM_data2 + .short 4 ## DW_ATOM_type_flags + .short 11 ## DW_FORM_data1 + .long -1 ## Bucket 0 + .long 0 ## Bucket 1 + .long 1 ## Bucket 2 + .long 177658 ## Hash in Bucket 1 + .long 193495088 ## Hash in Bucket 2 + .long -1304652851 ## Hash in Bucket 2 +.set Lset13, Ltypes0-Ltypes_begin ## Offset in Bucket 1 + .long Lset13 +.set Lset14, Ltypes2-Ltypes_begin ## Offset in Bucket 2 + .long Lset14 +.set Lset15, Ltypes1-Ltypes_begin ## Offset in Bucket 2 + .long Lset15 +Ltypes0: + .long 159 ## U + .long 1 ## Num DIEs + .long 167 + .short 22 + .byte 0 + .long 0 +Ltypes2: + .long 153 ## int + .long 1 ## Num DIEs + .long 160 + .short 36 + .byte 0 + .long 0 +Ltypes1: + .long 140 ## unsigned int + .long 1 ## Num DIEs + .long 153 + .short 36 + .byte 0 + .long 0 +.subsections_via_symbols + .section __DWARF,__debug_line,regular,debug +Lsection_line: +Lline_table_start0: Index: lldb/test/API/functionalities/data-formatter/valueobj-pass-by-reg/TestValueObjPassByRef.py =================================================================== --- /dev/null +++ lldb/test/API/functionalities/data-formatter/valueobj-pass-by-reg/TestValueObjPassByRef.py @@ -0,0 +1,34 @@ +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + +class TestValueObjPassByRef(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + @skipIf(archs=no_match(['x86_64'])) + @skipUnlessDarwin + def test(self): + self.build() + lldbutil.run_to_name_breakpoint(self, "f", exe_name="a.out") + + self.expect("frame var -L", substrs = [ "rax: (U) u = {", + "scalar: raw = 1688469761", + "scalar: a = 1", + "scalar: b = 1", + "scalar: c = 36", + "scalar: d = 2", + "scalar: e = 36", + "scalar: f = 1", + "}", + "}"]) + + u = self.dbg.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame().FindVariable('u') + self.assertEqual(u.GetChildMemberWithName('raw').GetValueAsUnsigned(), 1688469761) + self.assertEqual(u.GetChildMemberWithName('a').GetValueAsUnsigned(), 1) + self.assertEqual(u.GetChildMemberWithName('b').GetValueAsUnsigned(), 1) + self.assertEqual(u.GetChildMemberWithName('c').GetValueAsUnsigned(), 36) + self.assertEqual(u.GetChildMemberWithName('d').GetValueAsUnsigned(), 2) + self.assertEqual(u.GetChildMemberWithName('e').GetValueAsUnsigned(), 36) + self.assertEqual(u.GetChildMemberWithName('f').GetValueAsUnsigned(), 1) Index: lldb/test/API/functionalities/data-formatter/valueobj-pass-by-reg/Makefile =================================================================== --- /dev/null +++ lldb/test/API/functionalities/data-formatter/valueobj-pass-by-reg/Makefile @@ -0,0 +1,5 @@ +# We are only supplying main.s but +# Make has a built-in rule for going from main.c -> main.s and main.c to main.o +# Make knows it needs $(EXE), for that it knows it needs main.o and it has a rule for building that from main.s +C_SOURCES := main.c +include Makefile.rules Index: lldb/source/Core/ValueObjectChild.cpp =================================================================== --- lldb/source/Core/ValueObjectChild.cpp +++ lldb/source/Core/ValueObjectChild.cpp @@ -199,11 +199,7 @@ // try to extract the child value from the parent's scalar value { Scalar scalar(m_value.GetScalar()); - if (m_bitfield_bit_size) - scalar.ExtractBitfield(m_bitfield_bit_size, - m_bitfield_bit_offset); - else - scalar.ExtractBitfield(8 * m_byte_size, 8 * m_byte_offset); + scalar.ExtractBitfield(8 * m_byte_size, 8 * m_byte_offset); m_value.GetScalar() = scalar; } break;
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits