* dummy-frame.c (deprecated_pc_in_call_dummy): Add GDBARCH parameter,
authorUlrich Weigand <uweigand@de.ibm.com>
Wed, 17 Jun 2009 18:43:24 +0000 (18:43 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Wed, 17 Jun 2009 18:43:24 +0000 (18:43 +0000)
use it instead of current_gdbarch.
* frame.h (deprecated_pc_in_call_dummy): Add GDBARCH parameter.
* arm-tdep.c (arm_skip_prologue): Pass architecture to
deprecated_pc_in_call_dummy.

* symtab.c (skip_prologue_using_sal): Add GDBARCH parameter.
Use it instead of current_gdbarch.
* symtab.h (skip_prologue_using_sal): Add GDBARCH parameter.
* breakpoint.c (expand_line_sal_maybe): Pass architecture to
skip_prologue_using_sal.
* arm-tdep.c (skip_prologue_using_sal): Likewise.
* lm32-tdep.c (lm32_skip_prologue): Likewise.
* m32-tdep.c (m32c_skip_prologue): Likewise.
* mips-tdep.c (mips_skip_prologue): Likewise.
* moxie-tdep.c (moxie_skip_prologue): Likewise.
* mt-tdep.c (mt_frame_unwind_cache): Likewise.
* rs6000-tdep.c (rs6000_skip_prologue): Likewise.
* frv-tdep.c (frv_analyze_prologue): Add GDBARCH parameter, pass
it to skip_prologue_using_sal.  Update call sites ...
(frv_skip_prologue, frv_frame_unwind_cache): ... here.

* mn10300-tdep.c (struct mn10300_prologue): Add GDBARCH member.
(check_for_saved): Use it instead of current_gdbarch.
(mn10300_analyze_prologue): Set it.

* value.c (using_struct_return): Add GDBARCH parameter.  Use it
instead of current_gdbarch.
* value.h (using_struct_return): Add GDBARCH parameter.
* eval.c (evaluate_subexp_standard): Pass architecture to
using_struct_return.
* infcall.c (call_function_by_hand): Likewise.
* stack.c (return_command): Likewise.
* sparc-tdep.c (sparc32_push_dummy_code): Likewise.

* symtab.c (in_prologue): Add GDBARCH parameter.  Use it instead of
current_gdbarch.
* symtab.h (in_prologue): Add GDBARCH parameter.
* infrun.c (handle_inferior_event): Pass architecture to in_prologue.

* eval.c (evaluate_subexp_standard): Use expression architecture
instead of current_gdbarch.

* c-lang.c (evaluate_subexp_c): Use expression architecture and
language instead of current_gdbarch and current_language.

* printcmd.c (do_one_display): Use expression architecture instead
of current_gdbarch.

* infcmd.c (print_return_value): Use architecture of stop_regcache
instead of current_gdbarch.
(print_vector_info, print_float_info): Remove GDBARCH argument,
use frame architecture instead.
(vector_info, float_info): Update calls.

* objc-lang.c (objc_skip_trampoline): Use frame architecture
instead of current_gdbarch.

* parse.c (write_dollar_variable): Use parse architecture instead
of current_gdbarch.

* source.c (line_info): Use objfile architecture instead of
current_gdbarch.

* symtab.c (find_function_start_sal): Use gdbarch instead of
current_gdbarch.
(print_msymbol_info): Use objfile architecture instead of
current_gdbarch.

* valops.c (value_assign): Use frame architecture instead of
current_gdbarch.

29 files changed:
gdb/ChangeLog
gdb/arm-tdep.c
gdb/breakpoint.c
gdb/c-lang.c
gdb/dummy-frame.c
gdb/eval.c
gdb/frame.h
gdb/frv-tdep.c
gdb/infcall.c
gdb/infcmd.c
gdb/infrun.c
gdb/lm32-tdep.c
gdb/m32c-tdep.c
gdb/mips-tdep.c
gdb/mn10300-tdep.c
gdb/moxie-tdep.c
gdb/mt-tdep.c
gdb/objc-lang.c
gdb/parse.c
gdb/printcmd.c
gdb/rs6000-tdep.c
gdb/source.c
gdb/sparc-tdep.c
gdb/stack.c
gdb/symtab.c
gdb/symtab.h
gdb/valops.c
gdb/value.c
gdb/value.h

index fdb4541d854cbddd35dc01056a295dd2eadbc370..38c8afe54be29746dd13c7167548b2540938f4e2 100644 (file)
@@ -1,3 +1,77 @@
+2009-06-17  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * dummy-frame.c (deprecated_pc_in_call_dummy): Add GDBARCH parameter,
+       use it instead of current_gdbarch.
+       * frame.h (deprecated_pc_in_call_dummy): Add GDBARCH parameter.
+       * arm-tdep.c (arm_skip_prologue): Pass architecture to
+       deprecated_pc_in_call_dummy.
+
+       * symtab.c (skip_prologue_using_sal): Add GDBARCH parameter.
+       Use it instead of current_gdbarch.
+       * symtab.h (skip_prologue_using_sal): Add GDBARCH parameter.
+       * breakpoint.c (expand_line_sal_maybe): Pass architecture to
+       skip_prologue_using_sal.
+       * arm-tdep.c (skip_prologue_using_sal): Likewise.
+       * lm32-tdep.c (lm32_skip_prologue): Likewise.
+       * m32-tdep.c (m32c_skip_prologue): Likewise.
+       * mips-tdep.c (mips_skip_prologue): Likewise.
+       * moxie-tdep.c (moxie_skip_prologue): Likewise.
+       * mt-tdep.c (mt_frame_unwind_cache): Likewise.
+       * rs6000-tdep.c (rs6000_skip_prologue): Likewise.
+       * frv-tdep.c (frv_analyze_prologue): Add GDBARCH parameter, pass
+       it to skip_prologue_using_sal.  Update call sites ...
+       (frv_skip_prologue, frv_frame_unwind_cache): ... here.
+
+       * mn10300-tdep.c (struct mn10300_prologue): Add GDBARCH member.
+       (check_for_saved): Use it instead of current_gdbarch.
+       (mn10300_analyze_prologue): Set it.
+
+       * value.c (using_struct_return): Add GDBARCH parameter.  Use it
+       instead of current_gdbarch.
+       * value.h (using_struct_return): Add GDBARCH parameter.
+       * eval.c (evaluate_subexp_standard): Pass architecture to
+       using_struct_return.
+       * infcall.c (call_function_by_hand): Likewise.
+       * stack.c (return_command): Likewise.
+       * sparc-tdep.c (sparc32_push_dummy_code): Likewise.
+
+       * symtab.c (in_prologue): Add GDBARCH parameter.  Use it instead of
+       current_gdbarch.
+       * symtab.h (in_prologue): Add GDBARCH parameter.
+       * infrun.c (handle_inferior_event): Pass architecture to in_prologue.
+
+       * eval.c (evaluate_subexp_standard): Use expression architecture
+       instead of current_gdbarch.
+
+       * c-lang.c (evaluate_subexp_c): Use expression architecture and
+       language instead of current_gdbarch and current_language.
+
+       * printcmd.c (do_one_display): Use expression architecture instead
+       of current_gdbarch.
+
+       * infcmd.c (print_return_value): Use architecture of stop_regcache
+       instead of current_gdbarch.
+       (print_vector_info, print_float_info): Remove GDBARCH argument,
+       use frame architecture instead.
+       (vector_info, float_info): Update calls.
+
+       * objc-lang.c (objc_skip_trampoline): Use frame architecture
+       instead of current_gdbarch.
+
+       * parse.c (write_dollar_variable): Use parse architecture instead
+       of current_gdbarch.
+
+       * source.c (line_info): Use objfile architecture instead of
+       current_gdbarch.
+
+       * symtab.c (find_function_start_sal): Use gdbarch instead of
+       current_gdbarch.
+       (print_msymbol_info): Use objfile architecture instead of
+       current_gdbarch.
+
+       * valops.c (value_assign): Use frame architecture instead of
+       current_gdbarch.
+
 2009-06-17  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * buildsym.c (record_line): Remove call to gdbarch_addr_bits_remove.
index 933a2242fead7f57f9272301ac9d8751e83078cc..9ea5a0605bbd55a0d47896cedfc7e19c52eb557f 100644 (file)
@@ -539,7 +539,7 @@ arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
   struct symtab_and_line sal;
 
   /* If we're in a dummy frame, don't even try to skip the prologue.  */
-  if (deprecated_pc_in_call_dummy (pc))
+  if (deprecated_pc_in_call_dummy (gdbarch, pc))
     return pc;
 
   /* See if we can determine the end of the prologue via the symbol table.
@@ -547,7 +547,8 @@ arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
      is greater.  */
   if (find_pc_partial_function (pc, NULL, &func_addr, NULL))
     {
-      CORE_ADDR post_prologue_pc = skip_prologue_using_sal (func_addr);
+      CORE_ADDR post_prologue_pc
+       = skip_prologue_using_sal (gdbarch, func_addr);
       if (post_prologue_pc != 0)
        return max (pc, post_prologue_pc);
     }
@@ -559,7 +560,7 @@ arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
      information.  If the debug information could not be used to provide
      that bound, then use an arbitrary large number as the upper bound.  */
   /* Like arm_scan_prologue, stop no later than pc + 64. */
-  limit_pc = skip_prologue_using_sal (pc);
+  limit_pc = skip_prologue_using_sal (gdbarch, pc);
   if (limit_pc == 0)
     limit_pc = pc + 64;          /* Magic.  */
 
index 8732f2efbd82cd22e4c73aee23b33427d3e3e4c8..99909e75096b2c3841ce0cd3769b7c46b454aa24 100644 (file)
@@ -5420,8 +5420,18 @@ expand_line_sal_maybe (struct symtab_and_line sal)
                  if (sym)
                    expanded.sals[i] = find_function_start_sal (sym, 1);
                  else
-                   expanded.sals[i].pc 
-                     = gdbarch_skip_prologue (current_gdbarch, pc);
+                   {
+                     /* Since find_pc_partial_function returned true,
+                        we should really always find the section here.  */
+                     struct obj_section *section = find_pc_section (pc);
+                     if (section)
+                       {
+                         struct gdbarch *gdbarch
+                           = get_objfile_arch (section->objfile);
+                         expanded.sals[i].pc
+                           = gdbarch_skip_prologue (gdbarch, pc);
+                       }
+                   }
                }
            }
        }
