From: Mark Alexander Date: Wed, 26 Mar 1997 14:48:59 +0000 (+0000) Subject: Fix from Peter Schauer: X-Git-Tag: gdb-4_18-branchpoint~6009 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4a3150f58a4492a8b164eed90ee984c6485671a4;p=thirdparty%2Fbinutils-gdb.git Fix from Peter Schauer: * mdebugread.c (parse_procedure): Set address of procedure to block start; this fixes problems with shared libraries introduced by change of Mar 21. --- diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 1e9fe6de65e..dda7c8c635d 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -2005,7 +2005,18 @@ parse_procedure (pr, search_symtab, pst) e = (struct mips_extra_func_info *) SYMBOL_VALUE (i); e->pdr = *pr; e->pdr.isym = (long) s; - e->pdr.adr += cur_fdr->adr; /* PDR address is relative to FDR address */ + + /* GDB expects the absolute function start address for the + procedure descriptor in e->pdr.adr. + As the address in the procedure descriptor is usually relative, + we would have to relocate e->pdr.adr with cur_fdr->adr and + ANOFFSET (pst->section_offsets, SECT_OFF_TEXT). + Unfortunately cur_fdr->adr and e->pdr.adr are both absolute + in shared libraries on some systems, and on other systems + e->pdr.adr is sometimes offset by a bogus value. + To work around these problems, we replace e->pdr.adr with + the start address of the function. */ + e->pdr.adr = BLOCK_START (b); /* Correct incorrect setjmp procedure descriptor from the library to make backtrace through setjmp work. */