File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,15 @@ use std::path::Path;
66use std:: time:: Duration ;
77
88// Keep this on the first executable line after consume_pair() returns.
9+ // This is intentionally a negative regression point: at this PC the inline
10+ // parameters have already fallen out of their own location-list coverage, so
11+ // we only assert that GhostScope does not misreport them as consume_pair's
12+ // argument registers. We do not expect post-call value recovery to work until
13+ // full DW_OP_entry_value + caller-side call-site evaluation is implemented.
914const INLINE_AFTER_CALL_TRACE_LINE : u32 = 19 ;
15+ // TODO(positive_test): Add a companion positive test on a pre-call line where
16+ // original_x/original_y are still covered by their own location lists and can
17+ // be asserted with exact values without relying on entry_value support.
1018
1119async fn spawn_inline_call_value_program (
1220 binary_path : & Path ,
Original file line number Diff line number Diff line change @@ -282,6 +282,7 @@ impl<'a> BlockIndexBuilder<'a> {
282282 bn. ranges = ranges;
283283 }
284284 if let Some ( a) = e. attr ( gimli:: constants:: DW_AT_entry_pc ) {
285+ // TODO(dwarf5): Also handle DebugAddrIndex-backed DW_AT_entry_pc.
285286 if let gimli:: AttributeValue :: Addr ( addr) = a. value ( ) {
286287 bn. entry_pc = Some ( addr) ;
287288 }
Original file line number Diff line number Diff line change @@ -344,6 +344,15 @@ impl LoadedObjfile {
344344 }
345345 }
346346
347+ // Keep the parser's direct DWARF result for inline parameters as-is.
348+ // We intentionally do not remap optimized inline params from nested
349+ // call_site_parameter DIEs here: those describe the callee's argument
350+ // locations/values, not the inline function's original parameters, and
351+ // using them here caused false aliases like "original_x = RDI".
352+ // TODO(inline_params): If we want to recover optimized inline params in
353+ // these cases, it has to come from a complete DW_OP_entry_value path that
354+ // evaluates caller-side call-site values, not from the inline body's own
355+ // nested call-site subtree.
347356 let mut seen_param_names: std:: collections:: HashSet < String > =
348357 std:: collections:: HashSet :: new ( ) ;
349358 let mut filtered: Vec < crate :: VariableWithEvaluation > =
Original file line number Diff line number Diff line change @@ -202,8 +202,12 @@ impl ExpressionEvaluator {
202202 debug ! ( "Found DW_OP_stack_value - this is a computed value" ) ;
203203 }
204204 match & op {
205- // Support DW_OP_entry_value minimally for inline parameters:
206- // If inner expression is a single DW_OP_reg*, treat it as a direct value.
205+ // TODO(entry_value): This is only a minimal fallback.
206+ // For inline parameters, a correct DW_OP_entry_value implementation must
207+ // walk back to the caller and evaluate the matching call_site_parameter's
208+ // DW_AT_call_value / DW_AT_GNU_call_site_value. Merely stripping
209+ // entry_value(reg) to a bare register only preserves the simplest cases
210+ // where the parameter is still equivalent to the entry register.
207211 Operation :: EntryValue { expression } => {
208212 let mut inner = * expression;
209213 let mut inner_ops: Vec < Operation < _ > > = Vec :: new ( ) ;
Original file line number Diff line number Diff line change @@ -544,6 +544,7 @@ impl<'a> DwarfParser<'a> {
544544 attrs. ranges_attr = Some ( value) ;
545545 }
546546 gimli:: constants:: DW_AT_entry_pc => {
547+ // TODO(dwarf5): Also handle DebugAddrIndex-backed DW_AT_entry_pc.
547548 if let gimli:: AttributeValue :: Addr ( addr) = value {
548549 attrs. entry_pc = Some ( addr) ;
549550 }
You can’t perform that action at this time.
0 commit comments