Discussion:
Syntax error with WinDBG command line -c ".cls;g"
(too old to reply)
Senthil
2010-09-07 19:11:16 UTC
Permalink
I am using WinDBG 6.12.2.663 to debug a target (VMWare ware guest)
over COM pipe. I intend to pass a command line that clears the screen
and continues debugging. So, I pass -c ".cls;g" and I get the syntax
error

Processing initial command '.cls;g'
0: kd> .cls;g
^ Syntax error in '.cls;g'

It works fine if pass just -c ".cls"

WinDBG help states that "If you are starting a debugging client, this
command must be intended for the debugging server. Client-specific
commands, such as .lsrcpath, are not allowed. ". Is that wha the issue
is?

I am not using client/server setup here, though I would agree that my
debugger is running in client mode here for all practical purposes.
Why is this restriction and is there a way for me to get .cls working
with other commands via -c ""?

Thanks,
Senthil
Scott Noone
2010-09-07 20:31:21 UTC
Permalink
I believe that .cls does fall into the category of commands that you can't
execute in this way.

If you play around with it a bit, you'll see strange behavior if you try to
combine .cls with another other command. Even putting a command separator
next to it will cause a complaint:

0:000> .cls;
^ Syntax error in '.cls;'

Where that's valid for other commands:

0:000> k;
ChildEBP RetAddr
001cf918 7795115a ntdll!LdrpDoDebuggerBreak+0x2c
001cfa90 77915947 ntdll!LdrpInitializeProcess+0x133f
001cfae0 77909cc9 ntdll!_LdrpInitialize+0x78
001cfaf0 00000000 ntdll!LdrInitializeThunk+0x10

Putting a space before the semicolon avoids the error, but everything after
the command will be ignored. The trouble is that these commands are handled
specially by the debugger engine I don't think there's any way around this
limitation unfortunately.

-scott
--
Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com
Post by Senthil
I am using WinDBG 6.12.2.663 to debug a target (VMWare ware guest)
over COM pipe. I intend to pass a command line that clears the screen
and continues debugging. So, I pass -c ".cls;g" and I get the syntax
error
Processing initial command '.cls;g'
0: kd> .cls;g
^ Syntax error in '.cls;g'
It works fine if pass just -c ".cls"
WinDBG help states that "If you are starting a debugging client, this
command must be intended for the debugging server. Client-specific
commands, such as .lsrcpath, are not allowed. ". Is that wha the issue
is?
I am not using client/server setup here, though I would agree that my
debugger is running in client mode here for all practical purposes.
Why is this restriction and is there a way for me to get .cls working
with other commands via -c ""?
Thanks,
Senthil
Satya
2010-09-07 23:32:03 UTC
Permalink
You may have better luck creating a script file and executing the script file
with $< syntax.

Satya
http://www.winprogger.com
Post by Senthil
I am using WinDBG 6.12.2.663 to debug a target (VMWare ware guest)
over COM pipe. I intend to pass a command line that clears the screen
and continues debugging. So, I pass -c ".cls;g" and I get the syntax
error
Processing initial command '.cls;g'
0: kd> .cls;g
^ Syntax error in '.cls;g'
It works fine if pass just -c ".cls"
WinDBG help states that "If you are starting a debugging client, this
command must be intended for the debugging server. Client-specific
commands, such as .lsrcpath, are not allowed. ". Is that wha the issue
is?
I am not using client/server setup here, though I would agree that my
debugger is running in client mode here for all practical purposes.
Why is this restriction and is there a way for me to get .cls working
with other commands via -c ""?
Thanks,
Senthil
.
Scott Noone
2010-09-08 12:26:09 UTC
Permalink
That's not going to work either, some commands can't be scripted and .cls is
one of them.

-scott
--
Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com
http://twitter.com/analyzev
Post by Satya
You may have better luck creating a script file and executing the script file
with $< syntax.
Satya
http://www.winprogger.com
Post by Senthil
I am using WinDBG 6.12.2.663 to debug a target (VMWare ware guest)
over COM pipe. I intend to pass a command line that clears the screen
and continues debugging. So, I pass -c ".cls;g" and I get the syntax
error
Processing initial command '.cls;g'
0: kd> .cls;g
^ Syntax error in '.cls;g'
It works fine if pass just -c ".cls"
WinDBG help states that "If you are starting a debugging client, this
command must be intended for the debugging server. Client-specific
commands, such as .lsrcpath, are not allowed. ". Is that wha the issue
is?
I am not using client/server setup here, though I would agree that my
debugger is running in client mode here for all practical purposes.
Why is this restriction and is there a way for me to get .cls working
with other commands via -c ""?
Thanks,
Senthil
.
Senthil
2010-09-08 18:21:43 UTC
Permalink
Thank you for all your comments. But at this point nothing is working.
Scripting doesn't work either as suggested by Scott. Kind of
frustrating, but I guess I can live with it.
Senthil
rogero
2010-09-09 12:19:59 UTC
Permalink
Post by Senthil
Thank you for all your comments. But at this point nothing is working.
Scripting doesn't work either as suggested by Scott. Kind of
frustrating, but I guess I can live with it.
Senthil
Try a space before the semicolon.
Strange but true...

Roger.
rogero
2010-09-09 12:22:50 UTC
Permalink
Post by rogero
Try a space before the semicolon.
Post in haste, repent at leisure...
The above avoids the syntax error but the subsequent command doesn't
seem to work properly.
Sorry for the noise.

Roger.
Scott Noone
2010-09-09 12:25:48 UTC
Permalink
If you do that the .cls will work but everything else on the line will be
ignored.

