Booting within running GDB

Chris Johns chrisj at rtems.org
Wed Dec 15 19:58:33 UTC 2004


Leon Pollak wrote:
> 
> 	Is there any way to execute gdb commands (except Ctrl-C) while application is 
> running (by "r" or "c")?
> 

Make the entry point a breakpoint instruction, then in your .gdbinit 
script have:

define hook-stop
  if $pc == start
    si
  end
end

where 'start' is your application's entry point. Note, the 'si' 
instruction works on the Coldfire how-ever you may need something else 
such as 'set $pc = $pc + 2' to skip the breakpoint instruction.

You start gdb with the application's image.


ps: My Right Boot supports the '--debug' command line where it sets the 
breakpoint instruction for you. I always have a couple of nops at the 
start of my application.


-- 
  Chris Johns



More information about the users mailing list