This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] Fix for D139955 Summary:
ClosedPublic

Authored by ayermolo on Mar 22 2023, 1:29 PM.

Details

Summary

Fixing a small typo.

Diff Detail

Event Timeline

ayermolo created this revision.Mar 22 2023, 1:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2023, 1:29 PM
Herald added subscribers: hoy, modimo, wenlei. · View Herald Transcript
ayermolo requested review of this revision.Mar 22 2023, 1:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2023, 1:29 PM

Is there no test case catching this?

ayermolo updated this revision to Diff 507526.Mar 22 2023, 3:31 PM

added test

ayermolo updated this revision to Diff 507528.Mar 22 2023, 3:34 PM

updated test

Fix the error message to check for the exact error message and this is good to go.

lldb/test/Shell/SymbolFile/DWARF/range-lower-then-low-pc.s
11

might be good to verify that the correct DIE offset of the block ID is. in the error message. If this code hadn't assert'ed we still might have gotten a string output, but we need to verify the data is correct. If you run it manually once you can see the exact error message we will need to check for.

ayermolo updated this revision to Diff 507812.Mar 23 2023, 10:47 AM

updated test

ayermolo marked an inline comment as done.Mar 23 2023, 10:48 AM
clayborg added inline comments.Mar 23 2023, 11:00 AM
lldb/test/Shell/SymbolFile/DWARF/range-lower-then-low-pc.s
11

Shouldn't the low PC of the function be zero?

FYI: This might be because we are using a .o file and relocations are being applied internally!?

lldb/test/Shell/SymbolFile/DWARF/range-lower-then-low-pc.s
11
0x00000043:   DW_TAG_subprogram
                DW_AT_low_pc	(0x0000000000000001)
                DW_AT_high_pc	(0x000000000000002e)
                DW_AT_frame_base	(DW_OP_reg6 RBP)
                DW_AT_linkage_name	("_ZL3foob")
                DW_AT_name	("foo")
                DW_AT_decl_file	("base-lower-then-range-entry/base-lower-then-range-entry/main.cpp")
                DW_AT_decl_line	(1)
                DW_AT_type	(0x0000008b)

0x00000060:     DW_TAG_formal_parameter
                  DW_AT_location	(DW_OP_fbreg -5)
                  DW_AT_name	("b")
                  DW_AT_decl_file	("base-lower-then-range-entry/base-lower-then-range-entry/main.cpp")
                  DW_AT_decl_line	(1)
                  DW_AT_type	(0x00000092)

0x0000006e:     DW_TAG_lexical_block
                  DW_AT_ranges	(0x00000000
                     [0x0000000000000000, 0x000000000000001f)
                     [0x0000000000000000, 0x000000000000002d))

Seems like we have a bug in the code that prints the error message?

ayermolo added inline comments.Mar 23 2023, 11:50 AM
lldb/test/Shell/SymbolFile/DWARF/range-lower-then-low-pc.s
11

Stepped through the code 0x21 is what gets extracted in DWARFDebugInfoEntry::GetDIENamesAndRanges.

clayborg accepted this revision.Mar 23 2023, 12:58 PM

Must be relocations causing the stuff to not match up to the llvm-dwarfdump output.

This revision is now accepted and ready to land.Mar 23 2023, 12:58 PM

Must be relocations causing the stuff to not match up to the llvm-dwarfdump output.

Looked through llvm-dwarfdump code. Yep. since relocation exists, it just returns an addend which is 1.

ayermolo updated this revision to Diff 507855.Mar 23 2023, 1:19 PM

fixed up refs

This revision was automatically updated to reflect the committed changes.