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/obish] Eliminate mips_pc_in_sigtramp, delete fallout


Again, switching MIPS to unwinders has made this code dead (OSABI code instead implements a sigtramp unwinder). The fallout is fixup_sigtramp, since it is mips specific and no longer called, I've deleted that as well.

committed,
Andrew
2004-04-30  Andrew Cagney  <cagney@redhat.com>

	* mips-tdep.c (mips_pc_in_sigtramp): Delete.
	(mips_gdbarch_init): Do not set pc_in_sigtramp.
	* mipsread.c (sigtramp_address): Delete extern variable.
	(mipscoff_new_init): Delete reference.
	* mdebugread.c (sigtramp_address, sigtramp_end): Delete variables.
	(fixup_sigtramp): Delete function.
	* config/mips/tm-mips.h (sigtramp_address, sigtramp_end)
	(fixup_sigtramp): Delete declarations.

Index: mdebugread.c
===================================================================
RCS file: /cvs/src/src/gdb/mdebugread.c,v
retrieving revision 1.60
diff -p -u -r1.60 mdebugread.c
--- mdebugread.c	14 Feb 2004 15:46:33 -0000	1.60
+++ mdebugread.c	1 May 2004 00:31:59 -0000
@@ -321,10 +321,6 @@ static void handle_psymbol_enumerators (
 
 static char *mdebug_next_symbol_text (struct objfile *);
 
-/* Address bounds for the signal trampoline in inferior, if any */
-
-CORE_ADDR sigtramp_address, sigtramp_end;
-
 /* Allocate zeroed memory */
 
 static void *
@@ -4751,126 +4747,6 @@ elfmdebug_build_psymtabs (struct objfile
   install_minimal_symbols (objfile);
   do_cleanups (back_to);
 }
-
-
-/* Things used for calling functions in the inferior.
-   These functions are exported to our companion
-   mips-tdep.c file and are here because they play
-   with the symbol-table explicitly. */
-
-/* Sigtramp: make sure we have all the necessary information
-   about the signal trampoline code. Since the official code
-   from MIPS does not do so, we make up that information ourselves.
-   If they fix the library (unlikely) this code will neutralize itself. */
-
-/* FIXME: This function is called only by mips-tdep.c.  It needs to be
-   here because it calls functions defined in this file, but perhaps
-   this could be handled in a better way.  Only compile it in when
-   tm-mips.h is included. */
-
-#ifdef TM_MIPS_H
-
-void
-fixup_sigtramp (void)
-{
-  struct symbol *s;
-  struct symtab *st;
-  struct block *b, *b0 = NULL;
-
-  sigtramp_address = -1;
-
-  /* We have to handle the following cases here:
-     a) The Mips library has a sigtramp label within sigvec.
-     b) Irix has a _sigtramp which we want to use, but it also has sigvec.  */
-  s = lookup_symbol ("sigvec", 0, VAR_DOMAIN, 0, NULL);
-  if (s != 0)
-    {
-      b0 = SYMBOL_BLOCK_VALUE (s);
-      s = lookup_symbol ("sigtramp", b0, VAR_DOMAIN, 0, NULL);
-    }
-  if (s == 0)
-    {
-      /* No sigvec or no sigtramp inside sigvec, try _sigtramp.  */
-      s = lookup_symbol ("_sigtramp", 0, VAR_DOMAIN, 0, NULL);
-    }
-
-  /* But maybe this program uses its own version of sigvec */
-  if (s == 0)
-    return;
-
-  /* Did we or MIPSco fix the library ? */
-  if (SYMBOL_CLASS (s) == LOC_BLOCK)
-    {
-      sigtramp_address = BLOCK_START (SYMBOL_BLOCK_VALUE (s));
-      sigtramp_end = BLOCK_END (SYMBOL_BLOCK_VALUE (s));
-      return;
-    }
-
-  sigtramp_address = SYMBOL_VALUE (s);
-  sigtramp_end = sigtramp_address + 0x88;	/* black magic */
-
-  /* But what symtab does it live in ? */
-  st = find_pc_symtab (SYMBOL_VALUE (s));
-
-  /*
-   * Ok, there goes the fix: turn it into a procedure, with all the
-   * needed info.  Note we make it a nested procedure of sigvec,
-   * which is the way the (assembly) code is actually written.
-   */
-  SYMBOL_DOMAIN (s) = VAR_DOMAIN;
-  SYMBOL_CLASS (s) = LOC_BLOCK;
-  SYMBOL_TYPE (s) = init_type (TYPE_CODE_FUNC, 4, 0, (char *) NULL,
-			       st->objfile);
-  TYPE_TARGET_TYPE (SYMBOL_TYPE (s)) = mdebug_type_void;
-
-  /* Need a block to allocate MIPS_EFI_SYMBOL_NAME in */
-  b = new_block (NON_FUNCTION_BLOCK);
-  SYMBOL_BLOCK_VALUE (s) = b;
-  BLOCK_START (b) = sigtramp_address;
-  BLOCK_END (b) = sigtramp_end;
-  BLOCK_FUNCTION (b) = s;
-  BLOCK_SUPERBLOCK (b) = BLOCK_SUPERBLOCK (b0);
-  add_block (b, st);
-  sort_blocks (st);
-
-  /* Make a MIPS_EFI_SYMBOL_NAME entry for it */
-  {
-    struct mips_extra_func_info *e =
-    ((struct mips_extra_func_info *)
-     xzalloc (sizeof (struct mips_extra_func_info)));
-
-    e->numargs = 0;		/* the kernel thinks otherwise */
-    e->pdr.frameoffset = 32;
-    e->pdr.framereg = SP_REGNUM;
-    /* Note that setting pcreg is no longer strictly necessary as
-       mips_frame_saved_pc is now aware of signal handler frames.  */
-    e->pdr.pcreg = PC_REGNUM;
-    e->pdr.regmask = -2;
-    /* Offset to saved r31, in the sigtramp case the saved registers
-       are above the frame in the sigcontext.
-       We have 4 alignment bytes, 12 bytes for onstack, mask and pc,
-       32 * 4 bytes for the general registers, 12 bytes for mdhi, mdlo, ownedfp
-       and 32 * 4 bytes for the floating point registers.  */
-    e->pdr.regoffset = 4 + 12 + 31 * 4;
-    e->pdr.fregmask = -1;
-    /* Offset to saved f30 (first saved *double* register).  */
-    e->pdr.fregoffset = 4 + 12 + 32 * 4 + 12 + 30 * 4;
-    e->pdr.isym = (long) s;
-    e->pdr.adr = sigtramp_address;
-
-    current_objfile = st->objfile;	/* Keep new_symbol happy */
-    s = new_symbol (MIPS_EFI_SYMBOL_NAME);
-    SYMBOL_VALUE (s) = (long) e;
-    SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
-    SYMBOL_CLASS (s) = LOC_CONST;
-    SYMBOL_TYPE (s) = mdebug_type_void;
-    current_objfile = NULL;
-  }
-
-  dict_add_symbol (BLOCK_DICT (b), s);
-}
-
-#endif /* TM_MIPS_H */
 
 void
 _initialize_mdebugread (void)
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.292
diff -p -u -r1.292 mips-tdep.c
--- mips-tdep.c	30 Apr 2004 00:43:09 -0000	1.292
+++ mips-tdep.c	1 May 2004 00:32:00 -0000
@@ -4841,16 +4841,6 @@ mips_skip_prologue (CORE_ADDR pc)
     return mips32_skip_prologue (pc);
 }
 
