src/developer/debug/zxdb/client/substatement.cc
// Appends all inline functions which start in the given location. The Location should identify both
// the address and the block the address is contained in. The result will be sorted by call address.
Appends all inline functions which start in the given location. The Location should identify both
the address and the block the address is contained in. The result will be sorted by call address.
Appends all inline functions which start in the given location . The Location should identify both the address and the block the address is contained in . The result will be sorted by call address .
std::vector<SubstatementCall> GetInlineCallsForLocation(const ProcessSymbols* symbols,
                                                        const Location& loc) {
  std::vector<SubstatementCall> result;
  const Function* func = loc.symbol().Get()->AsFunction();
  if (!func)
    return result;
  const CodeBlock* block = func->GetMostSpecificChild(loc.symbol_context(), loc.address(), false);
  if (!block)
    return result;
  TargetPointer relative_address = loc.symbol_context().AbsoluteToRelative(loc.address());
  for (const auto& child : block->inner_blocks()) {
    const Function* call = child.Get()->AsFunction();
    if (!call || !call->is_inline())
      continue;
    if (call->code_ranges().empty())
      continue;  
    TargetPointer relative_call_addr = call->code_ranges()[0].begin();
    if (relative_call_addr >= relative_address && call->call_line() == loc.file_line()) {
      SubstatementCall& added = result.emplace_back();
      added.call_addr = loc.symbol_context().RelativeToAbsolute(relative_call_addr);
      added.call_dest = added.call_addr;
      added.inline_call = RefPtrTo(call);
    }
  }
  std::sort(result.begin(), result.end());
  return result;
}
std :: vector < SubstatementCall > GetInlineCallsForLocation ( const ProcessSymbols * symbols , const Location & loc ) { std :: vector < SubstatementCall > result ; const Function * func = loc . symbol ( ) . Get ( ) -> AsFunction ( ) ; if ( ! func ) return result ; const CodeBlock * block = func -> GetMostSpecificChild ( loc . symbol_context ( ) , loc . address ( ) , false ) ; if ( ! block ) return result ; TargetPointer relative_address = loc . symbol_context ( ) . AbsoluteToRelative ( loc . address ( ) ) ; for ( const auto & child : block -> inner_blocks ( ) ) { const Function * call = child . Get ( ) -> AsFunction ( ) ; if ( ! call || ! call -> is_inline ( ) ) continue ; if ( call -> code_ranges ( ) . empty ( ) ) continue ; TargetPointer relative_call_addr = call -> code_ranges ( ) [ 0 ] . begin ( ) ; if ( relative_call_addr >= relative_address && call -> call_line ( ) == loc . file_line ( ) ) { SubstatementCall & added = result . emplace_back ( ) ; added . call_addr = loc . symbol_context ( ) . RelativeToAbsolute ( relative_call_addr ) ; added . call_dest = added . call_addr ; added . inline_call = RefPtrTo ( call ) ; } } std :: sort ( result . begin ( ) , result . end ( ) ) ; return result ; }
Appends all inline functions which start in the given location.
Appends all inline functions which start in the given location .
// Move to the deepest code block for the address in question. Don't go into inlines since we're // currently going to search for the inline calls in the range. // Check for inlines that are children of the current block for ones that start at the current // line. // No code for this call, not sure why. // To count as a call from the current line, the call must start after the current address // (the user could have stepped half through a bunch of inlines and we don't want to show the // ones already passed), and the call line must match. // This inline starts in the address range, count it.