Community
Participate
Working Groups
While testing the RunControl resume command, I tried to send a resume request with an unsupported mode, but got a 'contextResumed' event. On an opensource agent (linux), I tried to do a resume(RM_REVERSE_RESUME), and got a 'contextResumed' event, which I guess, is not true. 2013-07-02 16:38:23,669 : ---> C 20 RunControl getContext "P7571.7571" 2013-07-02 16:38:23,675 : <--- R 20 None None {"ID":"P7571.7571","ParentID":"P7571","ProcessID":"P7571","CanSuspend":true,"CanResume":12351,"HasState":true,"WordSize":8,"CanTerminate":true,"RCGroup":"P7571.7571","BPGroup":"P7571","SymbolsGroup":"P7571","CPUGroup":"CPU"} 2013-07-02 16:38:23,693 : ---> C 21 RunControl getChildren "P7571" 2013-07-02 16:38:23,694 : <--- R 21 None None ["P7571.7571"] 2013-07-02 16:38:23,717 : ---> C 22 RunControl resume "P7571.7571" 6 1 2013-07-02 16:38:23,719 : <--- E None RunControl contextResumed "P7571.7571" 2013-07-02 16:38:23,722 : <--- R 22 None None 2013-07-02 16:38:23,724 : <--- E None RunControl contextChanged [{"ID":"P7571.7571","ParentID":"P7571","ProcessID":"P7571","CanSuspend":true,"CanResume":12351,"HasState":true,"WordSize":8,"CanTerminate":true,"RCGroup":"P7571.7571","BPGroup":"P7571","SymbolsGroup":"P7571","CPUGroup":"CPU"}] 2013-07-02 16:38:23,732 : <--- E None RunControl contextSuspended "P7571.7571" 139777022629552 "Cannot resume. Unsupported command" {} I agree that there is a : 2013-07-02 16:38:23,732 : <--- E None RunControl contextSuspended "P7571.7571" 139777022629552 "Cannot resume. Unsupported command" {} Coming later on, but the fact that the context has been marked as 'Resumed' at a time is wrong to me. The command should return an error from m y point of view, since the context says 'I cannot resume this mode' ... Thanks
Eugene, do you foresee any problem if we test the resume mode in continue_debug_context() routine: else if (count != 1) { err = EINVAL; } else if (!context_can_resume(ctx, mode)) { err = ERR_UNSUPPORTED; } else if (resume_context_tree(ctx) < 0) { err = errno; } I have seen some ACPM code in runctrl.c especially when calling context_resume(); I was wondering if this could be problematic or not but I can't figure out why ACPM is used (run-control commands are not yet implemented in context-proxy.c). Thanks, Didier
(In reply to comment #1) > Eugene, do you foresee any problem if we test the resume mode in > continue_debug_context() routine: Most resume modes are implemented by the service itself, not by context.c. So, yes, using context_can_resume() like that will cause problems. > I have seen some ACPM code in runctrl.c especially when > calling context_resume(); I was wondering if this could be problematic or > not but I can't figure out why ACPM is used (run-control commands are not > yet implemented in context-proxy.c). Resume modes like "step over line" need line numbers and symbols info. Since the info can be provided by a remote services, resume command must use ACPM.
(In reply to comment #2) > (In reply to comment #1) > > Eugene, do you foresee any problem if we test the resume mode in > > continue_debug_context() routine: > > Most resume modes are implemented by the service itself, not by context.c. > So, yes, using context_can_resume() like that will cause problems. Of course, you are right. We should not use context_can_resume() but instead implement a routine to compute available modes similar to what is done in write_context(). > > > I have seen some ACPM code in runctrl.c especially when > > calling context_resume(); I was wondering if this could be problematic or > > not but I can't figure out why ACPM is used (run-control commands are not > > yet implemented in context-proxy.c). > > Resume modes like "step over line" need line numbers and symbols info. Since > the info can be provided by a remote services, resume command must use ACPM. But still, I don't understand why we have this code: if (context_resume(ctx, md, 0, 0) < 0) { int error = errno; if (get_error_code(error) == ERR_CACHE_MISS) return; resume_error(ctx, error); } context_resume() cannot return ERR_CACHE_MISS (but maybe it will in the future).
(In reply to comment #3) > Of course, you are right. We should not use > context_can_resume() but instead implement a routine to compute available > modes similar to what is done in write_context(). Yes, this would work. > context_resume() cannot return ERR_CACHE_MISS (but maybe it will in the > future). In our proprietary implementation, context_resume() can return ERR_CACHE_MISS, because we use ACPM in our USB-JTAG access code.
Fix commited: https://git.eclipse.org/r/#/c/14436/