My chip can only work with gdb 5.0. When use gdb 6.8, break points can't stop the running. Now I know why. Since my chip has no hardware breakpoint. gdb 5.0 initializes the num_matchpoints by: tmp = or1k_read_spr_reg (DCFGR_SPRNUM); or1k_implementation.num_matchpoints = tmp & 7; But gdb 6.8 initializes it by: tmp = or1k_jtag_read_spr (OR1K_DCFGR_SPRNUM); tdep->num_matchpoints = (tmp & OR1K_SPR_DCFGR_NDP) + 1; So gdb 6.8 can't set break point properly. After I modify the last line to: tdep->num_matchpoints = (tmp & OR1K_SPR_DCFGR_NDP);// + 1; Gdb 6.8 can also work happily. Why to increase the value?
"OR1K_DCFGR_SPRNUM = 0" means that one hardware matchpoint unit by last openrisc_arch.doc
there are no way to represent that debug unit have no hardware matchpoint unit
there are need to modify the OR1K_SPR_DCFGR_NDP's meaning
NDP Number of Debug Pairs 0 Debug unit has one DCR/DVR pair …