GDB and GDB/MI different reponses....

Pedro Alves
Thu Apr 4 10:15:00 GMT 2013

On 04/04/2013 10:05 AM, John Martin wrote:

> Perhaps it isn't enough information.
> I have fixed the problem but I don't understand  how to do it.
> If I execute the follow command:
> "gdb --interpreter=mi --readnow"  then I have several anonimous structs.
> But if I call gdb without "--readnow" argument, then GDB/MI return me correct structs types.

Okay, then MI seems to be a red herring.  You should see the
same (--readnow vs no --readnow) with the CLI?

> What is "--readnow"?

>From gdb --help:

  --readnow          Fully read symbol files on first access.

Reading debug info is a slow process, and without that switch (the
default), GDB will read in debug info lazily, as necessary.
It is not advisable to use --readnow.  It's mostly useful for
debugging/testing gdb's debug info read speed.

In principle, that switch should not cause user visible behavior
change.  But if you have more than one variable with the same name
in your program, reading in all debug info preemptively could
change which variable happens to find first (this is the kind of
thing I was referring to as "phase of the moon", btw).  I think
we have bug reports open around this.

Pedro Alves

More information about the Gdb mailing list