This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 24700]
- From: Daniel Jacobowitz <drow at false dot org>
- To: Jose Flavio Aguilar Paulino <jflavio at br dot ibm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 1 Mar 2007 13:37:00 -0500
- Subject: Re: [PATCH 24700]
- References: <1172777198.10229.11.camel@kadinsky.prado>
On Thu, Mar 01, 2007 at 03:26:38PM -0400, Jose Flavio Aguilar Paulino wrote:
> This patch modifies the <gdb/ppc-linux-tdep.c> file.
> It was noticed in GDB for PPC64 that the command "set var" failed when
> used to change a string value, the intent of this patch is to solve this
> gdb64's problem. Ex:
>
> char *ptr = NULL;
> printf("ptr string is %s\n", ptr);
> (gdb) set var ptr="def"
> ---Problem Description---
> gdb64: failed to set a string variable's value.
>
> I could not detect any regressions that could be caused by this patch in GDB's testsuite.
What is the problem, and how did the patch fix it? There are a number
of style issues with the patch, but no point at looking at them until
we understand the overall issue.
> + if (targ != ¤t_target)
> + return get_target_memory_unsigned (targ, addr2deref, 8);
> + else
> + {
> + gdb_assert (8 <= sizeof (buf));
> + target_read_memory(addr, buf, 8);
> + return extract_unsigned_integer (buf, 8);
> + }
What's the point of special casing based on the target?
--
Daniel Jacobowitz
CodeSourcery