]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2004-06-06 Randolph Chung <tausq@debian.org>
authorRandolph Chung <tausq@debian.org>
Mon, 7 Jun 2004 02:17:29 +0000 (02:17 +0000)
committerRandolph Chung <tausq@debian.org>
Mon, 7 Jun 2004 02:17:29 +0000 (02:17 +0000)
* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline)
(hppa_hpux_skip_trampoline_code): Don't cache symbol values.
* hppa-linux-tdep.c (hppa_linux_in_dyncall): Likewise.
* hppa-tdep.c (hppa_symbol_address): New function definition.
* hppa-tdep.h (hppa_symbol_address): New function declaration.

gdb/ChangeLog
gdb/hppa-hpux-tdep.c
gdb/hppa-linux-tdep.c
gdb/hppa-tdep.c
gdb/hppa-tdep.h

index 88f39daed9a80842393d950a709d30e92898acca..ba41a7a9dcd00000ef2621a82c40ab1f9a6a5ee0 100644 (file)
@@ -1,3 +1,11 @@
+2004-06-06  Randolph Chung  <tausq@debian.org>
+
+       * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline) 
+       (hppa_hpux_skip_trampoline_code): Don't cache symbol values.
+       * hppa-linux-tdep.c (hppa_linux_in_dyncall): Likewise.
+       * hppa-tdep.c (hppa_symbol_address): New function definition.
+       * hppa-tdep.h (hppa_symbol_address): New function declaration.
+
 2004-06-06  Randolph Chung  <tausq@debian.org>
 
        * hppa-tdep.h (struct value): Forward declaration.
