tags:

views:

426

answers:

2

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?

+4  A: 

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.)

Jon Skeet
They're byte offsets from the start of the function to the return address.
plinth
But in IL or machine code?
Jon Skeet
Don't know - I was disambiguating that they go to the return address. :)
plinth
By "return address" do you mean "where the next level in the stack would return to" (i.e. next statement)? Otherwise it sounds like you mean a return statement within the code, which would be pretty useless.
Jon Skeet
"when control is returned to the caller, this is the address from which execution will resume" (eg, the conventional meaning of return address)
plinth
I believe they are offset to machine code bytes. In a stack trace that I have the offset is +452 and the last function IL instruction is at 0x102 (unfortunately - since I'd like to be able to determine what instruction causes problems).
rslite
+2  A: 

it is the byte offset into native code.

With ILDASM you know why.

MysticSlayer
ILDASM won't show you the native code though - did you mean byte offset into the IL?
Jon Skeet