Fix from Peter Schauer:
authorMark Alexander <marka@cygnus>
Wed, 26 Mar 1997 14:48:59 +0000 (14:48 +0000)
committerMark Alexander <marka@cygnus>
Wed, 26 Mar 1997 14:48:59 +0000 (14:48 +0000)
* mdebugread.c (parse_procedure): Set address of procedure to
block start; this fixes problems with shared libraries introduced
by change of Mar 21.

gdb/mdebugread.c

index 1e9fe6d..dda7c8c 100644 (file)
@@ -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.  */