jmorse2 | 3 years ago | on: The Night Watch (2013) [pdf]
jmorse2's comments
jmorse2 | 3 years ago | on: How to read variables optimized out in GDB?
Soooommmee of this can be explained by the design decisions in the compiler not lending themselves to working well with debug-info, as explained here [0] (shamless plug), from about 3 minutes in there's an example of a scenario where a variable location has to be discarded out of conservative precaution (4:40 to 7:00), rather than because it's definitely been optimised out.
jmorse2 | 3 years ago | on: How to read variables optimized out in GDB?
Yes, with DW_OP_entry_value used in location expressions to indicate that the variable value is in a certain location on entry to the function. However -- debuggers typically don't store all register values on entry to all functions, so usually the stack frame up needs to be instrumented with call site information indicating where the debugger can find longer-term stored copies of the arguments.
In TFA you can see that happening correctly wherever there's a "@entry" annotation from gdb for an argument, in some cases there isn't a longer-term copy of the value further up the stack, in which case the variable remains optimised out.
jmorse2 | 3 years ago | on: How to read variables optimized out in GDB?
0x0000564ab5d178c4 <+52>: callq *%rax
=> 0x0000564ab5d178c6 <+54>: mov %rbp,%rdi
%rsi indeed hasn't been clobbered when the call executes, but it becomes liable to be clobbered during the execution of the callee. By the next instruction (at +54) there's no guarantee that %rsi contains the correct value, thus it's best reported as optimised out. The author is handily stopped at a point in time between the two instructions displayed above (in a lower stack frame), where the correct value happens to be in %rsi, but this is not guaranteed to be always true.jmorse2 | 3 years ago | on: The Sad State of Debug Performance in C++
Person slightly doing things to LLVM checking in -- the three points you list are compelling, because it's always going to be difficult to describe one program (source) in terms of a vastly different (optimised) program. Do you think there's mileage in showing the developer a partially optimised program [0] instead of trying to perfectly describe the source? It'd be easier to describe in debug-info, and possibly easier for developers to identify unexpected changes to the code they wrote.
[0] "Non-Transparent Debugging of Optimized Code", 1999
jmorse2 | 3 years ago | on: Google employee resigns after ‘retaliation’ for protesting Israeli contract
jmorse2 | 3 years ago | on: Bible Semantic Search
(I also use it to explain type checking to friends, given the number of times I've looked up a Hebrew word in the Greek dictionary, or vice versa).
jmorse2 | 3 years ago | on: Rustc_codegen_GCC can now bootstrap rustc
jmorse2 | 5 years ago | on: Oxford vaccine shows sustained protection of 76% in 3-month gap til second dose
The entire series is well worth a listen, data driven and statistics heavy.
[0] https://www.bbc.co.uk/sounds/play/m000qblw
Edit - because the beeb want registration, alternate link: https://podcasts.apple.com/gb/podcast/vaccine-hesitancy/id15...
jmorse2 | 5 years ago | on: A Complete Guide to LLVM for Programming Language Creators
You need to create a call to the `llvm.dbg.declare` intrinsic that connects the stack variable alloca to a DILocalVariable metadata node, and place the call after the stack variable alloca. The rest of LLVM will handle tracing the stack location through the compiler to the output, including the alloca being promoted.
See: https://llvm.org/docs/SourceLevelDebugging.html#debugger-int...
jmorse2 | 5 years ago | on: Who Is Debugging the Debuggers? Exposing Debug Bugs in Optimized Binaries
It'd be great to hunt those kinds of bugs, however it's hard to define what the "right" behaviour would be in those circumstances.
jmorse2 | 5 years ago | on: LLVM 11.0
(Ninja edit: although tuning for GDB might coax LLVM to emit the pre-standardised form, without DWARF-5).
jmorse2 | 6 years ago | on: Tin Found in Israel from 3k Years Ago Comes from Cornwall
jmorse2 | 6 years ago | on: Tin Found in Israel from 3k Years Ago Comes from Cornwall
(It really is worth a read; James Mickens is indeed a national treasure).
[0] https://scholar.harvard.edu/files/mickens/files/theslowwinte...