backward-cpp icon indicating copy to clipboard operation
backward-cpp copied to clipboard

Line number in source is off by 1 always

Open planetchili opened this issue 2 years ago • 1 comments

I find that when I look at the snippets, the line indicated is always the next line (skipping whitespace) after the one containing the call.

Stack trace (most recent call last):
#6    Object "", at 00007FFE109B7614, in BaseThreadInitThunk
#5 
   D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp(17): mainCRTStartup
#4 
   D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(331): __scrt_common_main
#3 
   D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(288): __scrt_common_main_seh
#2 
   D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(79): invoke_main
#1 
   C:\Users\Chili\Desktop\cpp\Chil\ConsoleSandbox\Main.cpp(33): main
         30: 	chilog.warn(L"huh");
         31: 	f();
         32: 
      >  33: 	return 0;
         34: }
#0 
   C:\Users\Chili\Desktop\cpp\Chil\ConsoleSandbox\Main.cpp(19): f
         16: void f()
         17: {
         18: 	chilog.error(L"oops!");
      >  19: }
         20: 
         21: int main()
         22: {

I see that this is not the case in the screenshots provided in the repo readme. Is there any way to get the resolver to indicate the correct line?

planetchili avatar Feb 07 '23 04:02 planetchili

I have the same problem that for me on some machines for some reason the stack trace is off by one line. While this is not really an issue in most cases because it is clear where the exception actually comes from, this can be many misleading at times.

hofmannu avatar Apr 04 '24 13:04 hofmannu