index b605d3e8ea3109ce311a3bf35ea992cab3352737..0d3b50a119b854314893b70df968b47c9a15eb0f 100644 (file)
@@ -904,8 +904,8 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp,
        switch (dest_type & ~C_CHAR)
          {
          case C_STRING:
-           type = language_string_char_type (current_language,
-                                             current_gdbarch);
+           type = language_string_char_type (exp->language_defn,
+                                             exp->gdbarch);
            break;
          case C_WIDE_STRING:
            type = lookup_typename ("wchar_t", NULL, 0);
index 6e63686c111dd601284fe66cca94e573c2225f2e..90eb43100abd5bc936aa797e2b8c8365c4bd88ae 100644 (file)
@@ -66,7 +66,7 @@ static struct dummy_frame *dummy_frame_stack = NULL;
    NOTE: cagney/2004-08-02: Code should not need to call this.  */
 
 int
-deprecated_pc_in_call_dummy (CORE_ADDR pc)
+deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   struct dummy_frame *dummyframe;
   for (dummyframe = dummy_frame_stack;
@@ -75,7 +75,7 @@ deprecated_pc_in_call_dummy (CORE_ADDR pc)
     {
       if ((pc >= dummyframe->id.code_addr)
          && (pc <= dummyframe->id.code_addr
-                   + gdbarch_decr_pc_after_break (current_gdbarch)))
+                   + gdbarch_decr_pc_after_break (gdbarch)))
        return 1;
     }
   return 0;
