Reading Stack Trace

J

Jop

Hi guys,

I'm trying to debug a deployed application (no debug symbols) and what
I got is a stack trace similar to this one. What does the '+' prefixed
number after the method name signify?

[ApplicationException: Hello, World!]
ASP.Default_cs_aspx.Page_Load() +34
System.Web.Util.ArglessEventHandlerDelegateProxy.Callback(Object
sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731

Thanks.
/jop
 
G

Guest

+ prefix mean location of the exception can be identified
where it originated in the code.
 
J

Jop

Thanks for the info, but where exactly is number pointing to? It is not
the line number because the application does not have source/debug info
to get the numbers from. The stack trace in question came from the code
below. What is the link between the number +34 in the above stack trace
to the line throwing the exception.

Is it possible to translate the +numbers into something more useful? I
guess there should be: why display something that we can not use?

<%@ Page language="c#" AutoEventWireup="true"%>
<script runat="server">
void Page_Load()
{
throw new ApplicationException("Hello, World!");
}
</script>
<html>
<body>
<form runat="server"></form>
</body>
</html>

Cheers,
/jop
 
J

Jop

Thanks for the info, but where exactly is number pointing to? It is not
a line number because the application does not have source/debug info
to get the numbers from. The stack trace in question came from the code
below. What is the link between the number +34 in the above stack trace
to the line throwing the exception.

Is it possible to translate the +numbers into something more useful? I
guess there should be: why display something that we can not use?

<%@ Page language="c#" AutoEventWireup="true"%>
<script runat="server">
void Page_Load()
{
throw new ApplicationException("Hello, World!");
}
</script>
<html>
<body>
<form runat="server"></form>
</body>
</html>
 
J

Jop

Thanks for the info, but where exactly is number pointing to? It is not
the line number because the application does not have source/debug info
to get the numbers from. The stack trace in question came from the code
below. What is the link between the number +34 in the above stack trace
to the line throwing the exception.

Is it possible to translate the +numbers into something more useful? I
guess there should be: why display something that we can not use?

<%@ Page language="c#" AutoEventWireup="true"%>
<script runat="server">
void Page_Load()
{
throw new ApplicationException("Hello, World!");
}
</script>
<html>
<body>
<form runat="server"></form>
</body>
</html>

Cheers,
/jop
 
G

Guest

page_load event handle by +34
onload event handle +64
each event has particular event handler which is invoked
by numbers having prefix +
 
J

Jop

I'm sorry but I still don't get it. What does the numbers mean?

For example, if a program with debug info throws an exception, it will
print out a similar stack trace. But instead of a +prefixed number, it
shows the line number where the exception occurred.

However, if the program does not have debug info, it shows the
+prefixed number instead. I would expect that the +prefixed number
would carry the same type of information (i.e. line number). Even if
debug info is not available, it should be something similar, like IL
code offset in the methods, etc...

Any ideas?
 
S

Steven Spits

Jop said:
Even if debug info is not available, it should be something similar,
like IL code offset in the methods, etc...

My guess would be that you're right. Without debug info, it's probably
showing an offset in the compiled DLL.

Have you tried ILDASM to see what's inside the Page_Load?

Steven

- - -
 
S

Scott Allen

It is, I believe, an offset into the JIT'ed code - that is the native code.
If you have WinDbg you could disassemble the native code for Page_Load and
have a better idea of where the exception occured, but being native it is
sometimes difficult to map back the instruction to a specific line in C#/VB
or even IL. It would be easier to set the project options to "generate debugging
information" and have a line number to work from.
 
S

Scott Allen

Actually, yes - it is the byte offset into native code.

I think I'll make a blog entry out of how to track this down later tonight.
 
Joined
Nov 1, 2010
Messages
1
Reaction score
0
Old one, but maybe it'll help somebody in the future...
This is what I found usefull reading stack traces: csharp.hostzi.com
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top