Reading Stack Trace

  • Thread starter Thread starter Jop
  • Start date Start date
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
 
+ prefix mean location of the exception can be identified
where it originated in the code.
 
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
 
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>
 
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
 
page_load event handle by +34
onload event handle +64
each event has particular event handler which is invoked
by numbers having prefix +
 
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?
 
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

- - -
 
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.
 
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.
 
Back
Top