Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do the "+n" values mean at the end of a method name in a stack trace?

Tags:

When reading a stack trace like:

[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2755599
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +112
   System.Convert.ToInt32(String value) +68

What do the +68, +112, etc. numbers mean. I'm guessing that they're offsets to something. If so, what?

like image 495
dariom Avatar asked Nov 20 '08 13:11

dariom


People also ask

How do you read a stack trace?

To read this stack trace, start at the top with the Exception's type - ArithmeticException and message The denominator must not be zero . This gives an idea of what went wrong, but to discover what code caused the Exception, skip down the stack trace looking for something in the package com.

What does stack trace mean in C#?

A trace of the method calls is called a stack trace. The stack trace listing provides a way to follow the call stack to the line number in the method where the exception occurs. The StackTrace property returns the frames of the call stack that originate at the location where the exception was thrown.

What does stack trace represent?

What Does Stack Trace Mean? A stack trace is a report that provides information about program subroutines. It is commonly used for certain kinds of debugging, where a stack trace can help software engineers figure out where a problem lies or how various subroutines work together during execution.

What is a stack trace error?

Stack trace error is a generic term frequently associated with long error messages. The stack trace information identifies where in the program the error occurs and is helpful to programmers. For users, the long stack track information may not be very useful for troubleshooting web errors.


2 Answers

I believe they're offsets into the code of the method - whether IL or JIT-compiled-assembly bytes, I'm not sure...

(Basically they're taking the place of line numbers, which of course aren't available without the pdbs.)

like image 103
Jon Skeet Avatar answered Sep 18 '22 17:09

Jon Skeet


It means:

it’s an offset into the native instructions for the method.

Read this for more details.

like image 40
CodingYoshi Avatar answered Sep 21 '22 17:09

CodingYoshi