Changes between Version 1 and Version 2 of Docs/Prog/Manual/Development/Debugging


Ignore:
Timestamp:
11/30/09 13:53:16 (15 years ago)
Author:
Don Wilson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Docs/Prog/Manual/Development/Debugging

    v1 v2  
    11= Debugging =
     2
     3== GDB ==
     4
     5GDB is an open source debugger that is included in the !CodeSourcery development package.
     6
     7Using a terminal program such as Hyperterm to communicate with the 825 console at the “#” prompt type:
     8
     9gdbserver :''port'' ''progname'' [''args''] &  (where port is the TCP/IP port to be used, and programe is the name of the program to be debugged)
     10
     11For example:
     12
     13gdbserver :10000 cardbas 788IDS.77X &
     14
     15This will start the gdbserver process:
     16
     17184
     18
     19Process cardbas created; pid = 185
     20
     21Listening on port 10000
     22
     23From the PC you may then start debugging by selecting the “Debug” perspective and then clicking the “Bug” icon in Eclipse.
     24
     25For example, the terminal will show:
     26
     27Remote debugging from host 90.1.1.216
     28
     29Breakpoints may be set by double-clicking the border just to the left of a program line in the editor.
     30
     31F5 – Step Into (If stopped at a function call, this will step into the function)
     32
     33F6 – Step Over (If stopped at a function call, this will step over to the next statement)
     34
     35F8 – Resume (If stopped this will resume running)
     36
     37The “Variables” window will automatically show the local variables that are in use.
     38
     39Right-click in the “Variables” window and select “Add global Variables…” to select global variables to monitor. These will not appear until the next break.
     40
     41To stop the debugging session from !CodeSourcery click the red square icon. The application being debugged and the gdbserver will automatically exit.
     42
     43The terminal window will show:
     44
     45Killing inferior
     46
     47It is also possible to set gdbserver to attach to an already executing process.
     48
     49Determine the existing process ID first by using the PS command.
     50
     51gdbserver :''port'' – attach ''pid'' &  (where ''port ''is the TCP/IP port number and ''pid ''is the process ID)
     52
     53For example:
     54
     55gdbserver :10000 –attach 187 &
     56
     57When using the attach method stopping the debugging session from Eclipse may not stop gdbserver or the application.