* [patch] Get rid of current_gdbarch in ppc-linux-nat.c
@ 2008-01-15 11:07 Markus Deuling
2008-01-15 20:36 ` Ulrich Weigand
0 siblings, 1 reply; 3+ messages in thread
From: Markus Deuling @ 2008-01-15 11:07 UTC (permalink / raw)
To: GDB Patches; +Cc: Ulrich Weigand
[-- Attachment #1: Type: text/plain, Size: 352 bytes --]
Hi,
this patch removes the last occurence of current_gdbarch in ppc-linux-nat.c Tested on PowerPC without regression.
Ok to commit ?
ChangeLog:
* ppc-linux-nat.c (ppc_register_u_addr): Add gdbarch as parameter.
Replace current_gdbarch by gdbarch. Update caller.
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com
[-- Attachment #2: diff-ppc --]
[-- Type: text/plain, Size: 1997 bytes --]
diff -urpN src/gdb/ppc-linux-nat.c dev/gdb/ppc-linux-nat.c
--- src/gdb/ppc-linux-nat.c 2008-01-11 15:42:53.000000000 +0100
+++ dev/gdb/ppc-linux-nat.c 2008-01-15 11:27:21.000000000 +0100
@@ -162,10 +162,10 @@ PT_NIP, PT_MSR, PT_CCR, PT_LNK, PT_CTR,
/* *INDENT_ON * */
static int
-ppc_register_u_addr (int regno)
+ppc_register_u_addr (struct gdbarch *gdbarch, int regno)
{
int u_addr = -1;
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
/* NOTE: cagney/2003-11-25: This is the word size used by the ptrace
interface, and not the wordsize of the program's ABI. */
int wordsize = sizeof (long);
@@ -184,7 +184,7 @@ ppc_register_u_addr (int regno)
u_addr = (PT_FPR0 * wordsize) + ((regno - tdep->ppc_fp0_regnum) * 8);
/* UISA special purpose registers: 1 slot each */
- if (regno == gdbarch_pc_regnum (current_gdbarch))
+ if (regno == gdbarch_pc_regnum (gdbarch))
u_addr = PT_NIP * wordsize;
if (regno == tdep->ppc_lr_regnum)
u_addr = PT_LNK * wordsize;
@@ -332,7 +332,7 @@ fetch_register (struct regcache *regcach
struct gdbarch *gdbarch = get_regcache_arch (regcache);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
/* This isn't really an address. But ptrace thinks of it as one. */
- CORE_ADDR regaddr = ppc_register_u_addr (regno);
+ CORE_ADDR regaddr = ppc_register_u_addr (gdbarch, regno);
int bytes_transferred;
unsigned int offset; /* Offset of registers within the u area. */
char buf[MAX_REGISTER_SIZE];
@@ -632,7 +632,7 @@ store_register (const struct regcache *r
struct gdbarch *gdbarch = get_regcache_arch (regcache);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
/* This isn't really an address. But ptrace thinks of it as one. */
- CORE_ADDR regaddr = ppc_register_u_addr (regno);
+ CORE_ADDR regaddr = ppc_register_u_addr (gdbarch, regno);
int i;
size_t bytes_to_transfer;
char buf[MAX_REGISTER_SIZE];
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] Get rid of current_gdbarch in ppc-linux-nat.c
2008-01-15 11:07 [patch] Get rid of current_gdbarch in ppc-linux-nat.c Markus Deuling
@ 2008-01-15 20:36 ` Ulrich Weigand
2008-01-16 4:49 ` Markus Deuling
0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Weigand @ 2008-01-15 20:36 UTC (permalink / raw)
To: Markus Deuling; +Cc: GDB Patches
Markus Deuling wrote:
> * ppc-linux-nat.c (ppc_register_u_addr): Add gdbarch as parameter.
> Replace current_gdbarch by gdbarch. Update caller.
This is OK.
Thanks,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] Get rid of current_gdbarch in ppc-linux-nat.c
2008-01-15 20:36 ` Ulrich Weigand
@ 2008-01-16 4:49 ` Markus Deuling
0 siblings, 0 replies; 3+ messages in thread
From: Markus Deuling @ 2008-01-16 4:49 UTC (permalink / raw)
To: Ulrich Weigand; +Cc: GDB Patches
Ulrich Weigand schrieb:
> Markus Deuling wrote:
>
>> * ppc-linux-nat.c (ppc_register_u_addr): Add gdbarch as parameter.
>> Replace current_gdbarch by gdbarch. Update caller.
>
> This is OK.
>
> Thanks,
> Ulrich
>
Thank you, I've committed this one.
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-01-16 4:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-15 11:07 [patch] Get rid of current_gdbarch in ppc-linux-nat.c Markus Deuling
2008-01-15 20:36 ` Ulrich Weigand
2008-01-16 4:49 ` Markus Deuling
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox