-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect line information/highlighting #114
Comments
Could you please clarify what you mean by "The highlighted line, and the line specified, is not actually the line in which the function is defined"? In any case, it sounds like the problem you are seeing is that the source lines do not match your expectations. However, Very Sleepy itself does not implement decoding of debug information, and merely obtains them from the debug engine / debug information provider used. So, a bug which would cause the wrong line numbers to be reported could be caused by a bug in the compiler, linker, debug information decoder, or something mundane such mismatching debug information from an older build. For DWARF debug information, Very Sleepy uses the Dr. MinGW project to decode the debug information. |
Thank you for the clarification. |
Okay, I had a look at this and I think it's just that the Very Sleepy UI is a little misleading. The debug information is OK. 0x0001bf0a: DW_TAG_subprogram
DW_AT_external (true)
DW_AT_name ("get_possible_moves")
DW_AT_decl_file ("E:\Projects\vscode\_competative\CodinGame\photosynthesis\src/main.cpp")
DW_AT_decl_line (219)
DW_AT_linkage_name ("_Z18get_possible_movesb")
DW_AT_type (0x00007d20 "std::vector<Ply, std::allocator<Ply> >")
DW_AT_low_pc (0x00401e26)
DW_AT_high_pc (0x0040229b)
DW_AT_frame_base (DW_OP_call_frame_cfa)
DW_AT_GNU_all_tail_call_sites (true)
DW_AT_sibling (0x0001c148) In the capture,
So, it's not that 225 is the (incorrect) line number of the start of the function, but rather, the top-most sample that Very Sleepy observed within that function was on line 225. Maybe the column should be renamed to "Line of first sample". |
Is the knowledge of the line that was sampled useful? Would it not make more sense to keep the column "Souce Line", but take the information from the debug rather than the capture? |
There is nothing in the information that Very Sleepy collects that is intrinsically tied to the start of a function. Hypothetically, Very Sleepy could request the debug information engine to tell it the address and line number of the start of each function, though the utility of that information would be purely for cases such as this, and this query would come at additional cost. |
I think that would be useful. I don't know have an idea on much additional cost it would incur so it's up to you. The "Line of first sample" does give the approximate location of the function, which is at least something. It should however, definitely be renamed then. If you do decide to add the start-of-function line, the "line of first sample" seems unnecessary (at least to me). |
The highlighted line, and the line specified, is not actually the line in which the function is defined. I also suspect that the execution times may be on the wrong lines.
Here are the source code, executable, .capture, and input file: src.zip
I compiled the program with the command:
g++ main.cpp -o main.exe -g -Wall
To run the program, run the executable, copy-paste the whole input into the program, and interrupt it when it stops outputting text (Ctrl+C) (the last line should say WAIT).
The text was updated successfully, but these errors were encountered: