This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Is it possible to convert the pointer of struct member to the struct pointer.
- From: Daniel Jacobowitz <drow at false dot org>
- To: Bin Chen <binary dot chen at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Mon, 2 Apr 2007 07:03:10 -0400
- Subject: Re: Is it possible to convert the pointer of struct member to the struct pointer.
- References: <5800c1cc0704020047i5b22231exd9099ce58ec2f00b@mail.gmail.com>
On Mon, Apr 02, 2007 at 03:47:57PM +0800, Bin Chen wrote:
> If there is a struct:
> struct A {
> int b;
> int c;
> };
> void func(int *c)
> {
> [...trap point..]
> }
> main()
> {
> struct A a;
> func(&a.c);
> }
> Now we are breaking in the body of func, and I want to take the value
> of b. Can any command do this?
No. You can go up and print a, but that's it.
--
Daniel Jacobowitz
CodeSourcery