My fpga system is the orp_soc implementation,and GDB 6.8 is patched,newest toolschain used.
There is some problem with I use gdb with remote jtag protocol (target jtag jtag://localhost:9999).
1)break problem: when only set one breakpoint, the GDB never stop running. when set more then one breakpoing,the GDB can stop after the first breakpoint(sometimes can stop at the first breakpoint). There is some mismatch between to orp_soc implement and the openrisc 1000 document.The DMR2:WGB bit start from bit:12 in spec ,compareing with the verilog implement begin at 13bit.
2)stepi problem: when stepi through branch instruction(l.jar...),the MCU go through the jump inst and execute the next instruction instead of jummping to the branch address.The stepi command appers to ignore the branch instructions.
I found the same issue in forum about gdb with or1ksim,but the soultion is to modity the or1ksim.I think it is the problem with the GDB.
I enable the log on JP1,and find that or32-gdb implement the stepi command by insert the l.trap instruction after the each instruction when stepping runnning,and the trapping cause cpu stalling,and then add new l.tarp ,add npc.(and then MCU execute the next instruction after jump command).Maybe the inserting after the branch inst when cause some delay slot problem?
I think the effective way to implment stepi is to set DMR1:ST. Use hardware stepping support instead of software l.trap adding solution.After each instruciton running ,the hardware generate trap and stall the cpu automaticlly.I have test this method with jp1 code,and my hardware stepping ok,when stepping in branch command ,the MCU can run into the jumpping address.
I test method:(use jp1 low level jtag read/write funciton)
stall mcu
load 20 instruciton in 0x100 including l.jar .
enable execption
set trap to stall MCU
set ST bit in DMR2
unstall MCU 20 times,
read the NPC
the NPC address is right and the code funcion is right.
Thanks for your reply. I have read the RSP aritical in your website.After implement S packet in RSP Server side,the stepi problem maybe overcome.It is seem that GDB use RSP protocol to move hardware platform relative code to RSP Server side that make gdb porting more easily.
But have you test the stepi implement of gdb 5.8 with JTAG interface?I think it may be also has problem.Because gdb seems to share the same strategy that use soft breakpoint instead of hardware stepping.