blob: 6b5614243514e280c3c04c08834634013c80927a (
plain) (
tree)
|
|
1. Add GDB initilization to your target's code:
a) include file:
#include <uart.h>
b) declare this variable:
extern int BSPConsolePort;
c) To start-up GDB, run this:
/* Init GDB glue */
if(BSPConsolePort != BSP_UART_COM2)
{
/*
* If com2 is not used as console use it for
* debugging
*/
i386_stub_glue_init(BSP_UART_COM2);
}
else
{
/* Otherwise use com1 */
i386_stub_glue_init(BSP_UART_COM1);
}
/* Init GDB stub itself */
set_debug_traps();
/*
* Init GDB break in capability,
* has to be called after
* set_debug_traps
*/
i386_stub_glue_init_breakin();
/* Put breakpoint in */
breakpoint();
d) This is all you need to do for the target.
2. Edit cmds: specify path to current directory and device used for debugging
example of cmds is attached below. Make sure your paths are correct.
3. type 'make'
4. Boot o-pc386/<test>.exe on target computer, where <test> has the code from step 1. ( I modified and recompiled base_sp as the <test> )
5. run 'i396-rtems-gdb --nx --command=./cmds o-pc386/<test>.coff
=========================== example cmds ==============================
/usr1/rtems/work/rtems/cpukit/ada
/usr1/rtems/work/rtems/cpukit/itron/inline/rtems/itron
/usr1/rtems/work/rtems/cpukit/itron/src
/usr1/rtems/work/rtems/cpukit/libblock/src
/usr1/rtems/work/rtems/cpukit/libcsupport/src
/usr1/rtems/work/rtems/cpukit/libfs/src/dosfs
/usr1/rtems/work/rtems/cpukit/libfs/src/imfs
/usr1/rtems/work/rtems/cpukit/libmisc/capture
/usr1/rtems/work/rtems/cpukit/libmisc/cpuuse
/usr1/rtems/work/rtems/cpukit/libmisc/devnull
/usr1/rtems/work/rtems/cpukit/libmisc/dummy
/usr1/rtems/work/rtems/cpukit/libmisc/dumpbuf
/usr1/rtems/work/rtems/cpukit/libmisc/monitor
/usr1/rtems/work/rtems/cpukit/libmisc/mw-fb
/usr1/rtems/work/rtems/cpukit/libmisc/rtmonuse
/usr1/rtems/work/rtems/cpukit/libmisc/serdbg
/usr1/rtems/work/rtems/cpukit/libmisc/shell
/usr1/rtems/work/rtems/cpukit/libmisc/stackchk
/usr1/rtems/work/rtems/cpukit/libmisc/untar
/usr1/rtems/work/rtems/cpukit/libnetworking/arpa
/usr1/rtems/work/rtems/cpukit/libnetworking/kern
/usr1/rtems/work/rtems/cpukit/libnetworking/lib
/usr1/rtems/work/rtems/cpukit/libnetworking/libc
/usr1/rtems/work/rtems/cpukit/libnetworking/machine
/usr1/rtems/work/rtems/cpukit/libnetworking/net
/usr1/rtems/work/rtems/cpukit/libnetworking/netinet
/usr1/rtems/work/rtems/cpukit/libnetworking/nfs
/usr1/rtems/work/rtems/cpukit/libnetworking/rtems
/usr1/rtems/work/rtems/cpukit/libnetworking/sys
/usr1/rtems/work/rtems/cpukit/libnetworking/vm
/usr1/rtems/work/rtems/cpukit/librpc/src/rpc
/usr1/rtems/work/rtems/cpukit/librpc/src/xdr
/usr1/rtems/work/rtems/cpukit/posix/src
/usr1/rtems/work/rtems/cpukit/posix/inline/rtems/posix
/usr1/rtems/work/rtems/cpukit/rtems/inline/rtems/rtems
/usr1/rtems/work/rtems/cpukit/rtems/src
/usr1/rtems/work/rtems/cpukit/sapi/inline/rtems
/usr1/rtems/work/rtems/cpukit/sapi/src
/usr1/rtems/work/rtems/cpukit/score/cpu/i386
/usr1/rtems/work/rtems/cpukit/score/cpu/i386/rtems/score
/usr1/rtems/work/rtems/cpukit/score/src
/usr1/rtems/work/rtems/cpukit/score/inline/rtems/score
set remotebaud 38400
target remote /dev/ttyS1
|