gdb/insight on linux?

Hello,

I have OpenOCD with Amontec JTAGkey working with a LPC2292 on linux (suse 10.1). Now I would like to get gdb/insight working on linux. But all I can find are instructions how to get OpenOCD+gdb working with eclipse on windows.

Anybody knows where to get an arm-elf-gdb and/or arm-elf-insight? Or any instructions how to compile and configure it for myself?

Thanks!

Gnuarm only offers 64-bit binaries of the current version for linux. You could use OpenEmbedded, which provides the toolchain (among a million of other things), but imho OE is geared towards larger devices running full linux.

There are several posibilites for building a toolchain yourself:

  • doing everything by hand

  • crosstool

I decided to go with Tom Walsh’s instructions and scripts: http://openhardware.net/Embedded_ARM/Toolchain/

I’ve adjusted his scripts to use newer versions, and iirc I had to add an option to GCC building (–disable-libssp wasn’t in Tom’s scripts), but this issue might have been fixed already in the latest GCC release, it was a known issue several months ago.

Regards,

Dominic

Dominic:
Gnuarm only offers 64-bit binaries of the current version for linux. You could use OpenEmbedded, which provides the toolchain (among a million of other things), but imho OE is geared towards larger devices running full linux.

While I have plans to check out OE someday because I want to check out openmoko, this is... Uh... rather heavy-wight. OE has lots of dependencies on tools that are not widely used , so the learning curve is steep and long. (not to mention that you need more than 100GB to get it working.

There are several posibilites for building a toolchain yourself:

Do I really need to build the complete toolchain by myself? I thougt (for the start) it would be possible to build just gdb/insight separately?

  • doing everything by hand

  • crosstool

I decided to go with Tom Walsh’s instructions and scripts: http://openhardware.net/Embedded_ARM/Toolchain/

Thanks, I think I’ll dig into this.

I’ve adjusted his scripts to use newer versions, and iirc I had to add an option to GCC building (–disable-libssp wasn’t in Tom’s scripts), but this issue might have been fixed already in the latest GCC release, it was a known issue several months ago.

Are your adjusted scripts available online?

jw:
I have OpenOCD with Amontec JTAGkey working with a LPC2292 on linux (suse 10.1). Now I would like to get gdb/insight working on linux. But all I can find are instructions how to get OpenOCD+gdb working with eclipse on windows.

OK, I have downloaded and build gdb-6.6 and insight-6.6 with --target=arm-elf. (BTW: Anybody knows whether arm-elf is correct for lpc2xxx series with the arm7tdmi core?) At first glance it seems to talk with openocd. At least I can read registers and memory.

But where do I go from here? How do I use gdb/insight with openocd and uClinux as the OS on the target? I don’t want to debug drivers/kernel, just simple applications. How does gdb/openocd start a new process (the one that is to be debugged) on the target? Should it bypass or simulate the vfork/exec somehow?

BTW: I just noticed that I should have mentioned uClinux in the subject line. Maybe I should start a new thread?

JTAG isn’t meant to be used to debug application under a operating system like uClinux or “real” linux. The operating system already provides everything you need for debugging. All you need is a gdbserver (it is already part of the GDB package) cross-compiled for uClinux.

You would only use a JTAG debugger like OpenOCD when you want to work on the kernel itself or some driver.

Regards,

Dominic

[I sent this message two days ago, but it somehow did not show up in the forum. So here’s a repost. Sorry if it ends up twice.]

Dominic:
JTAG isn’t meant to be used to debug application under a operating system like uClinux or “real” linux.

The operating system already provides everything you need for debugging. All you need is a gdbserver (it is already part of the GDB package) cross-compiled for uClinux.

OK, then that's the next thing I'll dive into. Any comments whether --target=arm-elf is correct for lpc2xxx arm7tdmi? It creates arm-unknown-elf-gdb, while the naming sheme for the toolchain is something like arm-elf-gcc.

You would only use a JTAG debugger like OpenOCD when you want to work on the kernel itself or some driver.

Ah, OK. Thanks for the clarification, Dominic! Is this still done with gdb-client? If not, what’s the point of gdb-server support in openocd? Does any overview exist how to setup driver debugging with uclinux?