0

I made powershell script that debug .dmp files with WinDbg. Here is part when windbg runs:

$arguments = '-y srv*c:\symbols*https://msdl.microsoft.com/download/symbols -z ' + $dmpfile + ' -c ".ecxr; kc; q" -logo ' + $logfile
            Start-Process -wait $windbg $arguments

But sometimes I face messages like: "the command line arguments cannot specify more than one kind of debugging to start" and my script stops, unable to handle that. I need to skip message and go on next dump file. How can I run WinDbg to debug minidump files and skip these messages?

Alexey O
  • 35
  • 5
  • 2
    Try escaping $dmpfile with double quotes. ...bols -z "' + $dmpfile + '" -c ".e... – kerem Jan 25 '16 at 08:41
  • You have an unpaired double quote in your string `$arguments`. I count 3. I suggest looking at what `$arguments` looks like to see how that is causing the issue. – Matt Jan 25 '16 at 12:43
  • @kerem that didn't help – Alexey O Jan 25 '16 at 13:44
  • @Matt edited, actually i have '-y "srv*c:\symbols*https://msdl.microsoft.com/download/symbols;srv*"another_address" -z ' but before posting here I deleted second symbol path, and left first quote. – Alexey O Jan 25 '16 at 13:47

1 Answers1

2

put all your arguments in a txt file and pass it as a script file to -c so that you don't have to struggle with quote matching

output of sample script file that i used on a random dump and the contents of logged file

PS C:\Users\HP\Documents> cat .\script.txt
.logopen /t
.sympath "E:\symbols"
lm
.ecxr
kc
q
PS C:\Users\HP\Documents> ls *.dmp    
-a---         1/26/2016  12:57 AM     961218 test.dmp    
PS C:\Users\HP\Documents> ls *.log
PS C:\Users\HP\Documents> Start-Process -wait cdb.exe '-z test.dmp -c "$$>a< script.txt"'
PS C:\Users\HP\Documents> ls *.log    
-a---         1/26/2016   1:15 AM       3416 dbgeng_0bb4_2016-01-26_01-15-58-593.log   
PS C:\Users\HP\Documents> grep -v def .\dbgeng_0bb4_2016-01-26_01-15-58-593.log
Opened log file 'dbgeng_0bb4_2016-01-26_01-15-58-593.log'
Symbol search path is: E:\symbols
start    end        module name
768a0000 76969000   user32     (pdb symbols)          e:\symbols\user32.pdb\xxx\user32.pdb
77b50000 77c8c000   ntdll      (pdb symbols)          e:\symbols\ntdll.pdb\xxx\ntdll.pdb
Minidump doesn't have an exception context
Unable to get exception context, HRESULT 0x80004002    
ntdll!KiFastSystemCallRet
user32!NtUserGetMessage
*** WARNING: Unable to verify checksum for notepad++.exe
*** ERROR: Module load completed but symbols could not be loaded for notepad++.exe
user32!GetMessageW
WARNING: Stack unwind information not available. Following frames may be wrong.
notepad__
notepad__
kernel32!BaseThreadInitThunk
ntdll!__RtlUserThreadStart
ntdll!_RtlUserThreadStart
quit:
blabb
  • 8,674
  • 1
  • 18
  • 27