Reading Stack Trace

Discussion in 'ASP .Net' started by Jop, Jan 24, 2005.

  1. Jop

    Jop Guest

    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
    Jop, Jan 24, 2005
    #1
    1. Advertising

  2. Jop

    Guest Guest

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

    >-----Original Message-----
    >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
    >
    >.
    >
    Guest, Jan 24, 2005
    #2
    1. Advertising

  3. Jop

    Jop Guest

    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
    Jop, Jan 24, 2005
    #3
  4. Jop

    Jop Guest

    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>
    Jop, Jan 24, 2005
    #4
  5. Jop

    Jop Guest

    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
    Jop, Jan 24, 2005
    #5
  6. Jop

    Guest Guest

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

    >-----Original Message-----
    >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>
    >
    >.
    >
    Guest, Jan 24, 2005
    #6
  7. Jop

    Jop Guest

    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, Jan 24, 2005
    #7
  8. Jop

    Steven Spits Guest

    "Jop" wrote:

    > 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

    - - -
    Steven Spits, Jan 24, 2005
    #8
  9. Jop

    Scott Allen Guest

    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.

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    > 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?
    >
    Scott Allen, Jan 24, 2005
    #9
  10. Jop

    Scott Allen Guest

    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.

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    > 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.
    >
    > --
    > Scott
    > http://www.OdeToCode.com/blogs/scott/
    >> 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?
    >>
    Scott Allen, Jan 24, 2005
    #10
  11. Jop

    formtc

    Joined:
    Nov 1, 2010
    Messages:
    1
    Old one, but maybe it'll help somebody in the future...
    This is what I found usefull reading stack traces: csharp.hostzi.com
    formtc, Nov 1, 2010
    #11
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rukmal Fernando
    Replies:
    4
    Views:
    845
    Richard Grimes [MVP]
    Oct 27, 2003
  2. Matthias S.
    Replies:
    1
    Views:
    646
    Daniel Fisher\(lennybacon\)
    Nov 30, 2005
  3. Jiho Han
    Replies:
    0
    Views:
    515
    Jiho Han
    Aug 22, 2006
  4. =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=

    Adding my messages to the trace.axd trace?

    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Apr 6, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    591
    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=
    Apr 6, 2007
  5. Chris Newby
    Replies:
    0
    Views:
    766
    Chris Newby
    Jul 28, 2008
Loading...

Share This Page