VS AddIn read callstack

R

Rainer Queck

Hi NG,

currently I am working on a add-in which shell read the callstack and write
it to a file.
The question is, how can I read the current callstack of a debugged
application with a add-in?
I assume there are some framework classes, that can help me on this task but
I have no idea which ones that are.

Thanks for hints and help on this problem in advance.

Regards
Rainer Queck
 
W

Walter Wang [MSFT]

Hi Rainer,

I think you can use the Thread.StackFrames property to get the call stack:

#Thread.StackFrames Property (EnvDTE)
http://msdn2.microsoft.com/en-us/library/envdte.thread.stackframes(VS.80).as
px


Please let me know if this works for you.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
R

Rainer Queck

Hello Walter,

thanks for your help.

Walter Wang said:
Hi Rainer,

I think you can use the Thread.StackFrames property to get the call stack:

#Thread.StackFrames Property (EnvDTE)
http://msdn2.microsoft.com/en-us/library/envdte.thread.stackframes(VS.80).as
px


Please let me know if this works for you.
Yes it looks, like this brings me closer to the solution, but ....
itterating through the stackframes, how can I find out (by code) which
stackframe belongs to the method, where I set the breakpoint at?

Regards
Rainer
 
R

Rainer Queck

Hi Walter,

Rainer Queck said:
Yes it looks, like this brings me closer to the solution, but ....
itterating through the stackframes, how can I find out (by code) which
stackframe belongs to the method, where I set the breakpoint at?

Just found the answer to my question:
EnvDTE.Thread aThread = dte.Debugger.CurrentThread;
gives me what I need.

Thanks for your help!

Regards
Rainer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top