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: "set foo"


> Date: Sun, 25 Apr 2010 10:43:47 -0400
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: gdb@sourceware.org
> 
> > So using "set foo" to make sure some symbol used by `foo' is loaded by
> > GDB is a valid technique, is that right?
> 
> I think the answer is yes - I am a little confused by "some symbol used
> by `foo'"

The specific use-case is that GDB does not recognize a certain struct;
for example, "ptype struct foo_t" says "No struct type named foo_t".
But if I type "set foo", where `foo' is a function whose code uses
that struct, GDB magically recognizes the struct afterwards.

> but I think I get what you are trying to ask. Basically, what
> the above does, as a side effect, is make sure that the full symbols
> for the unit containing `foo' get loaded.  I am not sure why the person
> who added it felt that they needed that

The reason is probably that .gdbinit in Emacs defines several
user-defined commands that need various symbols for their definition,
such as the number of bits used for Lisp type tags to convert an
opaque Lisp_Object into a pointer to a C struct.

Thanks.


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