Discussion:
Using environment variables in source indexed PDBs
(too old to reply)
t***@gmail.com
2015-07-16 20:28:53 UTC
Permalink
Maybe this is the wrong forum. If so, sorry, let me know where the correct place would be. I've also tried searching in this forum and haven't seen anyone asking this same question. Maybe my searching skill are poor.


I'm trying to make our own source indexing scripts instead of the standard ones that come with the debugging tools. In the srcsrv.doc file that comes with Debugging Tool for Windows it says "Note that if a variable cannot be resolved, an attempt is made to look it up as an OS environment variable. If that fails, the variable name is deleted from the text being processed."

So I have things like
SRCSRV: variables ------------------------------------------
LL_EXTRACT_CMD= LL.exe %srcsrvtrg% %ll_base_view%%var2%\\%fnfile(%var1%) -v %var3%
LL_EXTRACT_TARGET=%targ%%var2%%var3%\\%fnfile%(%var1%)
SRCSRVVERCTRL=LL
SRCSRVTRG=%LL_extract_target%
SRCSRVCMD=%LL_extract_cmd%
SRCSRV: source files ---------------------------------------
c:\proj\test\stdafx.cpp*\proj\test*\main\1
c:\proj\test\stdafx.h*\proj\test*\main\1


and if LL_BASE_VIEW is undefined, then when I run srctool it tells me things like

[c:\proj\test\stdafx.cpp] cmd: LL.EXE "c:\tempsrc\proj\test\main\1\stdafx.cpp" \proj\test\\stdafx.cpp -v \main\1


But when I define LL_BASE_VIEW to "GG" or anything and then rerun srctool it tells me

[c:\proj\test\stdafx.cpp] cmd: GG\proj\test\\stdafx.cpp -v \main\1

instead of what I'd expect which would be
[c:\proj\test\stdafx.cpp] cmd: LL.EXE "c:\tempsrc\proj\test\main\1\stdafx.cpp" GG\proj\test\\stdafx.cpp -v \main\1


I've tried using %fnvar(LL_BASE_VIEW), changing the case used and things like this, but they don't seem to work and either give me that same behavior or just make put "ll_base_view" in to the string. This seems to contradict what is stated in the srcsrv.doc when it replaces %fnvar%(WIN_SDKTOOLS) and %depot% in the example.

I really hope this isn't just some minor typo that I keep making everytime I try something else.

Thanks,

Mark
Mark Taraba
2015-07-16 21:45:11 UTC
Permalink
I figured it out. I need to define another variable in a line first that will bring in the environment variable. So this will work:

SRCSRV: variables ------------------------------------------
LL_BASE=%ll_base_view%
LL_EXTRACT_CMD= LL.exe %srcsrvtrg% %ll_base%%var2%\\%fnfile(%var1%) -v %var3%
LL_EXTRACT_TARGET=%targ%%var2%%var3%\\%fnfile%(%var1%)
SRCSRVVERCTRL=LL
SRCSRVTRG=%LL_extract_target%
SRCSRVCMD=%LL_extract_cmd%
SRCSRV: source files ---------------------------------------

Loading...