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>
Cc: Ulrich Weigand <uweigand@de.ibm.com>
Subject: [rfc] [11/15] Add gdbarch to register_name callback in mn10300-tdep.c
Date: Wed, 31 Oct 2007 12:59:00 -0000	[thread overview]
Message-ID: <47285CED.8050103@de.ibm.com> (raw)

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

Hi,

this patch adds gdbarch to register_name callback in mn10300-tdep.c. It also replaces some trivial occurences of current_gdbarch.
Tested by build with --target=mn10300

Is this ok to commit?

ChangeLog:

	* mn10300-tdep.c (mn10300_generic_register_name, am33_register_name)
	(am33_2_register_name): Add gdbarch parameter.
	(mn10300_frame_unwind_cache): Use get_frame_arch to get at the current
	architecture by frame_info.
	(mn10300_dump_tdep): Replace current_gdbarch by gdb

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







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

diff -urpN src/gdb/mn10300-tdep.c dev/gdb/mn10300-tdep.c
--- src/gdb/mn10300-tdep.c	2007-10-17 15:36:44.000000000 +0200
+++ dev/gdb/mn10300-tdep.c	2007-10-31 06:09:21.000000000 +0100
@@ -219,7 +219,7 @@ register_name (int reg, char **regs, lon
 }
 
 static const char *
-mn10300_generic_register_name (int reg)
+mn10300_generic_register_name (struct gdbarch *gdbarch, int reg)
 {
   static char *regs[] =
   { "d0", "d1", "d2", "d3", "a0", "a1", "a2", "a3",
@@ -232,7 +232,7 @@ mn10300_generic_register_name (int reg)
 
 
 static const char *
-am33_register_name (int reg)
+am33_register_name (struct gdbarch *gdbarch, int reg)
 {
   static char *regs[] =
   { "d0", "d1", "d2", "d3", "a0", "a1", "a2", "a3",
@@ -244,7 +244,7 @@ am33_register_name (int reg)
 }
 
 static const char *
-am33_2_register_name (int reg)
+am33_2_register_name (struct gdbarch *gdbarch, int reg)
 {
   static char *regs[] =
   {
@@ -843,7 +843,7 @@ mn10300_frame_unwind_cache (struct frame
     return (*this_prologue_cache);
 
   cache = trad_frame_cache_zalloc (next_frame);
-  pc = gdbarch_unwind_pc (current_gdbarch, next_frame);
+  pc = gdbarch_unwind_pc (get_frame_arch (next_frame), next_frame);
   mn10300_analyze_prologue (next_frame, (void **) &cache, pc);
   if (find_pc_partial_function (pc, NULL, &start, &end))
     trad_frame_set_id (cache, 
@@ -1179,9 +1179,9 @@ mn10300_gdbarch_init (struct gdbarch_inf
 /* Dump out the mn10300 specific architecture information. */
 
 static void
-mn10300_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
+mn10300_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   fprintf_unfiltered (file, "mn10300_dump_tdep: am33_mode = %d\n",
 		      tdep->am33_mode);
 }



                 reply	other threads:[~2007-10-31 10:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=47285CED.8050103@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