473,439 Members | 5,047 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,439 software developers and data experts.

stackwalk / callstack and symbol resolve of managed and unmanaged code - dbghelp, etc.

We use StackWalk(StackWalk64) from dbghelp.dll to walk our
callstacksas needed, using the various Sym* methods
(SymGetSymFromAddr, SymGetLineFromAddr) to resolve source file,
function name, and source line number for each frame. This works fine
for unmanaged code, but when we have a call stack that goes into or
through some managed code, we cannot resolve any info for the managed
frames - we can however, get all the information for the unmanaged
frames in the stack, both before and after the managed frames.

Is there a way to get the dbghelp functions to resolve the managed
frame info? I tried all the latest dbghelp versions, up thru 6.3.5.1,
and it still doesn't work. It looks like 6.1 added a new method
SymFromToken that supports managed code, but what about supporting
managed code with the other methods? For the exact same callstack
that dbghelp cannot resolve info for, the debugger in visual
studio.net CAN resolve info for (if set for Mixed-mode debugging). Is
this because VS.net uses DIA instead of, or in addition to, dbghelp?
Will microsoft ever add full support for managed code in dbghelp? Is
there some other way to get this info? I know I can get a managed
call stack from within managed code by using the stacktrace classes,
but in some cases, this isn't practical - such as in an app that has
both managed and unmanaged code creating threads - unhandled
exceptions that occur in the unmanaged threads, perhaps once the
thread has travelled thru managed code to get to the point causing the
exception, are not readily catchable in managed code (we end up
catching them in the uhe handler specified via Win32). So at this
point, we have a call stack that has both managed and unmanaged.
Ideas?

So, will the Sym* (dbghelp) be supported for managed?
Do I need to use DIA?
What about IDebug* interfaces (from the "debugger engine" stuff from
"Debugging tools for windows")?
What about ICorDebug* (from the CLR)?

we already re-wrote our stackwalker once (to go manual debug info
walking to using dbghelp); do we now need to re-write again? If so,
to what? Will it change?

thanks for any help!
Nov 17 '05 #1
2 7232
any help from Microsoft on this one

----- asanford wrote: ----

We use StackWalk(StackWalk64) from dbghelp.dll to walk ou
callstacksas needed, using the various Sym* method
(SymGetSymFromAddr, SymGetLineFromAddr) to resolve source file
function name, and source line number for each frame. This works fin
for unmanaged code, but when we have a call stack that goes into o
through some managed code, we cannot resolve any info for the manage
frames - we can however, get all the information for the unmanage
frames in the stack, both before and after the managed frames

Is there a way to get the dbghelp functions to resolve the manage
frame info? I tried all the latest dbghelp versions, up thru 6.3.5.1
and it still doesn't work. It looks like 6.1 added a new metho
SymFromToken that supports managed code, but what about supportin
managed code with the other methods? For the exact same callstac
that dbghelp cannot resolve info for, the debugger in visua
studio.net CAN resolve info for (if set for Mixed-mode debugging). I
this because VS.net uses DIA instead of, or in addition to, dbghelp?
Will microsoft ever add full support for managed code in dbghelp? I
there some other way to get this info? I know I can get a manage
call stack from within managed code by using the stacktrace classes
but in some cases, this isn't practical - such as in an app that ha
both managed and unmanaged code creating threads - unhandle
exceptions that occur in the unmanaged threads, perhaps once th
thread has travelled thru managed code to get to the point causing th
exception, are not readily catchable in managed code (we end u
catching them in the uhe handler specified via Win32). So at thi
point, we have a call stack that has both managed and unmanaged.
Ideas

So, will the Sym* (dbghelp) be supported for managed
Do I need to use DIA
What about IDebug* interfaces (from the "debugger engine" stuff fro
"Debugging tools for windows")
What about ICorDebug* (from the CLR)

we already re-wrote our stackwalker once (to go manual debug inf
walking to using dbghelp); do we now need to re-write again? If so
to what? Will it change

thanks for any help

Nov 17 '05 #2
To create mixed (managed and native) call stacks, you need to use both
ICorDebug* and DIA, then do post processing to interleave the frames
correctly. You can resolve managed call stacks with ICorDebug* from
cordebug.h and IMetaData* from cor.h. EnumerateChains on ICorDebugThread is
a starting point.

