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]
Other format: [Raw text]

[commit] FRV: Fix some inferior function call bugs for FDPIC ABI


I've just committed the patch below.  As noted in the subject, it
fixes some bugs related to calling inferior functions on the FRV using
the FDPIC (shared library) ABI.

The change to solib-frv.c fixes a segfault when running an fdpic
executable in the simulator.  The change to frv-tdep.c allows the GDB
user specify a function argument using either a descriptor or the
function's entry point.  (This fixes a few failures in callfuncs.exp.)

Kevin

	* frv-tdep.c (find_func_descr): Verify that entry point can be
	found in symbol table prior to looking up its function descriptor.
	* solib-frv.c (find_canonical_descriptor_in_load_object): Add
	test for non-NULL link map.

Index: frv-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/frv-tdep.c,v
retrieving revision 1.94
diff -u -p -r1.94 frv-tdep.c
--- frv-tdep.c	31 Mar 2005 20:39:14 -0000	1.94
+++ frv-tdep.c	29 Apr 2005 21:40:25 -0000
@@ -1079,6 +1079,13 @@ find_func_descr (struct gdbarch *gdbarch
 {
   CORE_ADDR descr;
   char valbuf[4];
+  CORE_ADDR start_addr;
+
+  /* If we can't find the function in the symbol table, then we assume
+     that the function address is already in descriptor form.  */
+  if (!find_pc_partial_function (entry_point, NULL, &start_addr, NULL)
+      || entry_point != start_addr)
+    return entry_point;
 
   descr = frv_fdpic_find_canonical_descriptor (entry_point);
 
Index: solib-frv.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-frv.c,v
retrieving revision 1.8
diff -u -p -r1.8 solib-frv.c
--- solib-frv.c	31 Mar 2005 20:39:14 -0000	1.8
+++ solib-frv.c	29 Apr 2005 21:40:25 -0000
@@ -1109,6 +1109,10 @@ find_canonical_descriptor_in_load_object
   if (abfd == 0)
     return 0;
 
+  /* Nothing to do if no link map.  */
+  if (lm == 0)
+    return 0;
+
   /* We want to scan the dynamic relocs for R_FRV_FUNCDESC relocations.
      (More about this later.)  But in order to fetch the relocs, we
      need to first fetch the dynamic symbols.  These symbols need to


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