I am attempting to write a gdb function that loops until the passed parameter equals the program counter.
I am working with a primitive CPU, 68332. No hardware breakpoints. No OS that supports GDB software breakpoints, just a single instruction step. GDB provides the 'software' emulation of 'nexti count'. The JTAG provides a run to address.
However, the JTAG, for some reason, overwhelms the CPU when used to run to address, and I get bus errors. I can only seem to reliably use 'step' single instruction.
If I use GDB to 'step' to the address, I don't get bus errors.
Below is my attempt at such a GDB function.
define mtia
if $argc == 1 then
set $address = *(unsigned char*)$arg0
while($address != $pc)
nexti
end
end
I just can't seem to get the syntax correct to be able to get GDB to accept and run the function.
What is the correct syntax?