473,498 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1104
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
36375
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
1763
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
2054
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
2641
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
3657
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
261
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
4310
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
1889
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
1981
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
7126
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
7005
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
7168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7381
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4916
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
4595
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
3096
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
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.