index ec5b0911e43cb084c76e64939a2929a49d234ffb..e64d4bf52f9da9e8efad1100f8cb880666a1e8ab 100644 (file)
@@ -754,7 +754,7 @@ evaluate_subexp_standard (struct type *expect_type,
        struct value *val;
 
        (*pos) += 3 + BYTES_TO_EXP_ELEM (exp->elts[pc + 1].longconst + 1);
-       regno = user_reg_map_name_to_regnum (current_gdbarch,
+       regno = user_reg_map_name_to_regnum (exp->gdbarch,
                                             name, strlen (name));
        if (regno == -1)
          error (_("Register $%s not available."), name);
@@ -765,9 +765,9 @@ evaluate_subexp_standard (struct type *expect_type,
            So for these registers, we fetch the register value regardless
            of the evaluation mode.  */
        if (noside == EVAL_AVOID_SIDE_EFFECTS
-           && regno < gdbarch_num_regs (current_gdbarch)
-              + gdbarch_num_pseudo_regs (current_gdbarch))
-         val = value_zero (register_type (current_gdbarch, regno), not_lval);
+           && regno < gdbarch_num_regs (exp->gdbarch)
+                       + gdbarch_num_pseudo_regs (exp->gdbarch))
+         val = value_zero (register_type (exp->gdbarch, regno), not_lval);
        else
          val = value_of_register (regno, get_selected_frame (NULL));
        if (val == NULL)
@@ -1185,11 +1185,12 @@ evaluate_subexp_standard (struct type *expect_type,
                  val_type = expect_type;
              }
 
-           struct_return = using_struct_return (value_type (method), val_type);
+           struct_return = using_struct_return (exp->gdbarch,
+                                                value_type (method), val_type);
          }
        else if (expect_type != NULL)
          {
-           struct_return = using_struct_return (NULL,
+           struct_return = using_struct_return (exp->gdbarch, NULL,
                                                 check_typedef (expect_type));
          }
        
index 224aec9a03591fb0d5717c60329d817a03ab6389..18a62a1ade337cfc76757acedca68bcd245f9a3f 100644 (file)
@@ -598,7 +598,7 @@ extern void print_frame_info (struct frame_info *, int print_level,
 
 extern struct frame_info *block_innermost_frame (struct block *);
 
-extern int deprecated_pc_in_call_dummy (CORE_ADDR pc);
+extern int deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc);
 
 /* FIXME: cagney/2003-02-02: Should be deprecated or replaced with a
    function called get_frame_register_p().  This slightly weird (and
index 452f70cd3ab9536a959693938f723721fecc166e..cf48dc66f7fed2978ba8c7b1ac857e9c9585108b 100644 (file)
@@ -510,7 +510,8 @@ is_argument_reg (int reg)
    arguments in any frame but the top, you'll need to do this serious
    prologue analysis.  */
 static CORE_ADDR
-frv_analyze_prologue (CORE_ADDR pc, struct frame_info *this_frame,
+frv_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
+                     struct frame_info *this_frame,
                       struct frv_unwind_cache *info)
 {
   /* When writing out instruction bitpatterns, we use the following
@@ -568,7 +569,7 @@ frv_analyze_prologue (CORE_ADDR pc, struct frame_info *this_frame,
 
   /* Try to compute an upper limit (on how far to scan) based on the
      line number info.  */
-  lim_pc = skip_prologue_using_sal (pc);
+  lim_pc = skip_prologue_using_sal (gdbarch, pc);
   /* If there's no line number info, lim_pc will be 0.  In that case,
      set the limit to be 100 instructions away from pc.  Hopefully, this
      will be far enough away to account for the entire prologue.  Don't
@@ -993,7 +994,7 @@ frv_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
      If we didn't find a real source location past that, then
      do a full analysis of the prologue.  */
   if (new_pc < pc + 20)
-    new_pc = frv_analyze_prologue (pc, 0, 0);
+    new_pc = frv_analyze_prologue (gdbarch, pc, 0, 0);
 
   return new_pc;
 }
@@ -1095,7 +1096,8 @@ frv_frame_unwind_cache (struct frame_info *this_frame,
   info->saved_regs = trad_frame_alloc_saved_regs (this_frame);
 
   /* Prologue analysis does the rest...  */
-  frv_analyze_prologue (get_frame_func (this_frame), this_frame, info);
+  frv_analyze_prologue (gdbarch,
+                       get_frame_func (this_frame), this_frame, info);
 
   return info;
 }
index 416219e038161af89bbbac811e26b550dba56dc6..584fdeb0a06ce682c08acac09ad0bbf9144431ee 100644 (file)
@@ -566,7 +566,8 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
     }
   else
     {
-      struct_return = using_struct_return (value_type (function), values_type);
+      struct_return = using_struct_return (gdbarch,
+                                          value_type (function), values_type);
       target_values_type = values_type;
     }
 
index 61407778e123a016a25c88ba1d4d2dff8258cbea..a8ab1f0faf5511deed07c5e675287bc1d923adb1 100644 (file)
@@ -1291,7 +1291,7 @@ advance_command (char *arg, int from_tty)
 static void
 print_return_value (struct type *func_type, struct type *value_type)
 {
-  struct gdbarch *gdbarch = current_gdbarch;
+  struct gdbarch *gdbarch = get_regcache_arch (stop_registers);
   struct cleanup *old_chain;
   struct ui_stream *stb;
   struct value *value;
@@ -2012,9 +2012,11 @@ nofp_registers_info (char *addr_exp, int from_tty)
 }
 
 static void
-print_vector_info (struct gdbarch *gdbarch, struct ui_file *file,
+print_vector_info (struct ui_file *file,
                   struct frame_info *frame, const char *args)
 {
+  struct gdbarch *gdbarch = get_frame_arch (frame);
+
   if (gdbarch_print_vector_info_p (gdbarch))
     gdbarch_print_vector_info (gdbarch, file, frame, args);
   else
@@ -2044,8 +2046,7 @@ vector_info (char *args, int from_tty)
   if (!target_has_registers)
     error (_("The program has no registers now."));
 
-  print_vector_info (current_gdbarch, gdb_stdout,
-                    get_selected_frame (NULL), args);
+  print_vector_info (gdb_stdout, get_selected_frame (NULL), args);
 }
 \f
 /* Kill the inferior process.  Make us have no inferior.  */
@@ -2528,9 +2529,11 @@ interrupt_target_command (char *args, int from_tty)
 }
 
 static void
-print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
+print_float_info (struct ui_file *file,
                  struct frame_info *frame, const char *args)
 {
+  struct gdbarch *gdbarch = get_frame_arch (frame);
+
   if (gdbarch_print_float_info_p (gdbarch))
     gdbarch_print_float_info (gdbarch, file, frame, args);
   else
@@ -2561,8 +2564,7 @@ float_info (char *args, int from_tty)
   if (!target_has_registers)
     error (_("The program has no registers now."));
 
-  print_float_info (current_gdbarch, gdb_stdout, 
-                   get_selected_frame (NULL), args);
+  print_float_info (gdb_stdout, get_selected_frame (NULL), args);
 }
 \f
 static void
index da2dc72a38622ef363aba0256f88008dcb0a0f79..3eaf89e1b617f3e7c80cee53f42e6996999fc062 100644 (file)
@@ -3723,7 +3723,7 @@ infrun: not switching back to stepped thread, it has vanished\n");
 
       if ((ecs->event_thread->step_over_calls == STEP_OVER_NONE)
          || ((ecs->event_thread->step_range_end == 1)
-             && in_prologue (ecs->event_thread->prev_pc,
+             && in_prologue (gdbarch, ecs->event_thread->prev_pc,
                              ecs->stop_func_start)))
        {
          /* I presume that step_over_calls is only 0 when we're
index d36c41733af01d04cd48a206005b9bc7b448d9bc..def139d6019af21c2f43cb83a587a31b1cb6a6dd 100644 (file)
@@ -194,7 +194,8 @@ lm32_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
      is greater.  */
   if (find_pc_partial_function (pc, NULL, &func_addr, NULL))
     {
-      CORE_ADDR post_prologue_pc = skip_prologue_using_sal (func_addr);
+      CORE_ADDR post_prologue_pc
+       = skip_prologue_using_sal (gdbarch, func_addr);
       if (post_prologue_pc != 0)
        return max (pc, post_prologue_pc);
     }
@@ -205,7 +206,7 @@ lm32_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
   /* Find an upper limit on the function prologue using the debug
      information.  If the debug information could not be used to provide
      that bound, then use an arbitrary large number as the upper bound.  */
-  limit_pc = skip_prologue_using_sal (pc);
+  limit_pc = skip_prologue_using_sal (gdbarch, pc);
   if (limit_pc == 0)
     limit_pc = pc + 100;       /* Magic.  */
 
index 10367b38b029f3b677d9225d549702e5d15a52b1..a932d14d6bd73640b9ff8d662acf970affbf49b2 100644 (file)
@@ -1815,7 +1815,7 @@ m32c_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
   /* Find end by prologue analysis.  */
   m32c_analyze_prologue (gdbarch, ip, func_end, &p);
   /* Find end by line info.  */
-  sal_end = skip_prologue_using_sal (ip);
+  sal_end = skip_prologue_using_sal (gdbarch, ip);
   /* Return whichever is lower.  */
   if (sal_end != 0 && sal_end != ip && sal_end < p.prologue_end)
     return sal_end;
index e6aa8ffc34dff891530f066d05ae2978f1668653..ccd20699d4969fcc87352266c27cd111bf366834 100644 (file)
@@ -4695,7 +4695,8 @@ mips_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
      is greater.  */
   if (find_pc_partial_function (pc, NULL, &func_addr, NULL))
     {
-      CORE_ADDR post_prologue_pc = skip_prologue_using_sal (func_addr);
+      CORE_ADDR post_prologue_pc
+       = skip_prologue_using_sal (gdbarch, func_addr);
       if (post_prologue_pc != 0)
        return max (pc, post_prologue_pc);
     }
@@ -4706,7 +4707,7 @@ mips_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
   /* Find an upper limit on the function prologue using the debug
      information.  If the debug information could not be used to provide
      that bound, then use an arbitrary large number as the upper bound.  */
-  limit_pc = skip_prologue_using_sal (pc);
+  limit_pc = skip_prologue_using_sal (gdbarch, pc);
   if (limit_pc == 0)
     limit_pc = pc + 100;          /* Magic.  */
 
index d6322b146c8ecb648bd04909882a87778564ecb6..a110798752caa6daac50f4c067d2f57472a9b432 100644 (file)
@@ -47,6 +47,9 @@
 /* This structure holds the results of a prologue analysis.  */
 struct mn10300_prologue
 {
+  /* The architecture for which we generated this prologue info.  */
+  struct gdbarch *gdbarch;
+
   /* The offset from the frame base to the stack pointer --- always
      zero or negative.
 
@@ -371,7 +374,7 @@ check_for_saved (void *result_untyped, pv_t addr, CORE_ADDR size, pv_t value)
   if (value.kind == pvk_register
       && value.k == 0
       && pv_is_register (addr, E_SP_REGNUM)
-      && size == register_size (current_gdbarch, value.reg))
+      && size == register_size (result->gdbarch, value.reg))
     result->reg_offset[value.reg] = addr.k;
 }
 
@@ -393,6 +396,7 @@ mn10300_analyze_prologue (struct gdbarch *gdbarch,
   int am33_mode = AM33_MODE (gdbarch);
 
   memset (result, 0, sizeof (*result));
+  result->gdbarch = gdbarch;
 
   for (rn = 0; rn < MN10300_MAX_NUM_REGS; rn++)
     {
index 884416ce49fb791d36f922d9166a30bbd5ae2ccb..23b573eb556821b792858d18467a49af122a39c1 100644 (file)
@@ -204,7 +204,8 @@ moxie_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
      is greater.  */
   if (find_pc_partial_function (pc, &func_name, &func_addr, &func_end))
     {
-      CORE_ADDR post_prologue_pc = skip_prologue_using_sal (func_addr);
+      CORE_ADDR post_prologue_pc
+       = skip_prologue_using_sal (gdbarch, func_addr);
       if (post_prologue_pc != 0)
        return max (pc, post_prologue_pc);
       else
index 28f8b46fa1d3abc48f90de8e8d45d382cd9d955d..04029a425aed64d674a645ff1fdf96a966347830 100644 (file)
@@ -906,7 +906,7 @@ mt_frame_unwind_cache (struct frame_info *this_frame,
     return info;
 
   end_addr = get_frame_pc (this_frame);
-  prologue_end_addr = skip_prologue_using_sal (start_addr);
+  prologue_end_addr = skip_prologue_using_sal (gdbarch, start_addr);
   if (end_addr == 0)
   for (next_addr = start_addr; next_addr < end_addr; next_addr += 4)
     {
index f1f33efe1ab4bdf27c1308fbab1f4e4445c46fa3..cd4c1977c4e977aaefaeef803a3097d99982fdde 100644 (file)
@@ -442,11 +442,11 @@ objc_printstr (struct ui_file *stream, struct type *type,
 static CORE_ADDR 
 objc_skip_trampoline (struct frame_info *frame, CORE_ADDR stop_pc)
 {
+  struct gdbarch *gdbarch = get_frame_arch (frame);
   CORE_ADDR real_stop_pc;
   CORE_ADDR method_stop_pc;
   
-  real_stop_pc = gdbarch_skip_trampoline_code
-                  (current_gdbarch, frame, stop_pc);
+  real_stop_pc = gdbarch_skip_trampoline_code (gdbarch, frame, stop_pc);
 
   if (real_stop_pc != 0)
     find_objc_msgcall (real_stop_pc, &method_stop_pc);
@@ -456,7 +456,7 @@ objc_skip_trampoline (struct frame_info *frame, CORE_ADDR stop_pc)
   if (method_stop_pc)
     {
       real_stop_pc = gdbarch_skip_trampoline_code
-                      (current_gdbarch, frame, method_stop_pc);
+                      (gdbarch, frame, method_stop_pc);
       if (real_stop_pc == 0)
        real_stop_pc = method_stop_pc;
     }
index 96dc1c5249c5356a14c3a1c26d3a02f1efcf99ad..5de3bc7202329dc600924ca821346db0f5ceb0e5 100644 (file)
@@ -597,7 +597,7 @@ write_dollar_variable (struct stoken str)
 
   /* Handle tokens that refer to machine registers:
      $ followed by a register name.  */
-  i = user_reg_map_name_to_regnum (current_gdbarch,
+  i = user_reg_map_name_to_regnum (parse_gdbarch,
                                   str.ptr + 1, str.length - 1);
   if (i >= 0)
     goto handle_register;
index 49ae9d1c81b9e0490f6be39229bdcbb46149536e..9678a7348b15238888cf5df18adf0d4ecac36ef9 100644 (file)
@@ -1616,7 +1616,7 @@ do_one_display (struct display *d)
       val = evaluate_expression (d->exp);
       addr = value_as_address (val);
       if (d->format.format == 'i')
-       addr = gdbarch_addr_bits_remove (current_gdbarch, addr);
+       addr = gdbarch_addr_bits_remove (d->exp->gdbarch, addr);
 
       annotate_display_value ();
 
index 926d0b6784718dac1334806ffb4ff3af17e52446..863cedbf9a33312f9f53b8561db125de51667fa1 100644 (file)
@@ -2080,7 +2080,8 @@ rs6000_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
      is greater.  */
   if (find_pc_partial_function (pc, NULL, &func_addr, NULL))
     {
-      CORE_ADDR post_prologue_pc = skip_prologue_using_sal (func_addr);
+      CORE_ADDR post_prologue_pc
+       = skip_prologue_using_sal (gdbarch, func_addr);
       if (post_prologue_pc != 0)
        return max (pc, post_prologue_pc);
     }
@@ -2091,7 +2092,7 @@ rs6000_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
   /* Find an upper limit on the function prologue using the debug
      information.  If the debug information could not be used to provide
      that bound, then use an arbitrary large number as the upper bound.  */
-  limit_pc = skip_prologue_using_sal (pc);
+  limit_pc = skip_prologue_using_sal (gdbarch, pc);
   if (limit_pc == 0)
     limit_pc = pc + 100;          /* Magic.  */
 
index e4766167b6dd8afc702286a6c8d555b87991d601..29194aa23496b6b4ebb7a7805566da6ad4d165c2 100644 (file)
@@ -1515,7 +1515,7 @@ line_info (char *arg, int from_tty)
            }
 
          /* x/i should display this line's code.  */
-         set_next_address (current_gdbarch, start_pc);
+         set_next_address (get_objfile_arch (sal.symtab->objfile), start_pc);
 
          /* Repeating "info line" should do the following line.  */
          last_line_listed = sal.line + 1;
index 8fab945056813f82127ff06a73da9280b2fa162a..543a39764f6feada92e1141f35fc78583f781942 100644 (file)
@@ -388,7 +388,7 @@ sparc32_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp,
   *bp_addr = sp - 4;
   *real_pc = funcaddr;
 
-  if (using_struct_return (NULL, value_type))
+  if (using_struct_return (gdbarch, NULL, value_type))
     {
       gdb_byte buf[4];
 
index a968cbfe6625b9a6cba69cf38bfd5451e35e896d..3a4cc7f40dcec745ce7831cfbf5f1396ed55c02a 100644 (file)
@@ -1823,12 +1823,14 @@ void
 return_command (char *retval_exp, int from_tty)
 {
   struct frame_info *thisframe;
+  struct gdbarch *gdbarch;
   struct symbol *thisfun;
   struct value *return_value = NULL;
   const char *query_prefix = "";
 
   thisframe = get_selected_frame ("No selected frame.");
   thisfun = get_frame_function (thisframe);
+  gdbarch = get_frame_arch (thisframe);
 
   /* Compute the return value.  If the computation triggers an error,
      let it bail.  If the return type can't be handled, set
@@ -1873,7 +1875,8 @@ return_command (char *retval_exp, int from_tty)
            occur.  */
        return_value = NULL;
       else if (thisfun != NULL
-              && using_struct_return (SYMBOL_TYPE (thisfun), return_type))
+              && using_struct_return (gdbarch,
+                                      SYMBOL_TYPE (thisfun), return_type))
        {
          query_prefix = "\
 The location at which to store the function's return value is unknown.\n\
index 3a82d33c35431db71109f9bf1a7bbf62bbffe417..ee138ff0ae3936026aab10f774d0ae032011da18 100644 (file)
@@ -2681,11 +2681,11 @@ find_function_start_sal (struct symbol *sym, int funfirstline)
      to `__main' in `main' between the prologue and before user
      code.  */
   if (funfirstline
-      && gdbarch_skip_main_prologue_p (current_gdbarch)
+      && gdbarch_skip_main_prologue_p (gdbarch)
       && SYMBOL_LINKAGE_NAME (sym)
       && strcmp (SYMBOL_LINKAGE_NAME (sym), "main") == 0)
     {
-      pc = gdbarch_skip_main_prologue (current_gdbarch, pc);
+      pc = gdbarch_skip_main_prologue (gdbarch, pc);
       /* Recalculate the line number (might not be N+1).  */
       sal = find_pc_sect_line (pc, SYMBOL_OBJ_SECTION (sym), 0);
     }
@@ -3399,9 +3399,10 @@ print_symbol_info (domain_enum kind, struct symtab *s, struct symbol *sym,
 static void
 print_msymbol_info (struct minimal_symbol *msymbol)
 {
+  struct gdbarch *gdbarch = get_objfile_arch (msymbol_objfile (msymbol));
   char *tmp;
 
-  if (gdbarch_addr_bit (current_gdbarch) <= 32)
+  if (gdbarch_addr_bit (gdbarch) <= 32)
     tmp = hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol)
                             & (CORE_ADDR) 0xffffffff,
                             8);
@@ -4237,7 +4238,7 @@ make_source_files_completion_list (char *text, char *word)
  */
 
 int
-in_prologue (CORE_ADDR pc, CORE_ADDR func_start)
+in_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR func_start)
 {
   struct symtab_and_line sal;
   CORE_ADDR func_addr, func_end;
@@ -4269,7 +4270,7 @@ in_prologue (CORE_ADDR pc, CORE_ADDR func_start)
       if (! func_start)
        return 1;               /* We *might* be in a prologue.  */
 
-      prologue_end = gdbarch_skip_prologue (current_gdbarch, func_start);
+      prologue_end = gdbarch_skip_prologue (gdbarch, func_start);
 
       return func_start <= pc && pc < prologue_end;
     }
@@ -4293,8 +4294,7 @@ in_prologue (CORE_ADDR pc, CORE_ADDR func_start)
       /* We don't have any good line number info, so use the minsym
         information, together with the architecture-specific prologue
         scanning code.  */
-      CORE_ADDR prologue_end = gdbarch_skip_prologue
-                                (current_gdbarch, func_addr);
+      CORE_ADDR prologue_end = gdbarch_skip_prologue (gdbarch, func_addr);
 
       return func_addr <= pc && pc < prologue_end;
     }
@@ -4321,7 +4321,7 @@ in_prologue (CORE_ADDR pc, CORE_ADDR func_start)
    found in both ia64 and ppc).  */
 
 CORE_ADDR
-skip_prologue_using_sal (CORE_ADDR func_addr)
+skip_prologue_using_sal (struct gdbarch *gdbarch, CORE_ADDR func_addr)
 {
   struct symtab_and_line prologue_sal;
   CORE_ADDR start_pc;
@@ -4330,7 +4330,7 @@ skip_prologue_using_sal (CORE_ADDR func_addr)
 
   /* Get an initial range for the function.  */
   find_pc_partial_function (func_addr, NULL, &start_pc, &end_pc);
-  start_pc += gdbarch_deprecated_function_start_offset (current_gdbarch);
+  start_pc += gdbarch_deprecated_function_start_offset (gdbarch);
 
   prologue_sal = find_pc_line (start_pc, 0);
   if (prologue_sal.line != 0)
index b126c16361e0741ba2b9c2e3789009dc08fcd9d9..ab06b1e86ef84c187f87d138eafe8b8bff6dcfd0 100644 (file)
@@ -1292,9 +1292,11 @@ extern enum language deduce_language_from_filename (char *);
 
 /* symtab.c */
 
-extern int in_prologue (CORE_ADDR pc, CORE_ADDR func_start);
+extern int in_prologue (struct gdbarch *gdbarch,
+                       CORE_ADDR pc, CORE_ADDR func_start);
 
-extern CORE_ADDR skip_prologue_using_sal (CORE_ADDR func_addr);
+extern CORE_ADDR skip_prologue_using_sal (struct gdbarch *gdbarch,
+                                         CORE_ADDR func_addr);
 
 extern struct symbol *fixup_symbol_section (struct symbol *,
                                            struct objfile *);
index 5530f553b9ff250a4e68b465ed0785dd7ab6422a..422821ab1e63f72a9433ff44634f130738c10782 100644 (file)
@@ -832,6 +832,7 @@ value_assign (struct value *toval, struct value *fromval)
     case lval_register:
       {
        struct frame_info *frame;
+       struct gdbarch *gdbarch;
        int value_reg;
 
        /* Figure out which frame this is in currently.  */
@@ -840,14 +841,14 @@ value_assign (struct value *toval, struct value *fromval)
 
        if (!frame)
          error (_("Value being assigned to is no longer active."));
-       
-       if (gdbarch_convert_register_p
-           (current_gdbarch, VALUE_REGNUM (toval), type))
+
+       gdbarch = get_frame_arch (frame);
+       if (gdbarch_convert_register_p (gdbarch, VALUE_REGNUM (toval), type))
          {
            /* If TOVAL is a special machine register requiring
               conversion of program values to a special raw
               format.  */
-           gdbarch_value_to_register (current_gdbarch, frame, 
+           gdbarch_value_to_register (gdbarch, frame,
                                       VALUE_REGNUM (toval), type,
                                       value_contents (fromval));
          }
index e9dfe6ab8646f6bb7619db72b75547049527f565..aec3b4b500e7272cc8b50f184632e8c54056d49b 100644 (file)
@@ -2138,7 +2138,8 @@ coerce_array (struct value *arg)
    address as a hidden first parameter).  */
 
 int
-using_struct_return (struct type *func_type, struct type *value_type)
+using_struct_return (struct gdbarch *gdbarch,
+                    struct type *func_type, struct type *value_type)
 {
   enum type_code code = TYPE_CODE (value_type);
 
@@ -2151,7 +2152,7 @@ using_struct_return (struct type *func_type, struct type *value_type)
     return 0;
 
   /* Probe the architecture for the return-value convention.  */
-  return (gdbarch_return_value (current_gdbarch, func_type, value_type,
+  return (gdbarch_return_value (gdbarch, func_type, value_type,
                                NULL, NULL, NULL)
          != RETURN_VALUE_REGISTER_CONVENTION);
 }
index fcff0ad4aa1f4e6b138d40a98d857c22e03d6e35..317d4ef8ce6bb21f1b13b190abb6f26c2b7f21f4 100644 (file)
@@ -482,7 +482,8 @@ extern int value_in (struct value *element, struct value *set);
 extern int value_bit_index (struct type *type, const gdb_byte *addr,
                            int index);
 
-extern int using_struct_return (struct type *func_type,
+extern int using_struct_return (struct gdbarch *gdbarch,
+                               struct type *func_type,
                                struct type *value_type);
 
 extern struct value *evaluate_expression (struct expression *exp);
This page took 0.060933 seconds and 4 git commands to generate.