473,326 Members | 2,655 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,326 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 7218
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.