fill with notes
[fw/sdcc] / debugger / README
1 sdcc/debugger
2 -------------
3 Notes Aug 4, 2001 - Karl Bongers
4
5 The debugger appears to have been broken
6 for quite some time.  My guess is that Sandeep originally had it
7 working in the 1999-2000 year timeframe, but then changes to the
8 command structure in ucSim(simulator) caused it to be busted for
9 quite a long time.
10
11 I got it working under Linux, a number of ucSim commands
12 changed syntax.  Including are:
13 Changed "g" command to "run".
14 Changed "dr" to "info register".
15 Changed l filename.ihx to l "filename.ihx" (the quotes are required
16   by ucSim, and can be a confusing issue with the load(l) command.
17
18 Also I had to add a "step" command prior to a "run" command
19 when it is desired to resume execution so that ucSim does not
20 stop on the same breakpoint we are currently at.
21
22 I have not tried compiling or running under Cygwin/Windows.
23
24 Issues:
25 ======================
26 * The source line #'s may be out of sync with the breakpoints and
27 assembly.  I'm not sure, today it seemed close but not exact, while
28 yesterday on a diferent test program it seemed several lines off...
29
30 * An initial "run" command must be issued to start up debugging.  The
31 debugger refuses to list code or insert breaks on initial startup.
32 The debugger builds up a context as it runs and it doesn't want to
33 do the code listings or breaks until it has some context.  This
34 doesn't seem right to me, you should be able to insert breaks
35 or list code immediately.  This needs to be looked at.
36
37 Work arounds:
38 ======================
39 Compile with --debug option:
40 sdcc --debug hi.c
41
42 Load sdcdb, like this:
43 sdcdb hi
44
45 Then you need to do an initial "run" command.  It should stop at the
46 main() entrypoint and give a message about a non-user breakpoint.
47
48 Now you should be able to list code, and set breakpoints.  Type
49 "c" to continue running to a breakpoint, or type "step" to single
50 step.
51
52 Use a preceeding bang("!") to do s51 simulator commands.  So for
53 example:
54 !pc
55 will send the "pc" command to ucSim and
56 give you the program counter and list the current line of assembly.
57 !help
58 will give you the brief command line help listing of ucSim.  But
59 this help will scroll of the screen.  So to get a list, I redirect
60 stdout to a text file to examine like this:
61 sdcdb hi 2>&1 | tee sdcdb.log
62
63 Slacker Notes:
64 ======================
65 To debug, it can be helpful to turn on verbose debug dumps
66 by uncommenting #define SDCDB_DEBUG in sdcdb.h.
67
68
69 End Notes Aug 4, 2001 - Karl Bongers
70 --------------
71