This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


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

find_pc_sect_partial_function


Hi,
  This patch fixes a problem on hppa-linux.  One of the peculiarities of
this target is that the linker inserts groups of long branch and plt
call stubs at the beginning of .text (and other places too).  These stubs
don't have any debugging information so gdb uses the closest minimal
symbol with smaller address in an attempt to discover which function
the stub code belongs to.  That's where things start to go wrong as we get
a label at the end of the .init section.  Worse, the end of the .init
section (osect->endaddr) seems to get set to the end of .text, so
cache_pc_function* is poisoned.

<.init section>
_init:
        _init code
_end_init:

<.text section>
        long branch and other stubs
first_func:
        code


gdb/ChangeLog
2001-02-27  Alan Modra  <alan@linuxcare.com.au>

	* blockframe.c (find_pc_sect_partial_function): Check minsym
	section against pc section.

Alan Modra
-- 
Linuxcare.  Support for the Revolution.

Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.11
diff -u -p -r1.11 blockframe.c
--- blockframe.c	2001/01/12 20:43:35	1.11
+++ blockframe.c	2001/02/27 09:29:32
@@ -807,10 +807,14 @@ find_pc_sect_partial_function (CORE_ADDR
      of the text seg doesn't appear to be part of the last function in the
      text segment.  */
 
-  osect = find_pc_sect_section (mapped_pc, section);
+  osect = NULL;
+  if (msymbol)
+    {
+      osect = find_pc_sect_section (mapped_pc, section);
 
-  if (!osect)
-    msymbol = NULL;
+      if (!osect || osect->the_bfd_section != SYMBOL_BFD_SECTION (msymbol))
+	msymbol = NULL;
+    }
 
   /* Must be in the minimal symbol table.  */
   if (msymbol == NULL)


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