index f8c141a4105b60f42d58428d30754ead32dd49a0..615f45de69f0f6def6c4f62b486fc12e7a3481fa 100644 (file)
@@ -61,32 +61,10 @@ hppa32_hpux_in_solib_call_trampoline (CORE_ADDR pc, char *name)
 {
   struct minimal_symbol *minsym;
   struct unwind_table_entry *u;
-  static CORE_ADDR dyncall = 0;
-  static CORE_ADDR sr4export = 0;
-
-  /* FIXME XXX - dyncall and sr4export must be initialized whenever we get a
-     new exec file */
 
   /* First see if PC is in one of the two C-library trampolines.  */
-  if (!dyncall)
-    {
-      minsym = lookup_minimal_symbol ("$$dyncall", NULL, NULL);
-      if (minsym)
-       dyncall = SYMBOL_VALUE_ADDRESS (minsym);
-      else
-       dyncall = -1;
-    }
-
-  if (!sr4export)
-    {
-      minsym = lookup_minimal_symbol ("_sr4export", NULL, NULL);
-      if (minsym)
-       sr4export = SYMBOL_VALUE_ADDRESS (minsym);
-      else
-       sr4export = -1;
-    }
-
-  if (pc == dyncall || pc == sr4export)
+  if (pc == hppa_symbol_address("$$dyncall") 
+      || pc == hppa_symbol_address("_sr4export"))
     return 1;
 
   minsym = lookup_minimal_symbol_by_pc (pc);
@@ -295,45 +273,12 @@ hppa_hpux_skip_trampoline_code (CORE_ADDR pc)
 {
   long orig_pc = pc;
   long prev_inst, curr_inst, loc;
-  static CORE_ADDR dyncall = 0;
-  static CORE_ADDR dyncall_external = 0;
-  static CORE_ADDR sr4export = 0;
   struct minimal_symbol *msym;
   struct unwind_table_entry *u;
 
-  /* FIXME XXX - dyncall and sr4export must be initialized whenever we get a
-     new exec file */
-
-  if (!dyncall)
-    {
-      msym = lookup_minimal_symbol ("$$dyncall", NULL, NULL);
-      if (msym)
-       dyncall = SYMBOL_VALUE_ADDRESS (msym);
-      else
-       dyncall = -1;
-    }
-
-  if (!dyncall_external)
-    {
-      msym = lookup_minimal_symbol ("$$dyncall_external", NULL, NULL);
-      if (msym)
-       dyncall_external = SYMBOL_VALUE_ADDRESS (msym);
-      else
-       dyncall_external = -1;
-    }
-
-  if (!sr4export)
-    {
-      msym = lookup_minimal_symbol ("_sr4export", NULL, NULL);
-      if (msym)
-       sr4export = SYMBOL_VALUE_ADDRESS (msym);
-      else
-       sr4export = -1;
-    }
-
   /* Addresses passed to dyncall may *NOT* be the actual address
      of the function.  So we may have to do something special.  */
-  if (pc == dyncall)
+  if (pc == hppa_symbol_address("$$dyncall"))
     {
       pc = (CORE_ADDR) read_register (22);
 
@@ -343,12 +288,12 @@ hppa_hpux_skip_trampoline_code (CORE_ADDR pc)
       if (pc & 0x2)
        pc = (CORE_ADDR) read_memory_integer (pc & ~0x3, TARGET_PTR_BIT / 8);
     }
-  if (pc == dyncall_external)
+  if (pc == hppa_symbol_address("$$dyncall_external"))
     {
       pc = (CORE_ADDR) read_register (22);
       pc = (CORE_ADDR) read_memory_integer (pc & ~0x3, TARGET_PTR_BIT / 8);
     }
-  else if (pc == sr4export)
+  else if (pc == hppa_symbol_address("_sr4export"))
     pc = (CORE_ADDR) (read_register (22));
 
   /* Get the unwind descriptor corresponding to PC, return zero
index 32c6068dbd9cd5d6737da407871715a83fbf47de..1998a0ac6bec631f934c154eee48124d18a2f57b 100644 (file)
@@ -164,21 +164,7 @@ insns_match_pattern (CORE_ADDR pc,
 static int
 hppa_linux_in_dyncall (CORE_ADDR pc)
 {
-  static CORE_ADDR dyncall = 0;
-
-  /* FIXME: if we switch exec files, dyncall should be reinitialized */
-  if (!dyncall)
-    {
-      struct minimal_symbol *minsym;
-
-      minsym = lookup_minimal_symbol ("$$dyncall", NULL, NULL);
-      if (minsym)
-       dyncall = SYMBOL_VALUE_ADDRESS (minsym);
-      else
-       dyncall = -1;
-    }
-
-  return pc == dyncall;
+  return pc == hppa_symbol_address("$$dyncall");
 }
 
 /* There are several kinds of "trampolines" that we need to deal with:
index a5b2f852c9e64d78a01cacfd72d49e1c442f56ab..8bad2437761db700fa9085a7ceb7fe2ea5a686bb 100644 (file)
@@ -262,6 +262,18 @@ hppa_extract_17 (unsigned word)
                      hppa_get_field (word, 11, 15) << 11 |
                      (word & 0x1) << 16, 17) << 2;
 }
+
+CORE_ADDR 
+hppa_symbol_address(const char *sym)
+{
+  struct minimal_symbol *minsym;
+
+  minsym = lookup_minimal_symbol (sym, NULL, NULL);
+  if (minsym)
+    return SYMBOL_VALUE_ADDRESS (minsym);
+  else
+    return (CORE_ADDR)-1;
+}
 \f
 
 /* Compare the start address for two unwind entries returning 1 if 
index 3f2235ddcd8dc59916e4871e7a807ae431631558..26a7556a68607ed4287821fa210ffab97d64c0bf 100644 (file)
@@ -194,6 +194,7 @@ int hppa_extract_21 (unsigned);
 int hppa_extract_14 (unsigned);
 int hppa_low_sign_extend (unsigned int, unsigned int);
 int hppa_sign_extend (unsigned int, unsigned int);
+CORE_ADDR hppa_symbol_address(const char *sym);
 
 void
 hppa_frame_prev_register_helper (struct frame_info *next_frame,