This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Fix a glitch in debugging 32-bit process with 64-bit GDB.
- From: Daniel Jacobowitz <drow at false dot org>
- To: Paul Pluzhnikov <ppluzhnikov at google dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 8 Dec 2008 21:07:44 -0500
- Subject: Re: [patch] Fix a glitch in debugging 32-bit process with 64-bit GDB.
- References: <20081209013252.9E1C83A6B2E@localhost>
On Mon, Dec 08, 2008 at 05:32:52PM -0800, Paul Pluzhnikov wrote:
> The problem is that in findvar.c:
>
> case LOC_ARG:
> if (frame == NULL)
> return 0;
> addr = get_frame_args_address (frame);
> if (!addr)
> return 0;
> addr += SYMBOL_VALUE (var);
> break;
>
> What happens if sizeof(addr) == 8 (64-bit gdb), len == 4 (32-bit target),
> get_frame_args_address() returns 0xffffbf98 (typical stack address)
> and SYMBOL_VALUE() returns -16?
>
> We end up with an impossible target address of 0x1ffffbf88.
Conclusion doesn't follow from example, but I think I'm just
confused... Do you mean that SYMBOL_VALUE is -16U or -16UL, and
that's where the wrapping comes from? But SYMBOL_VALUE is a long,
signed. Is SYMBOL_VALUE (long) 0xfffffff0? If that's the case then
the debug reader might be to blame.
--
Daniel Jacobowitz
CodeSourcery