Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Markus Deuling <deuling@de.ibm.com>
To: GDB Patches <gdb-patches@sourceware.org>,
	        Ulrich Weigand <uweigand@de.ibm.com>
Subject: [patch] Remove all current_gdbarch's in mn10300
Date: Fri, 11 Jan 2008 16:54:00 -0000	[thread overview]
Message-ID: <47879ECA.4050002@de.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 446 bytes --]

Hi,

this patch removes the last occurences of current_gdbarch in mn10300 target. Tested by building mn1030 target.

Ok to commit ?

ChangeLog:

	* mn10300-tdep.h (AM33_MODE): Add gdbarch as parameter.
	* mn10300-tdep.c (set_reg_offsets, mn10300_analyze_prologue): Use
	get_frame_arch to get at the current_architecture. Update AM33_MODE
	call.


Regards,
Markus



-- 
  Markus Deuling
  GNU Toolchain for Linux on Cell BE
  deuling@de.ibm.com


[-- Attachment #2: diff-mn10300 --]
[-- Type: text/plain, Size: 1795 bytes --]

diff -urpN src/gdb/mn10300-tdep.c dev/gdb/mn10300-tdep.c
--- src/gdb/mn10300-tdep.c	2008-01-11 15:42:53.000000000 +0100
+++ dev/gdb/mn10300-tdep.c	2008-01-11 17:49:02.000000000 +0100
@@ -307,12 +307,14 @@ set_reg_offsets (struct frame_info *fi, 
 		  int stack_extra_size,
 		  int frame_in_fp)
 {
+  struct gdbarch *gdbarch;
   struct trad_frame_cache *cache;
   int offset = 0;
   CORE_ADDR base;
 
   if (fi == NULL || this_cache == NULL)
     return;
+  gdbarch = get_frame_arch (fi);
 
   cache = mn10300_frame_unwind_cache (fi, this_cache);
   if (cache == NULL)
@@ -329,7 +331,7 @@ set_reg_offsets (struct frame_info *fi, 
 
   trad_frame_set_this_base (cache, base);
 
-  if (AM33_MODE == 2)
+  if (AM33_MODE (gdbarch)== 2)
     {
       /* If bit N is set in fpregmask, fsN is saved on the stack.
 	 The floating point registers are saved in ascending order.
@@ -385,7 +387,7 @@ set_reg_offsets (struct frame_info *fi, 
       trad_frame_set_reg_addr (cache, E_D2_REGNUM, base + offset);
       offset += 4;
     }
-  if (AM33_MODE)
+  if (AM33_MODE (gdbarch))
     {
       if (movm_args & movm_exother_bit)
         {
@@ -604,7 +606,7 @@ mn10300_analyze_prologue (struct frame_i
 	goto finish_prologue;
     }
 
-  if (AM33_MODE == 2)
+  if (AM33_MODE (get_frame_arch (fi))== 2)
     {
       /* Determine if any floating point registers are to be saved.
 	 Look for one of the following three prologue formats:
diff -urpN src/gdb/mn10300-tdep.h dev/gdb/mn10300-tdep.h
--- src/gdb/mn10300-tdep.h	2008-01-01 23:53:12.000000000 +0100
+++ dev/gdb/mn10300-tdep.h	2008-01-11 17:47:42.000000000 +0100
@@ -77,4 +77,4 @@ struct gdbarch_tdep
   int am33_mode;
 };
 
-#define AM33_MODE (gdbarch_tdep (current_gdbarch)->am33_mode)
+#define AM33_MODE(gdbarch) (gdbarch_tdep (gdbarch)->am33_mode)

             reply	other threads:[~2008-01-11 16:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-11 16:54 Markus Deuling [this message]
2008-01-14 14:10 ` Ulrich Weigand
2008-01-15  5:07   ` Markus Deuling
2008-01-15 20:38     ` Ulrich Weigand
2008-01-16  4:58       ` Markus Deuling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47879ECA.4050002@de.ibm.com \
    --to=deuling@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox