home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / DJGPP / DJDOC106.ZIP / DOCS / DEBUG32.DOC < prev    next >
Encoding:
Text File  |  1991-08-25  |  4.5 KB  |  191 lines

  1. /* History:133,1 */
  2. This is file debug32.doc
  3.  
  4.  
  5. Contents:
  6.  
  7. * Basic concepts
  8. * Command summary
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18. Basic concepts:
  19.  
  20. Debug32 is created from the same set of sources as go32, the DOS extender.
  21. However, additional sources are enabled to add in the symbolic debugger
  22. features.  When invoked, debug32 loads the programs symbols (if it can)
  23. and places you at the beginning of execution (*NOT* at main()).  The
  24. debugger allows the following actions:
  25.  
  26. * step through code
  27. * step across or into function calls
  28. * set 3 independent breakpoints
  29. * go until a certain address
  30. * view and change registers
  31. * view and change memory
  32. * view program code (not source code)
  33. * view the 80387 state
  34. * display a stack trace
  35. * list symbols
  36.  
  37. The debugger does not allow changing the code, restarting the program, or
  38. changing the 387.
  39.  
  40. Wherever the commands call for an address, you may specify any of the
  41. following, or combination (use '+' and '-'):
  42.  
  43. * constants (1024, 0x4F)
  44. * symbols (_main, _valid_mem_used)
  45. * file/line (control#47)
  46. * registers (%edx)
  47. * combinations: (_data2+%edx-4 , traps#4+0x17)
  48.  
  49. Addresses are displayed in symbolic notation when available.  Code listings
  50. include function, file, and line numbers when available; and give
  51. variable names when it can figure what they are.
  52.  
  53. Whenever a prompt is displayed, a default command is also displayed.  If
  54. you just hit return, the prompt and default are *erased* and the previous
  55. command is repeated, including any counts specified, as a continuation of
  56. the previous command.  Thus, when stepping through code, enter "step"
  57. once, and just press <return> after that.  When dumping code or data,
  58. each <return> picks up where the last operation left off.
  59.  
  60. If you include the "ansi" parameter in the GO32 environment variable,
  61. then ANSI color commands will be used to colorize the debugging output:
  62.  
  63.   set go32=ansi driver c:/drivers/ati.grd
  64.            ----
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73. The commands:
  74.  
  75.  
  76. go [v]
  77. g [v]
  78. cont [v]
  79. c [v]
  80.  
  81. begin/continue execution from the current EIP and continue until the next
  82. breakpoint or exception.  If an address is specified after the "go",
  83. breakpoint number three is temporarily set to this address and enabled.
  84.  
  85.  
  86. step [count]
  87. s [count]
  88.  
  89. Execute one machine instruction, then stop.  If a count is given, steps
  90. that many instructions (displaying each on the screen).  This command
  91. traces *into* function calls.  No debug registers are used by this
  92. routine.  As each instruction is performed, the instruction is displayed
  93. on the screen with the "before" values of the appropriate registers.  You
  94. might see extra registers if a symbol like "pleax" is used (%eax displayed).
  95.  
  96.  
  97. next [count]
  98. n [count]
  99.  
  100. Similar to step, but does not trace into function calls.  Uses breakpoint
  101. number three.
  102.  
  103.  
  104. list [address] [count]
  105. l [address] [count]
  106. u [address] [count]
  107.  
  108. Lists machine-level code (symbolically, if it can), starting at the given
  109. address, or %eip if address not given (unless previous command was a
  110. list, then it picks up after the previous one).  If a count is given,
  111. lists that many lines (defaults to one unless previous was list).
  112. Source lines are listed if the source files are present, and source
  113. debugging information is available.
  114.  
  115.  
  116. dump [address] [count]
  117. d
  118.  
  119. dump memory.  Dumps as 32-bit words, with ASCII to the right.
  120.  
  121.  
  122. da [address]
  123.  
  124. Dump null-terminated ASCII.
  125.  
  126.  
  127. where
  128.  
  129. Give a list of functions currently active, provided the stack hasn't been
  130. trashed.
  131.  
  132.  
  133. whereis <wildcard>
  134.  
  135. give a list of symbols that match <wildcard> and their hexadecimal
  136. values.  Can also be used to evaluate expressions.  Wildcards are "*" for
  137. match zero or more, "?" for match any one.
  138.  
  139. Examples:    "whereis _foo*" gives _foo, _foo_bar, etc.
  140.              "whereis _main+47" gives 0x452f
  141.  
  142.  
  143. break <which> <address>
  144. b <which> <address>
  145.  
  146. Sets breakpoint <which> to address <address>.  There are four
  147. breakpoints, 0-3, but number three is used by "go" and "next".
  148. To clear a breakpoint, set its address to zero.
  149.  
  150.  
  151. status
  152.  
  153. Lists the breakpoints that are active.
  154.  
  155.  
  156. regs
  157. r
  158.  
  159. Display the 80386 registers and flags.
  160.  
  161.  
  162. set <what> <value>
  163.  
  164. Changes the contents of memory or registers.  To change memory, give any
  165. standard address as <what>.  To change a register, specify and of %eax,
  166. %ax, %ah, %al, %ebx, %bx, %bh, %bl, %ecx, %cx, %ch, %cl, %edx, %dx, %dh,
  167. %dl, %esi, %edi, %ebp, %esi, %esp, %eip, %eflags.
  168.  
  169.  
  170. npx
  171.  
  172. Displays the 80387 contents
  173.  
  174.  
  175. cls
  176.  
  177. Clears the screen
  178.  
  179.  
  180. help
  181. h
  182. ?
  183.  
  184. Give help
  185.  
  186.  
  187. quit
  188. q
  189.  
  190. Quit, what else?
  191.