Symbol Path Not Found in windbg - windows

I have set the path as
srv*C:\Users\swpapati\Desktop\admintool_crash\pdbs*http://msdl.microsoft.com/download/symbols
where "C:\Users\swpapati\Desktop\admintool_crash\pdbs" exists and has the local copy of required symbol file values.
On loading the dmp crash file I can see below text on console :-
On issuing Command - .reload /f admintool.exe I can get below error as Symbol file not found.
Similar error is obtained on issuing !analyze -v or .reload /f
The admintool.pdb is present at C:\Users\swpapati\Desktop\admintool_crash\pdbs.
Also I have set the env variable
_NT_SYMBOL_PATH = srv*C:\Users\swpapati\Desktop\admintool_crash\pdbs*http://msdl.microsoft.com/download/symbols
What setting went wrong?

The admintool.pdb is present at C:\Users\swpapati\Desktop\admintool_crash\pdbs
You can't simply put a PDB file into a folder that has a structure of a symbol store.
There are at least 2 solutions:
a) put your own PDBs into the folder using the tool symstore.exe. This approach will require learning about how symbol stores are set up and how to use symstore.exe.
b) use two different paths, one for the Microsoft symbols and one folder with your own symbols. Commands are like this:
.sympath x:\whereever\your\pdbs\are\
.symfix+ x:\whereever\microsoft\symbols\should\go\
Note the + at the end of a command. It tells WinDbg to use that in addition to the existing symbol paths that are already set up.

Related

Unable to load/require file from Lua running from Atom in Windows

I'm trying to use Atom to run a Lua script. However, when I try to load files via the require() command, it always says it's unable to locate them. The files are all in the same folder. For example, to load utils.lua I have tried
require 'utils'
require 'utils.lua'
require 'D:\Users\Mike\Dropbox\Lua Modeling\utils.lua'
require 'D:\\Users\\Mike\\Dropbox\\Lua Modeling\\utils.lua'
require 'D:/Users/Mike/Dropbox/Lua Modeling/utils.lua'
I get errors like
Lua: D:\Users\Mike\Dropbox\Lua Modeling\main.lua:12: module 'D:\Users\Mike\Dropbox\Lua Modeling\utils.lua' not found:
no field package.preload['D:\Users\Mike\Dropbox\Lua Modeling\utils.lua']
no file '.\D:\Users\Mike\Dropbox\Lua Modeling\utils\lua.lua'
no file 'D:\Program Files (x86)\Lua\5.1\lua\D:\Users\Mike\Dropbox\Lua Modeling\utils\lua.lua'
no file 'D:\Program Files (x86)\Lua\5.1\lua\D:\Users\Mike\Dropbox\Lua Modeling\utils\lua\init.lua'
no file 'D:\Program Files (x86)\Lua\5.1\D:\Users\Mike\Dropbox\Lua Modeling\utils\lua.lua'
The messages says on the first line that 'D:\Users\Mike\Dropbox\Lua Modeling\utils.lua' was not found, even though that is the full path of the file. What am I doing wrong?
Thanks.
The short answer
You should be able to load utils.lua by using the following code:
require("utils")
And by starting your program from the directory that utils.lua is in:
cd "D:\Users\Mike\Dropbox\Lua Modeling"
lua main.lua
The long answer
To understand what is going wrong here, it is helpful to know a little bit about how require works. The first thing that require does is to search for the module in the module path. From Programming in Lua chapter 8.1:
The path used by require is a little different from typical paths. Most programs use paths as a list of directories wherein to search for a given file. However, ANSI C (the abstract platform where Lua runs) does not have the concept of directories. Therefore, the path used by require is a list of patterns, each of them specifying an alternative way to transform a virtual file name (the argument to require) into a real file name. More specifically, each component in the path is a file name containing optional interrogation marks. For each component, require replaces each ? by the virtual file name and checks whether there is a file with that name; if not, it goes to the next component. The components in a path are separated by semicolons (a character seldom used for file names in most operating systems). For instance, if the path is
?;?.lua;c:\windows\?;/usr/local/lua/?/?.lua
then the call require"lili" will try to open the following files:
lili
lili.lua
c:\windows\lili
/usr/local/lua/lili/lili.lua
Judging from your error message, your Lua path seems to be the following:
.\?.lua;D:\Program Files (x86)\Lua\5.1\lua\?.lua;D:\Program Files (x86)\Lua\5.1\lua\?\init.lua;D:\Program Files (x86)\Lua\5.1\?.lua
To make that easier to read, here are each the patterns separated by line breaks:
.\?.lua
D:\Program Files (x86)\Lua\5.1\lua\?.lua
D:\Program Files (x86)\Lua\5.1\lua\?\init.lua
D:\Program Files (x86)\Lua\5.1\?.lua
From this list you can see that when calling require
Lua fills in the .lua extension for you
Lua fills in the rest of the file path for you
In other words, you should just specify the module name, like this:
require("utils")
Now, Lua also needs to know where the utils.lua file is. The easiest way is to run your program from the D:\Users\Mike\Dropbox\Lua Modeling folder. This means that when you run require("utils"), Lua will expand the first pattern .\?.lua into .\utils.lua, and when it checks that path it will find the utils.lua file in the current directory.
In other words, running your program like this should work:
cd "D:\Users\Mike\Dropbox\Lua Modeling"
lua main.lua
An alternative
If you can't (or don't want to) change your working directory to run the program, you can use the LUA_PATH environment variable to add new patterns to the path that require uses to search for modules.
set LUA_PATH=D:\Users\Mike\Dropbox\Lua Modeling\?.lua;%LUA_PATH%;
lua "D:\Users\Mike\Dropbox\Lua Modeling\main.lua"
There is a slight trick to this. If the LUA_PATH environment variable already exists, then this will add your project's folder to the start of it. If LUA_PATH doesn't exist, this will add ;; to the end, which Lua fills in with the default path.

Atom editor & Processing - 'processing-java' not recognised

I am trying to use bleikamp's Processing package to run Processing sketches from the Atom editor. The package has installed correctly, but running a sketch produces the below error:
'processing-java' is not recognized as an internal or external command, operable program or batch file.
I have added the path to my Processing directory to the PATH environment variable. Can anyone suggest why this is not working?
The problem is almost certainly to do with your PATH. As you've checked the Processing path is correct, there may be something preventing it from being recognised (there are some known issues, such as the PATH variable being too long or having invalid characters).
Solution 1:
Try using FixPath to fix some of the more common problems.
Solution 2:
Try modifying the processing package itself to point directly to processing-java.exe (it points to the PATH variable by default).
In Atom's Settings > Packages, select the processing package and click on 'View Code'.
Make a backup of \lib\processing.coffee to be safe.
In \lib\processing.coffee, search for the following code (probably near the top):
module.exports = Processing =
config:
'processing-executable':
type:"string",
default:"processing-java"
Modify the value of default to point to the exact Processing directory and processing-java.exe, for example:
module.exports = Processing =
config:
'processing-executable':
type:"string",
default:"c:\\program files\\processing\\processing-java.exe"
As Chris rightly points out in the comments below, backslash \ is an escape character in JavaScript and CoffeeScript, so itself needs to be escaped in the file path (hence the double-backslashes \\).
You have to install processing-java command line tool.
In processing, go to Tools -> Install "processing-java"

SymStore - add multiple files

I am trying to add a bunch of .pdb files to the symbol server using symstore.exe. Not all the .pdb's in the dir, but a selection of them (based on date).
To add them in a single transaction I'm using symstore ... /f '#filelist.txt' where filelist.txt is a file containing the real .pdb one per line - just as the command-line help says:
/f File Network path of files or directories to add.
If the named file begins with an '#' symbol, it is treated
as a response file which is expected to contain a list of
files (path and filename, 1 entry per line) to be stored.
(This info exists only in command-line help to symstore, not in the corresponding online help page.)
This just doesn't work, it stores 0 files. I assume that this feature - adding multiple files from a file list - is just not really implemented.
Does anybody have success adding a list of files in a single transaction with symstore.exe?
Finally, I have figured that out. The feature with # and the response file is actually supported.
After using the symstore's /o switch for debugging output I have noticed a weird character ÿþC in the error output
PS C:\Development\symstore add /f #C:\temp\dllsAndPdbsToAdd.txt /s C:\temp\symstore\ /t AwesomeProject
SYMSTORE MESSAGE: 0 alternate indexers registered
SYMSTORE MESSAGE: LastId.txt reported id 8
SYMSTORE MESSAGE: Final id is 0000000008
SYMSTORE ERROR: Class: Internal. Desc: Failed to index C:\Development\AwesomeProject\ÿþC. Line: 169. Error 32
So I changed encoding of the #C:\temp\dllsAndPdbsToAdd.txt file in Notepad++ to ANSI and it worked.

MIT-Scheme for SublimeREPL windows

Getting the error WindowsError(2, 'The system cannot find the file specified.')
I've tried tinkering with the Main.sublime-menu, but kinda uncertain what path I should be putting so i used variations of C:\Program Files (x86)\MIT-GNU Scheme\bin\mit-scheme.exe, including without mit-scheme.exe and using "\\\" (double) instead of just "\" (since that's what was being accepted by sublime which was what i used to edit the file), and also unsure at what point in the Main.sublime-menu I should be altering.
I've read similar solutions, but they're usually in mac where you can easily type which scheme onto the console to get the file path of scheme, so I'm thinking it has to do with me not knowing my correct file path or something? Any ideas?
Add these two env variables to your machine:
MITSCHEME_BIN_PATH=C:\Program Files (x86)\MIT-GNU Scheme\bin
MITSCHEME_LIBRARY_PATH=C:\Program Files (x86)\MIT-GNU Scheme\lib
Config this Main.sublime-menu file like this:
Then it should work. Enjoy it!

Getting the symbols with xperf

I read through the docs and used the commands outlined however for some reason I dont seem to be getting any symbols, just a series of "unknowns" in the function column of the summary table for everything except the topmost set of the app I was trying to debug.... I set the enviromental variable to the microsoft server and the direcories containg the pdb's for the app. I also made sure to select the "Load Symbols" item before bringing up the summary table.
Arcording to the info I was reading it should take some time for the tabl to display while it loads the symbols, however for me the table displayed almost instantly and only the top most items in sprite.exe->sprite.exe had function names, the othe rows for function were either blank or "unknown"
Im using Vista SP1.
This is the batch file I used. Did I do anything that would prevent the sybols being loaded?
REM start profiler
xperf -on PROC_THREAD+LOADER+INTERRUPT+DPC+PROFILE^
-stackwalk profile -minbuffers 16 -maxbuffers 1024 -flushtimer 0^
-f tmp.etl
REM run the app we want to profile
sprite.exe
REM stop
xperf -d profile.etl
REM set symbol path
set _NT_SYMBOL_PATH = ^
C:\Projects\C++\fl lib\bin;^ REM dlls
C:\Projects\C++\fl lib\samples\bin;^ REM main exe
SRV*c:\symbols*http://msdl.microsoft.com/download/symbols
REM display profile
xperf profile.etl
What version of dbghelp.dll is it using? I've had trouble getting PDB symbols working with kernrate and other utilities when using the version of dbghelp.dll that is installed in %SystemRoot%\system32.
You may need to copy dbghelp.dll and symsrv.dll from a recent version of Debugging Tools for Windows into a directory where XPerf can find it.
Also, you need to remove the space before the '=', or else you're defining the "_NT_SYMBOL_PATH " variable (including the trailing space in the name).
Including comments at the end of a line is not going to work either. A line continuation character such as '^' typically needs to be the last character on the line. When I ran that statement (on XP), I ended up with "_NT_SYMBOL_PATH " equal to " C:\Projects\C++\fl lib\bin; REM dlls" and an error about the next line.
Try setting the
TRACE_FORMAT_SEARCH_PATH
environment variable. If that doesn't work, you may have to manually extract the TMF files from your PDBs using TracePdb.exe (or at least use a regular path instead of a SYM* path). This is by far the most annoying part of using ETL traces / XPerf

Resources