-scott
--
Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com
http://twitter.com/analyzev
Post by rogero
Post by Senthil
Thank you for all your comments. But at this point nothing is working.
Scripting doesn't work either as suggested by Scott. Kind of
frustrating, but I guess I can live with it.
Senthil
Try a space before the semicolon.
Strange but true...
Roger.
rogero
2010-09-09 12:43:25 UTC
Permalink
Post by Scott Noone
If you do that the .cls will work but everything else on the line will be
ignored.
-scott
--
Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.http://www.osronline.comhttp://twitter.com/analyzev
Post by rogero
Post by Senthil
Thank you for all your comments. But at this point nothing is working.
Scripting doesn't work either as suggested by Scott. Kind of
frustrating, but I guess I can live with it.
Senthil
Try a space before the semicolon.
Strange but true...
Roger.- Hide quoted text -
- Show quoted text -
Anyone know why .cls is special? Other dot commands I try seem happy
with the space:

windbg -c " .asm ; dd eip l1 " cmd.exe

roger.
Scott Noone
2010-09-09 13:46:26 UTC
Permalink
"rogero" <***@gmail.com> wrote in message
news:e86fb688-d365-42a2-b768-
Post by rogero
Anyone know why .cls is special? Other dot commands I try seem happy
windbg -c " .asm ; dd eip l1 " cmd.exe
.cls is a WinDBG GUI command, not a debugger engine command. So, it's
stripped out by the GUI code and not passed along to DbgEng. The list of
other commands like this is here:

http://msdn.microsoft.com/en-us/library/ff560137(VS.85).aspx


-scott
--
Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com
http://twitter.com/analyzev
Post by rogero
Post by Scott Noone
If you do that the .cls will work but everything else on the line will be
ignored.
-scott
--
Scott Noone
Consulting Associate
OSR Open Systems Resources,
Inc.http://www.osronline.comhttp://twitter.com/analyzev
Post by rogero
Post by Senthil
Thank you for all your comments. But at this point nothing is working.
Scripting doesn't work either as suggested by Scott. Kind of
frustrating, but I guess I can live with it.
Senthil
Try a space before the semicolon.
Strange but true...
Roger.- Hide quoted text -
- Show quoted text -
Anyone know why .cls is special? Other dot commands I try seem happy
windbg -c " .asm ; dd eip l1 " cmd.exe
roger.
Satya
2010-09-23 19:16:07 UTC
Permalink
I tried this and you are right. It seems this is a windbg issue. If you use
kd this works nicely. Here is what I tried in 6.12.2.633 x86 build of Windbg
package-

- created a script file that has 2 lines in it (mark that ; is adsent)
.cls
g
- in command prompt kd -k 1394:channel=1 -cf <script path>

Satya
Winprogger
http://www.winprogger.com
Post by Scott Noone
That's not going to work either, some commands can't be scripted and .cls is
one of them.
-scott
--
Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com
http://twitter.com/analyzev
Post by Satya
You may have better luck creating a script file and executing the script file
with $< syntax.
Satya
http://www.winprogger.com
Post by Senthil
I am using WinDBG 6.12.2.663 to debug a target (VMWare ware guest)
over COM pipe. I intend to pass a command line that clears the screen
and continues debugging. So, I pass -c ".cls;g" and I get the syntax
error
Processing initial command '.cls;g'
0: kd> .cls;g
^ Syntax error in '.cls;g'
It works fine if pass just -c ".cls"
WinDBG help states that "If you are starting a debugging client, this
command must be intended for the debugging server. Client-specific
commands, such as .lsrcpath, are not allowed. ". Is that wha the issue
is?
I am not using client/server setup here, though I would agree that my
debugger is running in client mode here for all practical purposes.
Why is this restriction and is there a way for me to get .cls working
with other commands via -c ""?
Thanks,
Senthil
.
Scott Noone
2010-09-27 16:24:51 UTC
Permalink
I put up a couple of blog posts on the issue and a very, very hacky
workaround:

http://analyze-v.com/?p=716
http://analyze-v.com/?p=719

-scott
--
Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com
Post by Satya
I tried this and you are right. It seems this is a windbg issue. If you use
kd this works nicely. Here is what I tried in 6.12.2.633 x86 build of Windbg
package-
- created a script file that has 2 lines in it (mark that ; is adsent)
.cls
g
- in command prompt kd -k 1394:channel=1 -cf <script path>
Satya
Winprogger
http://www.winprogger.com
Post by Scott Noone
That's not going to work either, some commands can't be scripted and .cls is
one of them.
-scott
--
Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com
http://twitter.com/analyzev
Post by Satya
You may have better luck creating a script file and executing the
script
file
with $< syntax.
Satya
http://www.winprogger.com
Post by Senthil
I am using WinDBG 6.12.2.663 to debug a target (VMWare ware guest)
over COM pipe. I intend to pass a command line that clears the screen
and continues debugging. So, I pass -c ".cls;g" and I get the syntax
error
Processing initial command '.cls;g'
0: kd> .cls;g
^ Syntax error in '.cls;g'
It works fine if pass just -c ".cls"
WinDBG help states that "If you are starting a debugging client, this
command must be intended for the debugging server. Client-specific
commands, such as .lsrcpath, are not allowed. ". Is that wha the issue
is?
I am not using client/server setup here, though I would agree that my
debugger is running in client mode here for all practical purposes.
Why is this restriction and is there a way for me to get .cls working
with other commands via -c ""?
Thanks,
Senthil
.
Loading...