-/* Exported procedure: Is PC in the signal trampoline code */
-
-static int
-mips_pc_in_sigtramp (CORE_ADDR pc, char *ignore)
-{
-  if (sigtramp_address == 0)
-    fixup_sigtramp ();
-  return (pc >= sigtramp_address && pc < sigtramp_end);
-}
-
 /* Root of all "set mips "/"show mips " commands. This will eventually be
    used for all MIPS-specific commands.  */
 
@@ -5781,7 +5771,6 @@ mips_gdbarch_init (struct gdbarch_info i
   set_gdbarch_register_type (gdbarch, mips_register_type);
 
   set_gdbarch_print_registers_info (gdbarch, mips_print_registers_info);
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, mips_pc_in_sigtramp);
 
   set_gdbarch_print_insn (gdbarch, gdb_print_insn_mips);
 
Index: mipsread.c
===================================================================
RCS file: /cvs/src/src/gdb/mipsread.c,v
retrieving revision 1.15
diff -p -u -r1.15 mipsread.c
--- mipsread.c	14 Feb 2004 15:46:33 -0000	1.15
+++ mipsread.c	1 May 2004 00:32:00 -0000
@@ -59,12 +59,9 @@ read_alphacoff_dynamic_symtab (struct se
    symbol file is specified (not just adding some symbols from another
    file, e.g. a shared library).  */
 
-extern CORE_ADDR sigtramp_address;
-
 static void
 mipscoff_new_init (struct objfile *ignore)
 {
-  sigtramp_address = 0;
   stabsread_new_init ();
   buildsym_new_init ();
 }
Index: config/mips/tm-mips.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-mips.h,v
retrieving revision 1.58
diff -p -u -r1.58 tm-mips.h
--- config/mips/tm-mips.h	16 Nov 2003 22:46:49 -0000	1.58
+++ config/mips/tm-mips.h	1 May 2004 00:32:00 -0000
@@ -99,10 +99,6 @@ typedef struct mips_extra_func_info
 #define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv)
 extern struct frame_info *setup_arbitrary_frame (int, CORE_ADDR *);
 
-/* These are defined in mdebugread.c and are used in mips-tdep.c  */
-extern CORE_ADDR sigtramp_address, sigtramp_end;
-extern void fixup_sigtramp (void);
-
 /* Functions for dealing with MIPS16 call and return stubs.  */
 #define IGNORE_HELPER_CALL(pc)			mips_ignore_helper (pc)
 extern int mips_ignore_helper (CORE_ADDR pc);

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