-
Notifications
You must be signed in to change notification settings - Fork 226
Support GoToTargets Request #1102
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
Changes from 1 commit
b874c5c
a64c8d5
1138d4e
57f5d33
9b88764
f119e0c
1ebc16d
a2558e7
15de662
f37fe48
8fe364a
25625cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -282,23 +282,27 @@ int IDebugThread2.Resume(out uint suspendCount) | |
| } | ||
|
|
||
| // Sets the next statement to the given stack frame and code context. | ||
| // https://docs.microsoft.com/en-us/visualstudio/extensibility/debugger/reference/idebugthread2-setnextstatement | ||
| int IDebugThread2.SetNextStatement(IDebugStackFrame2 stackFrame, IDebugCodeContext2 codeContext) | ||
| { | ||
| // VS does provide a frame so at least do some sanity checks | ||
| AD7StackFrame frame = stackFrame as AD7StackFrame; | ||
| if (frame != null && (frame.ThreadContext.Level != 0 || frame.Thread != this)) | ||
| return Constants.S_FALSE; | ||
|
|
||
| try | ||
| ulong addr = ((AD7MemoryAddress)codeContext).Address; | ||
| AD7StackFrame frame = ((AD7StackFrame)stackFrame); | ||
| if (frame.ThreadContext.Level != 0 || frame.Thread != this || !frame.ThreadContext.pc.HasValue) | ||
| { | ||
| ulong addr = ((AD7MemoryAddress)codeContext).Address; | ||
| return _engine.Jump(addr); | ||
| return Constants.S_FALSE; | ||
| } | ||
| catch (Exception) | ||
| string toFunc = EngineUtils.GetAddressDescription(_engine.DebuggedProcess, addr); | ||
| string fromFunc = EngineUtils.GetAddressDescription(_engine.DebuggedProcess, frame.ThreadContext.pc.Value); | ||
| if (toFunc != fromFunc) | ||
| { | ||
| return Constants.S_FALSE; | ||
| } | ||
| string result = frame.EvaluateExpression("$pc=" + EngineUtils.AsAddr(addr, _engine.DebuggedProcess.Is64BitArch)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function is now only used by VS, right?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Correct. Currently this code isn't reachable in DAP scenarios.
This is just an internal call within MIEngine, so it will not matter what IDE is used. It worked with whatever scenario Set Next Statement was originally tested (Android?). I don't know if it has been tested more broadly. Certainly using the actual GDB command is better. But this PR just seeks to finish off disassembly support. Actually implementing set next statement is still left for your PR. Someone needs to finish off handling the work of handling that stopping event...
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yeah my bad, of course this goes down to gdb and not up.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, we would need to hide this difference -- the new set next statement would need to save some state in the process object to indicate that it is waiting for that stop event, and then SetNextStatement will need to wait for the stop event to be raised (or for the target process to exit). |
||
| if (result != null) | ||
| { | ||
| _engine.DebuggedProcess.ThreadCache.MarkDirty(); | ||
| return Constants.S_OK; | ||
| } | ||
| return Constants.S_FALSE; | ||
| } | ||
|
|
||
| // suspend a thread. | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.