This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[rfc] [07/20] Get rid of current_gdbarch in avr-tdep.c
- From: Markus Deuling <deuling at de dot ibm dot com>
- To: GDB Patches <gdb-patches at sourceware dot org>
- Cc: Ulrich Weigand <uweigand at de dot ibm dot com>
- Date: Tue, 30 Oct 2007 10:54:28 +0100
- Subject: [rfc] [07/20] Get rid of current_gdbarch in avr-tdep.c
Hi,
this patch gets rid of some of the current_gdbarch's in avr-tdep.c
Is this ok to commit?
ChangeLog:
* avr-tdep.c (avr_frame_unwind_cache, avr_frame_prev_register): Use
get_frame_arch to get at the current architecture by frame_info.
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com
diff -urpN src/gdb/avr-tdep.c dev/gdb/avr-tdep.c
--- src/gdb/avr-tdep.c 2007-10-17 15:36:43.000000000 +0200
+++ dev/gdb/avr-tdep.c 2007-10-30 06:19:50.000000000 +0100
@@ -928,7 +928,7 @@ avr_frame_unwind_cache (struct frame_inf
/* Adjust all the saved registers so that they contain addresses and not
offsets. */
- for (i = 0; i < gdbarch_num_regs (current_gdbarch) - 1; i++)
+ for (i = 0; i < gdbarch_num_regs (get_frame_arch (next_frame)) - 1; i++)
if (info->saved_regs[i].addr)
{
info->saved_regs[i].addr = (info->prev_sp - info->saved_regs[i].addr);
@@ -1046,9 +1046,9 @@ avr_frame_prev_register (struct frame_in
buf[1] = tmp;
pc = (extract_unsigned_integer (buf, 2) * 2);
- store_unsigned_integer (bufferp,
- register_size (current_gdbarch, regnum),
- pc);
+ store_unsigned_integer
+ (bufferp, register_size (get_frame_arch (next_frame), regnum),
+ pc);
}
}
}