Domanda

I am using GDB along with a JTAG device, an Abatron BDI2000, to debug a programs running on a Motorola M68332.

The 68332 does not have any hardware breakpoint registers. It has very primitive debugging features. The build tools do not generate 'elf' files, so no symbols for GDB to use. Also the program I'm debugging is running in Flash.

In fact the 68332 has only one debug instruction, ti. ti by itself steps to the next assembly instruction. ti xxx steps until the address xxx is reached. [Yes, this is caveman days, cold hammer and chisel :)]

I am able to use GDB with target remote to connect to the BDI2000 and issue the GDB commands 'nexti'. Due to the limitations of the 68332, 'stepi' is equivalent to 'nexti'.

Single stepping is only command available.

The monitor command 'monitor ti ' states change the program counter to and step.

If one uses a 'monitor' command that changes the registers, then GDB does not know about the command and its register cache become out of sync. I have created GDB functions which have the GDB command 'flushregs' at the end of each of them. This marks the register cache dirty. The GDB command will fetch a new set of registers.

I would like to create a symbol table file for debugging, but have not found any documentation on the GDB symbol file format.

Are there alternatives to what I have setup? I do have a RAM overlay for the Flash area. Would this allow software breakpoints?

Thanks in advance for any advice.

È stato utile?

Soluzione

I found I can use 'convenience' variables as a substitute for symbols, since I'm not using ever symbol in the program all at once.

set $Symbol=(unsigned int*)<address>

Each 'Symbol' is declared a pointer to an unsigned int at an address. One can put these statements in .gdbinit, and add to them over time.

One can then state

break $Symbol

I show a GDB command function that can be passed one of these 'convenience' variables in the question linked below.

How do I write a GDB function to make a comparison to the program counter

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top