GDB

Started by Micron Engineering May 28, 2004
I have a simple question: is it possible debug a program running from
flash with gdb and a jtag interface? If yes, please tell me the
configuration and/or where I may download gdb and/or the gdb stub.
Best regards,
Massimo Manca, Micron Engineering



An Engineer's Guide to the LPC2100 Series

Hi Massimo,

--- Micron Engineering <> wrote:
> I have a simple question: is it possible debug a
> program running from
> flash with gdb and a jtag interface?

Yes.

> If yes, please
> tell me the
> configuration and/or where I may download gdb and/or
> the gdb stub.

You can download the arm-elf binaries from
http://www.ariusdsp.com/~gnuarm/files.html

or any other source.

Invoke insight (arm-elf-gdb should invoke insight
debugger or arm-elf-gdb w):
$ arm-elf-insight Your_image.elf

Choose ARM/ethernet target & give the IP of the JTAG
OCD box. You can do a connect & set break point at the
target debug location & reset the board, it should run
& break at the location if it ever hits.

[ FYI: you cannot exceed more than 2 break points when
debugging flash area, since the debugger can only make
use of the hardware breakpoints ]

You don't need GDB stubs on your target hardware for
debugging through JTAG interface. I guess the target
option ARM/ethernet talks to the JTAG interface using
Angel debug protocol. I used JEENI & it worked fine
for me (except when it encountered a bx, stepi or
nexti acts like continue).

Cheers,
-Mike. __________________________________



On Friday 28 May 2004 20:30, Micron Engineering wrote:
> I have a simple question: is it possible debug a program running from
> flash with gdb and a jtag interface? If yes, please tell me the
> configuration and/or where I may download gdb and/or the gdb stub.
> Best regards,
> Massimo Manca, Micron Engineering

I don't think jtag +flash really works via a gdbstub, but I could be wrong.

The jtag EmbeddedICE interface uses special debug registers in the core
which, AFAIK, are not visible from code space which means that the gdbstub
cannot access them. AFAIK gdbstub only works for executing programs in RAM.

Some JTAG debuggers (eg. bdi2000) emulate the gdb remote interface and
convert the gdbremote commands into their corresponding JTAG embedded ICE
commands.

There are two ways of trapping code in the EmbeddedICE(ie for breakpoints and
single stepping). One is to trap on a specific pattern (software breakpt) and
the other is to trap at a specific address (hardware breakpt). When debugging
a RAM program we can trap on specific patterns and can have (almost)
unlimited breakpoints by just setting those patterns in RAM at the breakpoint
addresses. Since we can't easily modify code in flash we have to use the trap
on address approach which means we can only set one or two breakpoints.

-- CHarles