Gavare's eXperimental Emulator:
GDB remote serial protocol connection

Back to the index


GDB remote serial protocol connection


Introduction:

Starting with release 0.4.0, GXemul has (very rudimentary) GDB serial protocol support. This means that you can start up GDB, or a front-end program which in turn uses GDB, and connect it to a running GXemul instance.

The GDB front-end I use in this example is the Data Display Debugger (DDD).

     

The screenshot above shows DDD connected to GXemul, running the Hello World demo program compiled for mips64-unknown-elf, on a FreeBSD/amd64 host.


Prerequisites:

You can still run a bare GDB session without a GUI front-end if you like.


Example session:

  1. Start up GXemul, and tell it to wait for an incoming GDB connection on a certain port:
    	# gxemul -x -E testmips -G 10000 hello_mips
    
    

  2. Start the DDD, using a GDB configured for this specific target, and also give the name of the binary/kernel. (This binary should have been compiled with -g.)
    	# ddd --debugger mips64-unknown-elf-gdb hello_mips
    
    

  3. At the (gdb) prompt in DDD, type:
    	(gdb) target remote localhost:10000
    
    

  4. Press F9 (Continue) to start. Press ESC when you wish to interrupt. You can also use F5 (Step) to single-step one instruction at a time.


Notes: