home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / GDB / GDB-4.13 / GDB-4 / gdb-4.13 / gdb / sparclite / hw_breakpoint.note < prev    next >
Encoding:
Text File  |  1994-06-09  |  2.9 KB  |  53 lines

  1.  
  2. GDB Hardware Breakpoint Support for SPARClite (Fujistu MB86930 Board)
  3.  
  4. 1. Setup:
  5.     The MB86930 board is connected to a sun sparc station serial port. This
  6. is a cross debugging setup and the host is not limited to sun sparc station. 
  7. To turn on the SPARClite Debug Support Unit (DSU), jumper 5 on the board has
  8. to be set to (2 3) instead of (1 2). The board runs under Fujitsu EPROM code,
  9. which provides the Trap and interrupt handling that gdb uses. A user program
  10. will link with several files that gdb provides to communicate with gdb. Look
  11. at devo/gdb/sparclite to find the files. In devo/gdb directory, sparc-stub.c
  12. used to be the stub file that link with user program, to control user program
  13. when hit breakpoint. Now, now based on this file, we come up with a new file
  14. sparclite-stub.c to add the support for hardware breakpoint. Look at devo/gdb/
  15. sparclite/Makefile.in for how to build user binary.
  16.  
  17. 2. Data/Instruction breakpoint:
  18.     SPARClite DSU will generate traps when program access some data or
  19. instruction addresses assigned to debug registers. For data part, it
  20. facilitates watch points, in particular gdb 'watch' command. The execution
  21. under watch command now is much much faster. e.g.
  22.  
  23.     watch x : gdb will break when x is write into and changes value
  24.     watch *(int *)0x40003200 : watch the integer word at addr 0x40003200
  25.  
  26. The hardware breakpoint registers can only take two data watch points, if gdb
  27. specify more than two points, it will fall back to old method of data watch,
  28. whcih is step and check, it's going to be very slow. To avoid this, delete
  29. or disable some unused watch points by 'delete' or 'disable' commands, then
  30. set new watch point.
  31. Besides 'watch' command, we add two new commands 'rwatch' and 'awatch' to use
  32. the new facilities provided by DSU. 'rwatch x' for read watch x, will break
  33. when x is read by the program. 'awatch x' will break when x is read or written
  34. into. DSU has only two slots, user cannot use them with mixed type of watch
  35. points, that is user cannot has 'watch x' and 'rwatch y' to use the two slots.
  36. They have to be the same kind of watch command for both slots. Gdb will reject
  37. the command if mix used.
  38. For instruction hardware breakpoint, the main purpose is for EPROM/ROM code
  39. debugging, that one can set a breakpoint at an instruction without changing
  40. the instruction. Gdb add a new command for this, 'hbreak' for hardware
  41. break. The syntax is the same as 'break' command. Again there are only two
  42. slots for hbreak in DSU. Gdb will reject ths command if more than two
  43. is used. Delete or disable some of the old hardware breakpoints before setting
  44. new ones.
  45.  
  46. 3. Implementation:
  47.     The implementation has isloated all target dependecies, look at
  48. sparclite-tdep.c, sparclite-stub.c and config/sparc/tm-sparclite.h for target
  49. hardware dependent code. Also see gdb/sparclite directory for how to build
  50. a user binary and what files get linked. If you see any problem, please report
  51. to Kung Hsu at Cygnus Support Inc. email addr: kung@cygnus.com.
  52.  
  53.