This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH]: Skip base address specifiers in location lists


The dwarf2 location list patch is moving along again on the gcc side, and while dumping the info with readelf, i noticed i forgot to handle base address changes.
For instance, if a function isn't in .text, we need to use one to signify that the address range the location list is referring to is based off some other section.
The base address defaults to the starting address of the CU technically, but since we display debug_loc without ever referring to the CU, we don't have it handy anyway, so we've never calculated the "right" begin and end of the range, just displayed the offsets.
Without this, we'll segfault if we see a base address change, because we get all confused.
For now, i have it just skip them because that's the minimal patch that works, and it makes no sense to display some of the begin/end ranges with the actual address, and some without.

All that explanation for a one liner.
:)

2003-01-13 Daniel Berlin <dan@dberlin.org>

* readelf.c (display_debug_loc): Skip address base changes.

+++ readelf.c 14 Jan 2003 17:02:58 -0000
@@ -7635,6 +7635,9 @@ display_debug_loc (section, start, file)

if (begin == 0 && end == 0)
break;
+ /* For now, skip any base address specifiers. */
+ if (begin == 0xffffffff)
+ continue;

begin += addr;
end += addr;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]