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>"@d12av02.megacenter.de.ibm.com
Subject: [patch] Get rid of current_gdbarch in xtensa
Date: Mon, 19 May 2008 15:17:00 -0000	[thread overview]
Message-ID: <4830FF13.4070605@de.ibm.com> (raw)

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

Hi,

this patch get rid of the last to current_gdbarch's in xtensa target. Unfortunately I
dont have a xtensa machine here. If anyone has access to such a machine I'd welcome
a test run with this patch very much. Thanks in advance.

ChangeLog:

	* xtensa-tdep.c (call0_track_op): Add gdbarch as parameter and replace
	current_gdbarch. Update callers.
	(call0_analyze_prologue): Likewise.

Regards,
Markus

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


[-- Attachment #2: diff-xtensa --]
[-- Type: text/plain, Size: 2504 bytes --]

diff -urpN src/gdb/xtensa-tdep.c dev/gdb/xtensa-tdep.c
--- src/gdb/xtensa-tdep.c	2008-05-16 06:17:17.000000000 +0200
+++ dev/gdb/xtensa-tdep.c	2008-05-16 08:09:09.000000000 +0200
@@ -1981,7 +1981,7 @@ call0_classify_opcode (xtensa_isa isa, x
 static void
 call0_track_op (xtensa_c0reg_t dst[], xtensa_c0reg_t src[],
 		xtensa_insn_kind opclass, int nods, unsigned odv[],
-		CORE_ADDR pc, int spreg)
+		CORE_ADDR pc, int spreg, struct gdbarch *gdbarch)
 {
   unsigned litbase, litaddr, litval;
 
@@ -2034,9 +2034,9 @@ call0_track_op (xtensa_c0reg_t dst[], xt
       /* 2 operands: dst, literal offset.  */
       gdb_assert (nods == 2);
       /* litbase = xtensa_get_litbase (pc); can be also used.  */
-      litbase = (gdbarch_tdep (current_gdbarch)->litbase_regnum == -1)
+      litbase = (gdbarch_tdep (gdbarch)->litbase_regnum == -1)
 	? 0 : xtensa_read_register
-		(gdbarch_tdep (current_gdbarch)->litbase_regnum);
+		(gdbarch_tdep (gdbarch)->litbase_regnum);
       litaddr = litbase & 1
 		  ? (litbase & ~1) + (signed)odv[1]
 		  : (pc + 3  + (signed)odv[1]) & ~3;
@@ -2093,8 +2093,9 @@ call0_track_op (xtensa_c0reg_t dst[], xt
       because they begin with default assumptions that analysis may change.  */
 
 static CORE_ADDR
-call0_analyze_prologue (CORE_ADDR start, CORE_ADDR pc,
-			int nregs, xtensa_c0reg_t rt[], int *call0)
+call0_analyze_prologue (CORE_ADDR start, CORE_ADDR pc, int nregs,
+			xtensa_c0reg_t rt[], int *call0,
+			struct gdbarch *gdbarch)
 {
   CORE_ADDR ia;		    /* Current insn address in prologue.  */
   CORE_ADDR ba = 0;	    /* Current address at base of insn buffer.  */
@@ -2285,7 +2286,7 @@ call0_analyze_prologue (CORE_ADDR start,
 	    }
 
 	  /* Track register movement and modification for this operation.  */
-	  call0_track_op (rt, rtmp, opclass, nods, odv, ia, 1);
+	  call0_track_op (rt, rtmp, opclass, nods, odv, ia, 1, gdbarch);
 	}
     }
 done:
@@ -2315,7 +2316,7 @@ call0_frame_cache (struct frame_info *th
     {
       body_pc = call0_analyze_prologue (start_pc, pc, C0_NREGS,
 					&cache->c0.c0_rt[0],
-					&cache->call0);
+					&cache->call0, gdbarch);
     }
   
   sp = get_frame_register_unsigned
@@ -2487,7 +2488,7 @@ xtensa_skip_prologue (struct gdbarch *gd
     }
 
   /* No debug line info.  Analyze prologue for Call0 or simply skip ENTRY.  */
-  body_pc = call0_analyze_prologue(start_pc, 0, 0, NULL, NULL);
+  body_pc = call0_analyze_prologue(start_pc, 0, 0, NULL, NULL, gdbarch);
   return body_pc != 0 ? body_pc : start_pc;
 }
 

             reply	other threads:[~2008-05-19  4:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-19 15:17 Markus Deuling [this message]
2008-05-20 18:08 ` Ulrich Weigand
2008-05-20 22:15   ` Maxim Grigoriev
2008-05-20 22:23     ` Ulrich Weigand
2008-05-21 22:27   ` [commit] " Maxim Grigoriev
2008-05-23 14:44     ` 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=4830FF13.4070605@de.ibm.com \
    --to=deuling@de.ibm.com \
    --cc=", Ulrich Weigand <uweigand@de.ibm.com>"@d12av02.megacenter.de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /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