In this question, I've tried to get a Windbg script working, but maybe I could solve my issue using PYKD anyway. My problem is the following:
I Launch the command ~* k
, and I get following response (as in the mentioned question, I like to emphasize the hyperlinks, hence the image instead of simple text):
I would like to simulate a mouse-click on the line, containing CServiceModule::Run
. When I hover over the corresponding hyperlink 02
, I see following Windbg command:
dx Debugger.Sessions[0].Processes[4416].Threads[4436].Stack.Frames[2].SwitchTo();dv /t /v
Until now, I've tried re-creating this command myself, but now I realise that, if I can just get that command from the response itself, my problem is solved.
As far as I know, the PYKD DbgCommand()
only gives the text part of the response (so, not the information under the hyperlink).
Is there any way to get this hyperlink from the DbgCommand()
command?
If you know frame number, you can switch frame with pykd.setFrame command. But you should remember, pykd does not support inline function frame. So a number of a frame can be different from windbg output. You can disable inline function with command 'inline 0'
The pykd script can look like that:
frames = getStack()
for frameNumber in xrange( len(frames) ):
if "ServiceModule::Run" in findSymbol(frames[frameNumber].ip):
setFrame(frameNumber)
dprintln("frame switched")
Extra edit for readability
As mentioned in following comment, an issue has been raised to PYKD, named "dbgCommand doesnt support DML command output": in other words: currently DML is not yet supported by PYKD DbgCommand()
.