-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hit bit interaction with action conflict when several triggers of the same priority match #1018
Comments
I don't think that the intention was for this obscure part of the spec to require hit to be implemented. Requirements like that should be more obvious. It should say "hit (if supported) ... must still be set" or something like that. I don't think that I understand your point 3. Can you give a specific example where you give two triggers of certain types with certain actions and then what you think the problem is? |
Therefore at least one of the assumptions should be false, in particular:
So, strictly speaking my conclusion was not correct. It should have been: I think this should be clarified.
But in such case (HW does not take both actions and there are no hit bits) the debugger will not be able to emulate the breakpoint exception. So the fact that the debugger configured a trigger will change control flow of the program. I think this is |
The spec says:
This says that you could have both actions take place where entering Debug Mode happens first. That doesn't directly make sense because if you enter Debug Mode then you can't subsequently trap to M mode (or some other mode dictated by medeleg/hedeleg). My assumption has been that the two actions would happen at completely different times. You would enter Debug Mode and nothing else would happen right away. The external debugger does whatever it wants and when it wants to restart, it would:
On step 2, the other trigger with action=0 would fire. In particular, the dpc after the single step would point to the breakpoint handler and step 4 would resume execution in the breakpoint handler. In the end, both actions were taken (separated by quite a bit of time). If the external debugger is going to emulate the instruction rather than reexecuting it (skipping steps 1/2/3 and incrementing dpc before doing step 4) then it needs to emulate everything related to that instruction, including any other triggers. Whether an implementation has a hit bit doesn't matter. For each trigger, the emulator needs to do address/data comparison, looking at mode filters, looking at chaining, etc. It's not trivial but it's possible (just as it's possible for software to emulate all aspects of hardware). I wouldn't be surprised if existing debuggers simply don't support having multiple simultaneous debuggers (native and external) running at the same time. But they could support that if they do the above. |
From [5.3. Priority]:
hit ... must still be set
part. Is my understanding correct that either:hit
bit only when the trigger fires.mcontrol6
icount
:Lets assume that the trigger with action "raise a breakpoint exception" in the case in question is one of
mcontrol6
oricount
.Lets assume HW only enters Debug Mode without raising a breakpoint exception.
"breakpoint exception" has not been risen -> the trigger with action "raise a breakpoint exception" has not fired -> hit bit can not be set to 1.
mcontrol6
oricount
can not be supported.Can you please point to a mistake in my logic or clarify such case?
The text was updated successfully, but these errors were encountered: