From: Bryce McKinlay Date: Fri, 14 May 2004 01:39:52 +0000 (+0000) Subject: 2004-05-13 Bryce McKinlay X-Git-Tag: gdb_6_1_1-20040616-release~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d6b5adf84da6dc9ad875d03b8680829863446b7c;p=thirdparty%2Fbinutils-gdb.git 2004-05-13 Bryce McKinlay * dwarf2loc.c (find_location_expression): Use ANOFFSET to adjust base_address for shared libraries. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 013c3ed116a..d6f6a4603af 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2004-05-13 Bryce McKinlay + + * dwarf2loc.c (find_location_expression): Use ANOFFSET to adjust + base_address for shared libraries. + 2004-05-11 Nick Roberts * utils.c (defaulted_query): Just use the normal query input type diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index ef333f7e770..cdbeb10acf4 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -53,11 +53,14 @@ static char * find_location_expression (struct dwarf2_loclist_baton *baton, size_t *locexpr_length, CORE_ADDR pc) { - CORE_ADDR base_address = baton->base_address; CORE_ADDR low, high; char *loc_ptr, *buf_end; unsigned int addr_size = TARGET_ADDR_BIT / TARGET_CHAR_BIT, length; CORE_ADDR base_mask = ~(~(CORE_ADDR)1 << (addr_size * 8 - 1)); + /* Adjust base_address for relocatable objects. */ + CORE_ADDR base_offset = ANOFFSET (baton->objfile->section_offsets, + SECT_OFF_TEXT (baton->objfile)); + CORE_ADDR base_address = baton->base_address + base_offset; loc_ptr = baton->data; buf_end = baton->data + baton->size;