summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/shared/comm/GDB.HOWTO
blob: 6b5614243514e280c3c04c08834634013c80927a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
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