Author Topic: How run foo-gdb?  (Read 3397 times)

Offline stardust

  • Multiple posting newcomer
  • *
  • Posts: 55
    • http://www.hightec-rt.com
How run foo-gdb?
« on: March 09, 2007, 10:38:19 am »
In order to add some support for cross-development to C::B I need a way to start the debugger.

How can I do that?

I added support for some GCC toolchains, i.e. there are now some foo-gcc compilers. Just adding foo-gdb in the "Compiler & Debugger" settings cannot work.

C::B just aims at host-development (build system and the machine you build for are of the same type) and seems to have no concepts for cross-development (build system and the machine you build for are not binary compatible in any way).

In partucular, before executing an executable you must upload it into the target system and you must establish a connection to this system. You cannot patch the executable on the fly during a debugging session, have limited bandwith, and so on.

Target connection is accomplished by a plugin that starts a JTAG server as a detached process.

So the question is: How shall I add the support to launch a program?

In a first step it will be enough to start the debugger as an external process, without controlling the debugger from within C::B or being able to browse symbols from C::B, etc. However, this minimal solution should work smooth because I will not be the end user of this C::B version. So changing configs by hand, confirming policy popups, etc. is no option (except it can be done by me and then redistibuted).

I browsed the DebuggerGDB class (./src/plugins/debuggergdb.cpp) and it's methods ::Debug and ::FindDebuggerExecutable, but all this looks very complicated and contains the implicit assumption that the exectuable and C::B run on the same machine...

Can I make use of the gdb implementation or will I have to re-program everything from scratch?

As stated above, I intend to make a minimal, smooth implementation and not the all-in-one-and-forever-fine thing. That may come sometimes when I am more familiar with C::B and its internals.

BTW: Will the new compiler framework respect the fact that there are also cross-compilers?
Own SVN builds (quite new) • SuSE Linux 10.0 • Linux kernel 2.6.13-15-default
gcc 4.0.2 (20050901)
wxGTK-2.6.1.0-4 • KDE 3.4.2b • gtk2 2.8.3-4