Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-debug-dev] GDB Integration Experience

> 
> 
> Hi!
> 
> Sorry if you get two of these....
> 

cdt-debug-dev is fine.

> We've been integrating our version of 5.2.1 GDB into cdt and I've got some 
> questions based on our slash and burn integration experience.
> 
> I need to get some custom command line arguments to the GDB exec. That exec 
> seems to happen in MIPlugin.createCSession and seems to have no hook for 
> debug panel contributed arguments to the panel contributed GDB. Is the 
> right thing to do create a custom version of MIPlugin or am I missing some 

The MI parsing has one point of entry MISession(Process proc, ..) assuming
you have already Runtime.exec() etc ... with the right arguments.

The MIPlugin.java contains helper functions to create CDISession
create attach/core/debug sessions.

No, there is no way to pass other arguments, restrictions/inflexibility .. maybe.

> other route? (For the moment, I created a custom GDBDebugger, 
> IMILaunchConfigurationConstants and MIPlugin so that the contributed debug 
> panel can deal with these things, but feel like I am wearing a hat with 
> hack written on it when I'm doing so.)
> 

Seems like the right way, create you own debug class, for example the
MI plugin comes with two for convenience:

GDBDebugger.java --> for GNU/Linux
CygwinGDBDebugger --> windows cygwin

They both create{Launch,Attach,Core}Session() methods with the
arguments/initialization that are specific to there needs.

> I have the same issue for environment variables. Same solution?
> 

Passing environment variables to the debugger/inferior, it was
something put on the debug plan to work on. Ideas are welcome.


> We are finding some bugs in the 5.2.1 GDB-MI code relating to pseudo 
> registers. 5.3 is coming soon and seems to have moved these over to 
> "cooked" registers and have the issues fixed.
> 
> Is GDB 5.2.1 the 1.0.1 supported GDB?
> 

mi level 1 is the supported protocol that comes with the default
implementation of CDT/Debugger.
If 5.3 supports "-i mi1" it will work with 5.3

> When, notionally, is cdt moving to a new GDB version?
> 

We hope to take more advantage in the coming mi level 2(gdb-5.4 ?)
but still keep supports for mi 1.  But whe have some problems with gdb:
- For now there is no way to query for the level of mi
  at runtime in gdb.
- Also some nasty bugs(See GDB/MI pr database) where fixed there is
  no way to know the version of gdb.  Each gdb instance returns some
  funky numbers when doing "gdb --version".  For example, we still
  have to rely on "info threads" even if MI "-thread-list-ids" was 
  fix(by Elena/keith @ redhat long time ago) etc ...

> Thanks!

A proposal containing feature requests and fixes was sent for
feedback.  Maybe you can take a look and insist on certain aspects or
new features.





Back to the top