HabibH.

"asanford" <an*******@discussions.microsoft.com> wrote in message
news:99**********************************@microsof t.com...
any help from Microsoft on this one?

----- asanford wrote: -----

We use StackWalk(StackWalk64) from dbghelp.dll to walk our
callstacksas needed, using the various Sym* methods
(SymGetSymFromAddr, SymGetLineFromAddr) to resolve source file,
function name, and source line number for each frame. This works fine for unmanaged code, but when we have a call stack that goes into or
through some managed code, we cannot resolve any info for the managed
frames - we can however, get all the information for the unmanaged
frames in the stack, both before and after the managed frames.

Is there a way to get the dbghelp functions to resolve the managed
frame info? I tried all the latest dbghelp versions, up thru 6.3.5.1, and it still doesn't work. It looks like 6.1 added a new method
SymFromToken that supports managed code, but what about supporting
managed code with the other methods? For the exact same callstack
that dbghelp cannot resolve info for, the debugger in visual
studio.net CAN resolve info for (if set for Mixed-mode debugging). Is this because VS.net uses DIA instead of, or in addition to, dbghelp?
Will microsoft ever add full support for managed code in dbghelp? Is
there some other way to get this info? I know I can get a managed
call stack from within managed code by using the stacktrace classes,
but in some cases, this isn't practical - such as in an app that has
both managed and unmanaged code creating threads - unhandled
exceptions that occur in the unmanaged threads, perhaps once the
thread has travelled thru managed code to get to the point causing the exception, are not readily catchable in managed code (we end up
catching them in the uhe handler specified via Win32). So at this
point, we have a call stack that has both managed and unmanaged.
Ideas?

So, will the Sym* (dbghelp) be supported for managed?
Do I need to use DIA?
What about IDebug* interfaces (from the "debugger engine" stuff from
"Debugging tools for windows")?
What about ICorDebug* (from the CLR)?

we already re-wrote our stackwalker once (to go manual debug info
walking to using dbghelp); do we now need to re-write again? If so,
to what? Will it change?

thanks for any help!

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Eric Twietmeyer | last post by:
Hello, I'm starting to investigate cs, managed c++ and interoperating with a very large unmanaged code base. We are going to use Windows Forms (written in cs) to replace our old fashioned GUI. ...
12
by: doug | last post by:
I understand the basics of what managed code offers and that you open yourself up to security issues if you allow unmanaged code. We already have a decent amount of VB6 code to include COM DLLs. ...
6
by: guxu | last post by:
I have a managed C++ code which calls some methods in unmanaged C++ DLL. In my unmanaged DLL, I have a PROTECTED virutal function in a base class and derived class has a PRIVATE function which...
9
by: Amit Dedhia | last post by:
Hi All I have a VC++ 2005 MFC application with all classes defined as unmanaged classes. I want to write my application data in xml format. Since ADO.NET has buit in functions available for...
1
by: vsp15584 | last post by:
Hii..i use the coding as below :- import java.applet.applet; import java.awt.*; import com.sun.j3d.utils.applet.mainframe; import com.sun.j3d.utils.universe.*; import...
25
by: Koliber (js) | last post by:
sorry for my not perfect english i am really f&*ckin angry in this common pattern about dispose: ////////////////////////////////////////////////////////// Public class...
3
by: Sindhu Rani | last post by:
i hav created 3 classes in 3 different files. am gettin an error durin compilation. wat shud i do??? C:\s\source>javac -d ..\classes devtestdrive.java devtestdrive.java:5: cannot resolve symbol...
3
by: ajtaylor | last post by:
I have an set of unmanaged C++ libraries that I have been successfully using in a C++/CLI assembly which is in turn used by some other .NET code (ASP.NET/C#). The C++ makes a lot of use of Boost...
0
by: =?Utf-8?B?Zmplcm9uaW1v?= | last post by:
Hi all, As I mentioned in a previous thread (see 'Dbghelp, symbols and templates' in microsoft.public.windbg), we created a powerful symbol engine using dbghelp to dump the contents of the stack...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.