I want to remove private symbol from a symbol file using binplace.exe, I saved the following command into a batch file 'parse.bat': binplace -a -x -s %_NTTREE%\stripped -n %_NTTREE%\full my-executable-file-name
.
The question is: When I executed the parse.bat
from command-line, binplace
can generate stripped symbol file properly, but if I executed the parse.bat
by double-click on it, binplace
cannot generate stripped symbol file, here is the output message from binplace using -v
option:
execute by double-click:
BINPLACE : warning GNA0293: Not a response file (-s)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer\stripped)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer\stripped)
BINPLACE : warning GNA0293: Not a response file (-n)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer\full)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer\full)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer\SystemTool.exe)
BINPLACE : warning BNP0000: Looking at file SystemTool.exe
BINPLACE : warning BNP0000: Class bin Not found in Class Tables
BINPLACE : warning BNP0000: place f:\SymbolServer\SystemTool.exe in f:\SymbolServer\bin\SystemTool.exe
binplace f:\SymbolServer\SystemTool.exe
BINPLACE : warning BNP0000: copy f:\SymbolServer\SystemTool.exe to f:\SymbolServer\bin\SystemTool.exe
BINPLACE : warning BNP0000: No symbols to strip from f:\SymbolServer\bin\SystemTool.exe
BINPLACE : warning BNP1536: Public symbols being copied to f:\SymbolServer\stripped\bin\exe\.
BINPLACE : warning BNP0000: place f:\SymbolServer\SystemTool.pdb in f:\SymbolServer\stripped\bin\exe\SystemTool.pdb
BINPLACE : warning BNP2700: Unable to copy (f:\SymbolServer\SystemTool.pdb,f:\SymbolServer\stripped\bin\exe\SystemTool.pdb) 126
BINPLACE : warning BNP0000: place f:\SymbolServer\SystemTool.pdb in f:\SymbolServer\full\bin\exe\SystemTool.pdb
BINPLACE : warning GNA0127: Command line finished
Press any key to continue . . .
execute from command-line:
F:\SymbolServer>parse.bat
BINPLACE : warning GNA0293: Not a response file (-s)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer\stripped)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer\stripped)
BINPLACE : warning GNA0293: Not a response file (-n)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer\full)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer\full)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer SystemTool.exe)
BINPLACE : warning BNP0000: Looking at file SystemTool.exe
BINPLACE : warning BNP0000: Class bin Not found in Class Tables
BINPLACE : warning BNP0000: place f:\SymbolServer\SystemTool.exe in f:\SymbolServer\bin\SystemTool.exe
binplace f:\SymbolServer\SystemTool.exe
BINPLACE : warning BNP0000: copy f:\SymbolServer\SystemTool.exe to f:\SymbolServer\bin\SystemTool.exe
BINPLACE : warning BNP0000: Symbols stripped from f:\SymbolServer\bin\SystemTool.exe into f:\SymbolServer\stripped\bin\exe\SystemTool.dbg
BINPLACE : warning BNP0000: place f:\SymbolServer\SystemTool.pdb in f:\SymbolServer\full\bin\exe\SystemTool.pdb
BINPLACE : warning GNA0127: Command line finished
Press any key to continue . . .
Using symchk
, I confirmed that SystemTool.exe
has only private symbol, the output message is listed below:
F:\SymbolServer>symchk /v SystemTool.exe /s .
[SYMCHK] Searching for symbols to F:\SymbolServer\SystemTool.exe in path .
DBGHELP: Symbol Search Path: .
[SYMCHK] Using search path "."
DBGHELP: No header for F:\SymbolServer\SystemTool.exe. Searching for image on d
isk
DBGHELP: F:\SymbolServer\SystemTool.exe - OK
DBGHELP: SystemTool - private symbols & lines
.\SystemTool.pdb
[SYMCHK] MODULE64 Info ----------------------
[SYMCHK] Struct size: 1672 bytes
[SYMCHK] Base: 0x00400000
[SYMCHK] Image size: 10293248 bytes
[SYMCHK] Date: 0x52395664
[SYMCHK] Checksum: 0x009cd39e
[SYMCHK] NumSyms: 0
[SYMCHK] SymType: SymPDB
[SYMCHK] ModName: SystemTool
[SYMCHK] ImageName: F:\SymbolServer\SystemTool.exe
[SYMCHK] LoadedImage: F:\SymbolServer\SystemTool.exe
[SYMCHK] PDB: ".\SystemTool.pdb"
[SYMCHK] CV: RSDS
[SYMCHK] CV DWORD: 0x53445352
[SYMCHK] CV Data: D:\cwork\DriverLoader\Debug\SystemTool.pdb
[SYMCHK] PDB Sig: 0
[SYMCHK] PDB7 Sig: {444090A7-6BE8-4310-BD87-4ABCA3F8E8A9}
[SYMCHK] Age: 1
[SYMCHK] PDB Matched: TRUE
[SYMCHK] DBG Matched: TRUE
[SYMCHK] Line nubmers: TRUE
[SYMCHK] Global syms: TRUE
[SYMCHK] Type Info: TRUE
[SYMCHK] ------------------------------------
SymbolCheckVersion 0x00000002
Result 0x001f0001
DbgFilename
DbgTimeDateStamp 0x52395664
DbgSizeOfImage 0x009d1000
DbgChecksum 0x009cd39e
PdbFilename F:\SymbolServer\SystemTool.pdb
PdbSignature {444090A7-6BE8-4310-BD87-4ABCA3F8E8A9}
PdbDbiAge 0x00000001
[SYMCHK] [ 0x00000000 - 0x001f0001 ] Checked "F:\SymbolServer\SystemTool.exe"
SYMCHK: FAILED files = 0
SYMCHK: PASSED + IGNORED files = 1
Who can tell me why and how to resolve it.
This is in response to your comment, so I can paste the code.
Your code sets another variable - where is that being used?
Try it with the added pause
command and see if it works the same at the cmd prompt and when double clicking. Don't add anything else to it. It occurs to me that you may not have typed the batch file name at the command line - did you do that?
BTW, if it still fails when double clicking then check if your path\batchname contains an &
character, or maybe some %
characters.
@echo off
set _NTTREE=f:\SymbolServer
set BINPLACE_PLACEFILE=%_NTTREE%\placefile.txt
binplace -a -x -v -s %_NTTREE%\stripped -n %_NTTREE%\full
pause
%_NTTREE%\SystemTool.exe
pause
User contributions licensed under CC BY-SA 3.0