473,408 Members | 2,734 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,408 software developers and data experts.

Getting parameters to method calls in a stack tract

I am using Visual Studio 2003. When an exception trown (and trapped
by a try statement) in a managed language (say, C#), I'd like to get
the values sent to all the parameters in the stack trace. So, for
example, if the error is something like:

ERROR: The program has performed the following error: Error in
foobar2: Object reference not set to an instance of an object.
at method2(string x, int z)
at method3(ArrayList q, float t)

I'd like to figure out what x, z, q, and t were in the catch clause.

I know you can do this in the debugger, but I need to find get this
information when an exception is thrown while the program is running
on a client machine and not in the development environment (remote
debugging is not an option).

Thanks,
Codex
Jul 21 '05 #1
1 1101
Codex <co**************@yahoo.com> wrote:
I am using Visual Studio 2003. When an exception trown (and trapped
by a try statement) in a managed language (say, C#), I'd like to get
the values sent to all the parameters in the stack trace. So, for
example, if the error is something like:

ERROR: The program has performed the following error: Error in
foobar2: Object reference not set to an instance of an object.
at method2(string x, int z)
at method3(ArrayList q, float t)

I'd like to figure out what x, z, q, and t were in the catch clause.


You can't, unless you're running in the debugger and using the
debugging APIs.

When running, the values may no longer be considered "live" - for
instance, the ArrayList may have been garbage collected by the time
your exception is thrown.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2

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

Similar topics

5
by: Andy | last post by:
Hi Could someone clarify for me the method parameter passing concept? As I understand it, if you pass a variable without the "ref" syntax then it gets passed as a copy. If you pass a...
2
by: juchytil | last post by:
Here is a method that calls a static GetInfo() method on the MyObject class. public void MethodName(string param1, int param2) { MyObject.GetInfo(); } Is there any way for the GetInfo()...
2
by: Samba | last post by:
Hi, Mine is a very basic doubt ... (1) If we are using a static field/object, then the field/object is shared across all the places in the entire application as it is stored only at one...
18
by: IMSHURKKPWII | last post by:
Hi all, I am confused about the methods by which C passes things to other routines. If I have a routine, void rt( , , ...); Then I know that the process to call this function is this: ...
7
by: Brad Quinn | last post by:
Is there a way to get the values of the paramaters to a method programatically? I know that I can use reflection to find out the parameter names and types, etc., but I want to know the values...
1
by: Codex | last post by:
I am using Visual Studio 2003. When an exception trown (and trapped by a try statement) in a managed language (say, C#), I'd like to get the values sent to all the parameters in the stack trace. ...
18
by: John Friedland | last post by:
My problem: I need to call (from C code) an arbitrary C library function, but I don't know until runtime what the function name is, how many parameters are required, and what the parameters are. I...
7
by: Kenneth Brody | last post by:
The recent thread on "query about main()" got me thinking... As I recall, calling a function with the wrong parameters causes undefined behavior. (These all assume that no prototype of foo()...
0
by: aboutjav.com | last post by:
Hi, I need some help. I am getting this error after I complete the asp.net register control and click on the continue button. It crashed when it tries to get it calls this Profile property ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
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...

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.