This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Is it possible to convert the pointer of struct member to the struct pointer.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]