* Re: GDB and GDB/MI different reponses.... [not found] <CAFTqdrNmXCMTaJ8vHngQ3n9WMQy98TUoT7JO4MEU0j=JmKJ+yg@mail.gmail.com> @ 2013-03-21 16:30 ` webquinty quinty 2013-04-04 9:35 ` Pedro Alves 0 siblings, 1 reply; 3+ messages in thread From: webquinty quinty @ 2013-03-21 16:30 UTC (permalink / raw) To: gdb Hello, As you known, with GDB it is possible to obtain debug information from executable. For example in GDB you can ask about type of var: -> whatis var <- type = unsigned char I just finished a frontend to extract debug information from a process using GDB/MI but the response is different than when I use GDB. For example, a struct called 'par' GDB return me type=param_typ but GDB/MI return me anonimous struct. Why? Best regards ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: GDB and GDB/MI different reponses.... 2013-03-21 16:30 ` GDB and GDB/MI different reponses webquinty quinty @ 2013-04-04 9:35 ` Pedro Alves [not found] ` <515D425E.90001@larraioz.com> 0 siblings, 1 reply; 3+ messages in thread From: Pedro Alves @ 2013-04-04 9:35 UTC (permalink / raw) To: webquinty quinty; +Cc: gdb On 03/21/2013 04:30 PM, webquinty quinty wrote: > Hello, > > As you known, with GDB it is possible to obtain debug information from > executable. > > For example in GDB you can ask about type of var: > > -> whatis var > <- type = unsigned char > > I just finished a frontend to extract debug information from a process > using GDB/MI but the response is different than when I use GDB. > > For example, a struct called 'par' GDB return me type=param_typ but GDB/MI > return me anonimous struct. > > Why? This is the sort of question that is simply impossible to answer definitely without having the binary in question, or even knowing exactly what you have attempted. Please don't make us guess; be proactive. But in principle there should be no difference. I'd guess either you've used different GDBs for the CLI vs MI tests, or, you have more than one 'par' in your program, and depending on current context (what the current function/frame GDB has selected for inspecting) and perhaps phase of the moon, you'll get one answer or the other. -- Pedro Alves ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <515D425E.90001@larraioz.com>]
* Re: GDB and GDB/MI different reponses.... [not found] ` <515D425E.90001@larraioz.com> @ 2013-04-04 10:15 ` Pedro Alves 0 siblings, 0 replies; 3+ messages in thread From: Pedro Alves @ 2013-04-04 10:15 UTC (permalink / raw) To: John Martin; +Cc: gdb 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-04 10:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CAFTqdrNmXCMTaJ8vHngQ3n9WMQy98TUoT7JO4MEU0j=JmKJ+yg@mail.gmail.com>
2013-03-21 16:30 ` GDB and GDB/MI different reponses webquinty quinty
2013-04-04 9:35 ` Pedro Alves
[not found] ` <515D425E.90001@larraioz.com>
2013-04-04 10:15 ` Pedro Alves
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox