Getting Symbols Working
-
I have VS 2008 installed. I have an issue and I'm trying to track down the win32 functions that are invoking it. I want to see the function names for user32.dll and ntdll.dll, among others. I've really tried everything I can think of to get this to work, but nothing seems to work. Most of the sources are for c# and various components around c#. I've tried re-running the VC2008 install to see if I missed something, but 'yay', it fails to load the installation components during the setup startup. I'm on Win7 64bit, VS2008 32bit trying to write/debug a 32bit DLL written in C++. It's remarkably frustrating, as everything I've read seems to indicate it should 'just work', and yet... Pointers/suggestions greatly appreciated.
-
I have VS 2008 installed. I have an issue and I'm trying to track down the win32 functions that are invoking it. I want to see the function names for user32.dll and ntdll.dll, among others. I've really tried everything I can think of to get this to work, but nothing seems to work. Most of the sources are for c# and various components around c#. I've tried re-running the VC2008 install to see if I missed something, but 'yay', it fails to load the installation components during the setup startup. I'm on Win7 64bit, VS2008 32bit trying to write/debug a 32bit DLL written in C++. It's remarkably frustrating, as everything I've read seems to indicate it should 'just work', and yet... Pointers/suggestions greatly appreciated.
Craig Longman wrote:
I have an issue and I'm trying to track down the win32 functions that are invoking it. I want to see the function names for user32.dll and ntdll.dll, among others.
Could you try clarifying what you mean here, I cannot quite figure out what your problem is.
It's time for a new signature.
-
Craig Longman wrote:
I have an issue and I'm trying to track down the win32 functions that are invoking it. I want to see the function names for user32.dll and ntdll.dll, among others.
Could you try clarifying what you mean here, I cannot quite figure out what your problem is.
It's time for a new signature.
Of course. What I see in the call stack is something like:
>user32.dll!75956238()
I'd rather see:
Main.dll!CPluginPP::SubclassDialogWndProc0(HWND__ * hWnd=0x000204f2, unsigned int uiMsg=5, unsigned int wParam=0, long lParam=31130780) Line 256
Or at least the module, function/method and parameter list.
-
Of course. What I see in the call stack is something like:
>user32.dll!75956238()
I'd rather see:
Main.dll!CPluginPP::SubclassDialogWndProc0(HWND__ * hWnd=0x000204f2, unsigned int uiMsg=5, unsigned int wParam=0, long lParam=31130780) Line 256
Or at least the module, function/method and parameter list.
I do not think that this information is available; system libraries are not distributed with debug information, so the debugger cannot provide what you want. You can get some information about the function names by using the Dependency Walker[^] program, which can also link you to the MSDN documentation for the functions.
Just say 'NO' to evaluated arguments for diadic functions! Ash
-
I do not think that this information is available; system libraries are not distributed with debug information, so the debugger cannot provide what you want. You can get some information about the function names by using the Dependency Walker[^] program, which can also link you to the MSDN documentation for the functions.
Just say 'NO' to evaluated arguments for diadic functions! Ash
I'm pretty sure you can... it really doesn't need debugging information in the DLL, just the PDB that has addresses for functions and parameter information to interpret the stack. Having stack optimisation disabled can help, and I think that they system DLLs are compiled like that anyway. There are all sorts of bits of information out there, but even just loading directly from the microsoft symbol server doesn't work. I'm sure some simple step is being missed, unless there just really isn't one for Win7 64 yet. Or if I can't debug it properly as I'm on 64bit but developing 32bit... More things to try and wade through. If anyone has had success on win7 64, please shout out. Thanks,
CraigL
-
I'm pretty sure you can... it really doesn't need debugging information in the DLL, just the PDB that has addresses for functions and parameter information to interpret the stack. Having stack optimisation disabled can help, and I think that they system DLLs are compiled like that anyway. There are all sorts of bits of information out there, but even just loading directly from the microsoft symbol server doesn't work. I'm sure some simple step is being missed, unless there just really isn't one for Win7 64 yet. Or if I can't debug it properly as I'm on 64bit but developing 32bit... More things to try and wade through. If anyone has had success on win7 64, please shout out. Thanks,
CraigL
Craig Longman wrote:
it really doesn't need debugging information in the DLL, just the PDB
Sure, except such files are never part of the commercial Windows distributions. As far as I am aware the only way to get them is by signing up to one of Microsoft's special category programs, such as Beta tester/developer or similar. They then give you access to all sorts of extra tools and resources not available to Joe Public. I can't remember how you get on to such a program but think it may be connected to MSDN subscriptions.
Just say 'NO' to evaluated arguments for diadic functions! Ash
-
Craig Longman wrote:
it really doesn't need debugging information in the DLL, just the PDB
Sure, except such files are never part of the commercial Windows distributions. As far as I am aware the only way to get them is by signing up to one of Microsoft's special category programs, such as Beta tester/developer or similar. They then give you access to all sorts of extra tools and resources not available to Joe Public. I can't remember how you get on to such a program but think it may be connected to MSDN subscriptions.
Just say 'NO' to evaluated arguments for diadic functions! Ash
You might be thinking of checked builds, when there all the parameter validation/integrity is checked in all the system calls. The symbol files are relatively freely available. Microsoft has symbol servers that you can point VS to (http://referencesource.microsoft.com/symbols) or you can download the symbols for either retail or checked from here: http://www.microsoft.com/whdc/devtools/debugging/symbolpkg.mspx Unfortunately, I can't seem to get the common ones like user32.dll recognized. Some of the more esoteric ones seem to load fine though. Although both my build and the install seem to be for Win7 v6.1 build 7600, for some reason it's not matching checksums. I guess I'll probably end up setting up an XP machine to do this if I need it, I guess Win7 is perhaps too new to have proper symbols available. Or the OEM ones are different, or something. Frustrating.
-
You might be thinking of checked builds, when there all the parameter validation/integrity is checked in all the system calls. The symbol files are relatively freely available. Microsoft has symbol servers that you can point VS to (http://referencesource.microsoft.com/symbols) or you can download the symbols for either retail or checked from here: http://www.microsoft.com/whdc/devtools/debugging/symbolpkg.mspx Unfortunately, I can't seem to get the common ones like user32.dll recognized. Some of the more esoteric ones seem to load fine though. Although both my build and the install seem to be for Win7 v6.1 build 7600, for some reason it's not matching checksums. I guess I'll probably end up setting up an XP machine to do this if I need it, I guess Win7 is perhaps too new to have proper symbols available. Or the OEM ones are different, or something. Frustrating.
Craig Longman wrote:
You might be thinking of checked builds
Possibly, it's a long time since I saw a system like this. Personally I have never had the need for symbol tables of system libraries, as I have never had a bug in any of my programs that wasn't my fault.
Just say 'NO' to evaluated arguments for diadic functions! Ash
-
Craig Longman wrote:
You might be thinking of checked builds
Possibly, it's a long time since I saw a system like this. Personally I have never had the need for symbol tables of system libraries, as I have never had a bug in any of my programs that wasn't my fault.
Just say 'NO' to evaluated arguments for diadic functions! Ash
Hehehe... then you've been lucky. =) However, the symbols aren't much good for that, but they are very helpful to see why you're being called. I'm currently working on a plug-in, and I don't always know why the host app is doing something, and have some named function trace can be very helpful indeed.