|
From: <sv...@va...> - 2006-04-12 10:08:24
|
Author: sewardj
Date: 2006-04-12 11:08:05 +0100 (Wed, 12 Apr 2006)
New Revision: 5841
Log:
Properly handle external debuginfo (.gnu_debuglink) for stripped and
prelinked libraries (patch from L. David Baron).
Modified:
trunk/coregrind/m_debuginfo/priv_readdwarf.h
trunk/coregrind/m_debuginfo/priv_readstabs.h
trunk/coregrind/m_debuginfo/priv_storage.h
trunk/coregrind/m_debuginfo/readdwarf.c
trunk/coregrind/m_debuginfo/readelf.c
trunk/coregrind/m_debuginfo/readstabs.c
Modified: trunk/coregrind/m_debuginfo/priv_readdwarf.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debuginfo/priv_readdwarf.h 2006-04-09 01:23:29 UTC =
(rev 5840)
+++ trunk/coregrind/m_debuginfo/priv_readdwarf.h 2006-04-12 10:08:05 UTC =
(rev 5841)
@@ -43,7 +43,7 @@
-------------------- */
extern
void ML_(read_debuginfo_dwarf2)
- ( struct _SegInfo* si,
+ ( struct _SegInfo* si, OffT debug_offset,
UChar* debuginfo, Int debug_info_sz, /* .debug_info */
UChar* debugabbrev, /* .debug_abbrev */
UChar* debugline, Int debug_line_sz, /* .debug_line */
Modified: trunk/coregrind/m_debuginfo/priv_readstabs.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debuginfo/priv_readstabs.h 2006-04-09 01:23:29 UTC =
(rev 5840)
+++ trunk/coregrind/m_debuginfo/priv_readstabs.h 2006-04-12 10:08:05 UTC =
(rev 5841)
@@ -41,7 +41,7 @@
Stabs reader
-------------------- */
extern
-void ML_(read_debuginfo_stabs) ( struct _SegInfo* si,
+void ML_(read_debuginfo_stabs) ( struct _SegInfo* si, OffT debug_offset,
UChar* stabC, Int stab_sz,
UChar* stabstr, Int stabstr_sz );
=20
Modified: trunk/coregrind/m_debuginfo/priv_storage.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debuginfo/priv_storage.h 2006-04-09 01:23:29 UTC (r=
ev 5840)
+++ trunk/coregrind/m_debuginfo/priv_storage.h 2006-04-12 10:08:05 UTC (r=
ev 5841)
@@ -170,8 +170,10 @@
UChar strtab[SEGINFO_STRCHUNKSIZE];
} *strchunks;
=20
- /* 'offset' is what we need to add to symbol table entries to get
- the location of that symbol in the running image. */
+ /* 'offset' is what needs to be added to an address in the address
+ space of the library as stored on disk (which is not 0-based for
+ executables or prelinked libraries) to get an address in memory
+ for the object loaded at 'start' */
OffT offset;
=20
/* Bounds of data, BSS, PLT, GOT and OPD (for ppc64-linux) so that
Modified: trunk/coregrind/m_debuginfo/readdwarf.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debuginfo/readdwarf.c 2006-04-09 01:23:29 UTC (rev =
5840)
+++ trunk/coregrind/m_debuginfo/readdwarf.c 2006-04-12 10:08:05 UTC (rev =
5841)
@@ -301,7 +301,7 @@
/* Handled an extend line op. Returns true if this is the end
of sequence. */
static=20
-Int process_extended_line_op( struct _SegInfo* si,=20
+Int process_extended_line_op( struct _SegInfo* si, OffT debug_offset,
WordArray* filenames,=20
WordArray* dirnames,=20
WordArray* fnidx2dir,=20
@@ -330,7 +330,7 @@
switch (op_code) {
case DW_LNE_end_sequence:
if (0) VG_(printf)("1001: si->o %p, smr.a %p\n",=20
- si->offset, state_machine_regs.address );
+ debug_offset, state_machine_regs.address );
/* JRS: added for compliance with spec; is pointless due to
reset_state_machine below */
state_machine_regs.end_sequence =3D 1;=20
@@ -343,8 +343,8 @@
state_machine_regs.last_file),=20
lookupDir( state_machine_regs.last_file,
fnidx2dir, dirnames ),
- si->offset + state_machine_regs.last_address,=20
- si->offset + state_machine_regs.address,=20
+ debug_offset + state_machine_regs.last_address,=20
+ debug_offset + state_machine_regs.address,=20
state_machine_regs.last_line, 0
);
}
@@ -388,7 +388,7 @@
* Output: - si debug info structures get updated
*/
static=20
-void read_dwarf2_lineblock ( struct _SegInfo* si,=20
+void read_dwarf2_lineblock ( struct _SegInfo* si, OffT debug_offset,
UnitInfo* ui,=20
UChar* theBlock,=20
Int noLargerThan )
@@ -606,7 +606,7 @@
if (0) VG_(printf)("smr.a +=3D %p\n", adv );
adv =3D (op_code % info.li_line_range) + info.li_line_base;
if (0) VG_(printf)("1002: si->o %p, smr.a %p\n",=20
- si->offset, state_machine_regs.address );
+ debug_offset, state_machine_regs.address );
state_machine_regs.line +=3D adv;
=20
if (state_machine_regs.is_stmt) {
@@ -618,8 +618,8 @@
state_machine_regs.last_file )=
,
lookupDir( state_machine_regs.last_file,
&fnidx2dir, &dirnames ),
- si->offset + state_machine_regs.last_address,=20
- si->offset + state_machine_regs.address,=20
+ debug_offset + state_machine_regs.last_address,=20
+ debug_offset + state_machine_regs.address,=20
state_machine_regs.last_line,=20
0
);
@@ -634,13 +634,13 @@
switch (op_code) {
case DW_LNS_extended_op:
data +=3D process_extended_line_op (
- si, &filenames, &dirnames, &fnidx2dir,
+ si, debug_offset, &filenames, &dirnames, &fnidx2d=
ir,
data, info.li_default_is_stmt);
break;
=20
case DW_LNS_copy:
if (0) VG_(printf)("1002: si->o %p, smr.a %p\n",=20
- si->offset, state_machine_regs.address );
+ debug_offset, state_machine_regs.address =
);
if (state_machine_regs.is_stmt) {
/* only add a statement if there was a previous boundary =
*/
if (state_machine_regs.last_address)=20
@@ -650,8 +650,8 @@
state_machine_regs.last_fil=
e ),
lookupDir( state_machine_regs.last_file,
&fnidx2dir, &dirnames ),
- si->offset + state_machine_regs.last_address,=20
- si->offset + state_machine_regs.address,
+ debug_offset + state_machine_regs.last_address,=20
+ debug_offset + state_machine_regs.address,
state_machine_regs.last_line,=20
0
);
@@ -950,7 +950,7 @@
* Output: update si to contain all the dwarf2 debug infos
*/
void ML_(read_debuginfo_dwarf2)=20
- ( struct _SegInfo* si,
+ ( struct _SegInfo* si, OffT debug_offset,
UChar* debuginfo, Int debug_info_sz, /* .debug_info */
UChar* debugabbrev, /* .debug_abbrev */
UChar* debugline, Int debug_line_sz, /* .debug_line */
@@ -1006,7 +1006,7 @@
VG_(printf)("debug_line_sz %d, ui.stmt_list %lld %s\n",=20
debug_line_sz, ui.stmt_list, ui.name );
/* Read the .debug_line block for this compile unit */
- read_dwarf2_lineblock( si, &ui, debugline + ui.stmt_list,=20
+ read_dwarf2_lineblock( si, debug_offset, &ui, debugline + ui.stmt_=
list,=20
debug_line_sz - ui.stmt_list );
}
}
Modified: trunk/coregrind/m_debuginfo/readelf.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debuginfo/readelf.c 2006-04-09 01:23:29 UTC (rev 58=
40)
+++ trunk/coregrind/m_debuginfo/readelf.c 2006-04-12 10:08:05 UTC (rev 58=
41)
@@ -192,6 +192,7 @@
Char* sym_name, /* name */
Addr sym_addr, /* declared address */
UChar* opd_filea, /* oimage of .opd sec (ppc64-linux only) *=
/
+ OffT opd_offset, /* base address assumed in oimage */
/* OUTPUTS */
Char** sym_name_out, /* name we should record */
Addr* sym_addr_out, /* addr we should record */
@@ -293,8 +294,8 @@
Int offset_in_opd;
ULong* fn_descr;
=20
- if (0) VG_(printf)("opdXXX: si->offset %p, sym_addr %p\n",=20
- (void*)(si->offset), (void*)sym_addr);
+ if (0) VG_(printf)("opdXXX: opd_offset %p, sym_addr %p\n",=20
+ (void*)(opd_offset), (void*)sym_addr);
=20
if (!VG_IS_8_ALIGNED(sym_addr)) {
TRACE_SYMTAB(" ignore -- not 8-aligned: %s\n", sym_name);
@@ -323,17 +324,13 @@
offset_in_opd, fn_descr);
if (0) VG_(printf)("opdXXZ: *fn_descr %p\n", (void*)(fn_descr[0]))=
;
=20
- sym_addr =3D fn_descr[0];
+ /* opd_offset is the difference between si->start (where the
+ library got mapped) and the address space used for addresses
+ within the library file. */
=20
- /* Hopefully sym_addr is now an offset into the text section.
- Problem is, where did the text section get mapped? Well,
- this SegInfo (si) exists because a text section got mapped,
- and it got mapped to si->start. Hence add si->start to the
- sym_addr to get the real vma. */
-
- sym_addr +=3D si->offset;
+ sym_addr =3D fn_descr[0] + opd_offset;
*sym_addr_out =3D sym_addr;
- *sym_tocptr_out =3D fn_descr[1] + si->offset;
+ *sym_tocptr_out =3D fn_descr[1] + opd_offset;
*from_opd_out =3D True;
is_in_opd =3D True;
=20
@@ -360,7 +357,9 @@
ignore it. */
if (*sym_addr_out + *sym_size_out <=3D si->start
|| *sym_addr_out >=3D si->start+si->size) {
- TRACE_SYMTAB( " ignore -- outside mapped range\n" );
+ TRACE_SYMTAB( "ignore -- %p .. %p outside mapped range %p .. %p\n"=
,
+ *sym_addr_out, *sym_addr_out + *sym_size_out,
+ si->start, si->start+si->size);
return False;
}
=20
@@ -386,9 +385,9 @@
__attribute__((unused)) /* not referred to on all targets */
void read_elf_symtab__normal(=20
struct _SegInfo* si, UChar* tab_name,
- ElfXX_Sym* o_symtab, UInt o_symtab_sz,
+ ElfXX_Sym* o_symtab, UInt o_symtab_sz, OffT o_symtab_offset,
UChar* o_strtab, UInt o_strtab_sz,
- UChar* opd_filea /* ppc64-linux only */=20
+ UChar* opd_filea, OffT opd_offset /* ppc64-linux only */=20
)
{
Int i;
@@ -416,12 +415,13 @@
for (i =3D 1; i < (Int)(o_symtab_sz/sizeof(ElfXX_Sym)); i++) {
sym =3D & o_symtab[i];
sym_name =3D (Char*)(o_strtab + sym->st_name);
- sym_addr =3D si->offset + sym->st_value;
+ sym_addr =3D o_symtab_offset + sym->st_value;
=20
if (VG_(clo_trace_symtab))
show_raw_elf_symbol(i, sym, sym_name, sym_addr, False);
=20
- if (get_elf_symbol_info(si, sym, sym_name, sym_addr, opd_filea,
+ if (get_elf_symbol_info(si, sym, sym_name, sym_addr,
+ opd_filea, opd_offset,
&sym_name_really,=20
&sym_addr_really,
&sym_size,
@@ -484,9 +484,9 @@
__attribute__((unused)) /* not referred to on all targets */
void read_elf_symtab__ppc64_linux(=20
struct _SegInfo* si, UChar* tab_name,
- ElfXX_Sym* o_symtab, UInt o_symtab_sz,
+ ElfXX_Sym* o_symtab, UInt o_symtab_sz, OffT o_symtab_offset,
UChar* o_strtab, UInt o_strtab_sz,
- UChar* opd_filea /* ppc64-linux only */=20
+ UChar* opd_filea, OffT opd_offset /* ppc64-linux only */=20
)
{
Int i, old_size;
@@ -523,12 +523,13 @@
for (i =3D 1; i < (Int)(o_symtab_sz/sizeof(ElfXX_Sym)); i++) {
sym =3D & o_symtab[i];
sym_name =3D (Char*)(o_strtab + sym->st_name);
- sym_addr =3D si->offset + sym->st_value;
+ sym_addr =3D o_symtab_offset + sym->st_value;
=20
if (VG_(clo_trace_symtab))
show_raw_elf_symbol(i, sym, sym_name, sym_addr, True);
=20
- if (get_elf_symbol_info(si, sym, sym_name, sym_addr, opd_filea,
+ if (get_elf_symbol_info(si, sym, sym_name, sym_addr,
+ opd_filea, opd_offset,
&sym_name_really,=20
&sym_addr_really,
&sym_size,
@@ -816,8 +817,10 @@
Bool ok;
Addr oimage;
UInt n_oimage;
+ OffT offset_oimage =3D 0;
Addr dimage =3D 0;
UInt n_dimage =3D 0;
+ OffT offset_dimage =3D 0;
struct vki_stat stat_buf;
=20
oimage =3D (Addr)NULL;
@@ -883,8 +886,6 @@
ElfXX_Addr prev_addr =3D 0;
Addr baseaddr =3D 0;
=20
- si->offset =3D 0;
-
vg_assert(si->soname =3D=3D NULL);
=20
for (i =3D 0; i < ehdr->e_phnum; i++) {
@@ -926,7 +927,7 @@
=20
if (!offset_set) {
offset_set =3D True;
- si->offset =3D si->start - o_phdr->p_vaddr;
+ offset_oimage =3D si->start - o_phdr->p_vaddr;
baseaddr =3D o_phdr->p_vaddr;
}
=20
@@ -938,7 +939,7 @@
prev_addr =3D o_phdr->p_vaddr;
=20
// Get the data and bss start/size if appropriate
- mapped =3D o_phdr->p_vaddr + si->offset;
+ mapped =3D o_phdr->p_vaddr + offset_oimage;
mapped_end =3D mapped + o_phdr->p_memsz;
if (si->data_start_vma =3D=3D 0 &&
(o_phdr->p_flags & (PF_R|PF_W|PF_X)) =3D=3D (PF_R|PF_W)) {
@@ -970,6 +971,8 @@
}
}
=20
+ si->offset =3D offset_oimage;
+
/* If, after looking at all the program headers, we still didn't=20
find a soname, add a fake one. */
if (si->soname =3D=3D NULL) {
@@ -1010,6 +1013,11 @@
UChar* opd_filea =3D NULL; /* .opd (dwarf2, ppc64-=
linux) */
UChar* dummy_filea =3D NULL;
=20
+ OffT o_symtab_offset =3D offset_oimage;
+ OffT o_dynsym_offset =3D offset_oimage;
+ OffT debug_offset =3D offset_oimage;
+ OffT opd_offset =3D offset_oimage;
+
/* Section sizes, in bytes */
UInt o_strtab_sz =3D 0;
UInt o_symtab_sz =3D 0;
@@ -1049,7 +1057,7 @@
# define FIND(sec_name, sec_size, sec_filea, sec_vma) \
if (0 =3D=3D VG_(strcmp)(sec_name, sh_strtab + shdr[i].sh_name)=
) { \
Bool nobits; \
- sec_vma =3D (Addr)(si->offset + shdr[i].sh_addr); \
+ sec_vma =3D (Addr)(offset_oimage + shdr[i].sh_addr); \
sec_filea =3D (void*)(oimage + shdr[i].sh_offset); \
sec_size =3D shdr[i].sh_size; \
nobits =3D shdr[i].sh_type =3D=3D SHT_NOBITS; \
@@ -1093,10 +1101,6 @@
# undef FIND
}
=20
- /* Check some sizes */
- vg_assert((o_dynsym_sz % sizeof(ElfXX_Sym)) =3D=3D 0);
- vg_assert((o_symtab_sz % sizeof(ElfXX_Sym)) =3D=3D 0);
-
/* Did we find a debuglink section? */
if (debuglink !=3D NULL) {
UInt crc_offset =3D VG_ROUNDUP(VG_(strlen)(debuglink)+1, 4);
@@ -1112,7 +1116,24 @@
ehdr =3D (ElfXX_Ehdr*)dimage;
=20
if (n_dimage >=3D sizeof(ElfXX_Ehdr)=20
- && ML_(is_elf_object_file(ehdr))) {
+ && ML_(is_elf_object_file(ehdr))
+ && ehdr->e_phoff + ehdr->e_phnum*sizeof(ElfXX_Phdr) <=3D=
n_dimage
+ && ehdr->e_shoff + ehdr->e_shnum*sizeof(ElfXX_Shdr) <=3D=
n_dimage)
+ {
+ Bool need_symtab =3D (NULL =3D=3D o_symtab);
+
+ for (i =3D 0; i < ehdr->e_phnum; i++) {
+ ElfXX_Phdr *o_phdr =3D &((ElfXX_Phdr *)(dimage + ehdr-=
>e_phoff))[i];
+ if (o_phdr->p_type =3D=3D PT_LOAD) {
+ offset_dimage =3D si->start - o_phdr->p_vaddr;
+ break;
+ }
+ }
+
+ debug_offset =3D offset_dimage;
+ if (need_symtab)
+ o_symtab_offset =3D offset_dimage;
+
shdr =3D (ElfXX_Shdr*)(dimage + ehdr->e_shoff);
sh_strtab =3D (UChar*)(dimage + shdr[ehdr->e_shstrndx].sh=
_offset);
=20
@@ -1122,8 +1143,9 @@
/* Find all interesting sections */
for (i =3D 0; i < ehdr->e_shnum; i++) {
=20
-# define FIND(sec_name, sec_size, sec_filea) \
- if (0 =3D=3D VG_(strcmp)(sec_name, sh_strtab + shdr[i]=
.sh_name)) { \
+# define FIND(condition, sec_name, sec_size, sec_filea) =
\
+ if (condition \
+ && 0 =3D=3D VG_(strcmp)(sec_name, sh_strtab + shdr=
[i].sh_name)) { \
Bool nobits; \
if (0 !=3D sec_filea) \
VG_(core_panic)("repeated section!\n"); \
@@ -1140,14 +1162,16 @@
} \
}
=20
- FIND(".stab", stab_sz, stab)
- FIND(".stabstr", stabstr_sz, stabstr)
- FIND(".debug_line", debug_line_sz, debug_line)
- FIND(".debug_info", debug_info_sz, debug_info)
- FIND(".debug_abbrev", debug_abbv_sz, debug_abbv)
- FIND(".debug_str", debug_str_sz, debug_str)
- FIND(".debug", dwarf1d_sz, dwarf1d)
- FIND(".line", dwarf1l_sz, dwarf1l)
+ FIND(need_symtab, ".symtab", o_symtab_sz, o_sy=
mtab)
+ FIND(need_symtab, ".strtab", o_strtab_sz, o_st=
rtab)
+ FIND(1, ".stab", stab_sz, stab=
)
+ FIND(1, ".stabstr", stabstr_sz, stab=
str)
+ FIND(1, ".debug_line", debug_line_sz, debu=
g_line)
+ FIND(1, ".debug_info", debug_info_sz, debu=
g_info)
+ FIND(1, ".debug_abbrev", debug_abbv_sz, debu=
g_abbv)
+ FIND(1, ".debug_str", debug_str_sz, debu=
g_str)
+ FIND(1, ".debug", dwarf1d_sz, dwar=
f1d)
+ FIND(1, ".line", dwarf1l_sz, dwar=
f1l)
=20
# undef FIND
}
@@ -1155,22 +1179,26 @@
}
}
=20
+ /* Check some sizes */
+ vg_assert((o_dynsym_sz % sizeof(ElfXX_Sym)) =3D=3D 0);
+ vg_assert((o_symtab_sz % sizeof(ElfXX_Sym)) =3D=3D 0);
+
/* Read symbols */
{
void (*read_elf_symtab)(struct _SegInfo*,UChar*,ElfXX_Sym*,
- UInt,UChar*,UInt,UChar*);
+ UInt,OffT,UChar*,UInt,UChar*,OffT);
# if defined(VGP_ppc64_linux)
read_elf_symtab =3D read_elf_symtab__ppc64_linux;
# else
read_elf_symtab =3D read_elf_symtab__normal;
# endif
read_elf_symtab(si, "symbol table",
- o_symtab, o_symtab_sz,
- o_strtab, o_strtab_sz, opd_filea);
+ o_symtab, o_symtab_sz, o_symtab_offset,
+ o_strtab, o_strtab_sz, opd_filea, opd_offset);
=20
read_elf_symtab(si, "dynamic symbol table",
- o_dynsym, o_dynsym_sz,
- o_dynstr, o_dynstr_sz, opd_filea);
+ o_dynsym, o_dynsym_sz, o_dynsym_offset,
+ o_dynstr, o_dynstr_sz, opd_filea, opd_offset);
}
=20
/* Read .eh_frame (call-frame-info) if any */
@@ -1183,7 +1211,7 @@
we ignore it. */
# if !defined(VGP_amd64_linux)
if (stab && stabstr) {
- ML_(read_debuginfo_stabs) ( si, stab, stab_sz,=20
+ ML_(read_debuginfo_stabs) ( si, debug_offset, stab, stab_sz,=20
stabstr, stabstr_sz );
}
# endif
@@ -1193,7 +1221,7 @@
read_unitinfo_dwarf2, do check that debugstr is non-NULL
before using it. */
if (debug_info && debug_abbv && debug_line /* && debug_str */) {
- ML_(read_debuginfo_dwarf2) ( si,=20
+ ML_(read_debuginfo_dwarf2) ( si, debug_offset,=20
debug_info, debug_info_sz,
debug_abbv,
debug_line, debug_line_sz,
Modified: trunk/coregrind/m_debuginfo/readstabs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debuginfo/readstabs.c 2006-04-09 01:23:29 UTC (rev =
5840)
+++ trunk/coregrind/m_debuginfo/readstabs.c 2006-04-12 10:08:05 UTC (rev =
5841)
@@ -77,7 +77,7 @@
/* Read stabs-format debug info. This is all rather horrible because
stabs is a underspecified, kludgy hack.
*/
-void ML_(read_debuginfo_stabs) ( SegInfo* si,
+void ML_(read_debuginfo_stabs) ( SegInfo* si, OffT debug_offset,
UChar* stabC, Int stab_sz,=20
UChar* stabstr, Int stabstr_sz )
{
@@ -333,7 +333,7 @@
line.first =3D True;
=20
/* line ends at start of next function */
- addr =3D si->offset + st->n_value;
+ addr =3D debug_offset + st->n_value;
=20
func.start =3D addr;
}
|