I concur that this approach should work.
That being said, it has been my experience that going the extension route
never disappoints, at least as compared to the script route, if for no other
reason than that Windbg’s script syntax is just so unreasonable.
Extensions, on the other hand (all in my opinion, of course) rock.
Tremendously powerful. Even if you don’t need one for this (not that this
approach is necessarily a bad one - if it works, it works), getting familiar
with extensions is a great thing to do.
If you do go the extension route, I’d highly recommend the EngExtCpp
interface.
Good luck,
mm
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Scott Noone
Sent: Friday, July 15, 2011 3:28 PM
To: Kernel Debugging Interest List
Subject: Re:[windbg] WINDBG SCRPTING- lmvm -Module name
“Krzysztof Uchronski” wrote in message news:xxxxx@windbg…
Now the problem is that, for some unknown reason, part of the !analyze
output is not processed by .foreach command
Weird, I see the same thing:
kd> .foreach (tok { !analyze -D MODULE_NAME}) { .echo Foo token!}
MODULE_NAME: hdlock
Seems to be anything in the secondary part of the analysis that doesn’t get
sent to the same output (i.e. anything listed after, “Debugging Details”)
-scott
–
Scott Noone
Consulting Associate and Chief System Problem Analyst OSR Open Systems
Resources, Inc.
http://www.osronline.com
On Mon, Jul 4, 2011 at 3:40 PM, wrote:
> I am sorry but with .foreach wouldn’t i get details of all the modules…
> Sorry if i am being stupid here…
> If possible could you elaborate which token i can use to get details?
.foreach tokenizes the output of given command(s), so theoretically you
should be able to do something like this:
r$t0=0;.foreach (tok { !analyze -v }) { .if (@$t0==1) { aS
${/v:bcModuleName} ${tok}; .break } .elsif ($spat(“${tok}”,
“MODULE_NAME:”)) { r$t0=1; } }
It should create ${bcModuleName} alias which contains module name:
.echo ${bcModuleName}
Now the problem is that, for some unknown reason, part of the !analyze
output is not processed by .foreach command (at least when I tried it with
KD and WinDBG).
“.shell -ci” approach didn’t work for me neither - same problem - only part
of !analyze -v output was streamed to my python script.
Kris
—
WINDBG is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer