Commit e6c22a06 authored by Salome Thirot's avatar Salome Thirot Committed by Commit Bot

Modify --trace-deopt output for signed addresses

Modify the output of --trace-deopt to specify which version of the
caller's pc (signed with PAC or unsigned) is shown when CFI is enabled.

Change-Id: I77006839997a5f50d37d65facbba24d8a86a1509
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2274867
Commit-Queue: Martyn Capewell <martyn.capewell@arm.com>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68629}
parent 1dceb970
......@@ -65,7 +65,7 @@ class FrameWriter {
void PushCallerPc(intptr_t pc) {
top_offset_ -= kPCOnStackSize;
frame_->SetCallerPc(top_offset_, pc);
DebugPrintOutputValue(pc, "caller's pc\n");
DebugPrintOutputPc(pc, "caller's pc\n");
}
void PushCallerFp(intptr_t fp) {
......@@ -114,6 +114,20 @@ class FrameWriter {
}
}
void DebugPrintOutputPc(intptr_t value, const char* debug_hint = "") {
#ifdef V8_ENABLE_CONTROL_FLOW_INTEGRITY
if (trace_scope_ != nullptr) {
PrintF(trace_scope_->file(),
" " V8PRIxPTR_FMT ": [top + %3d] <- " V8PRIxPTR_FMT
" (signed) " V8PRIxPTR_FMT " (unsigned) ; %s",
output_address(top_offset_), top_offset_, value,
PointerAuthentication::StripPAC(value), debug_hint);
}
#else
DebugPrintOutputValue(value, debug_hint);
#endif
}
void DebugPrintOutputObject(Object obj, unsigned output_offset,
const char* debug_hint = "") {
if (trace_scope_ != nullptr) {
......@@ -840,9 +854,10 @@ void Deoptimizer::DoComputeOutputFrames() {
MessageFor(deopt_kind_));
PrintFunctionName();
PrintF(trace_scope_->file(),
" @%d => node=%d, pc=" V8PRIxPTR_FMT ", caller sp=" V8PRIxPTR_FMT
", took %0.3f ms]\n",
bailout_id_, node_id.ToInt(), output_[index]->GetPc(),
" @%d => node=%d, pc=" V8PRIxPTR_FMT
" (unsigned), caller sp=" V8PRIxPTR_FMT ", took %0.3f ms]\n",
bailout_id_, node_id.ToInt(),
PointerAuthentication::StripPAC(output_[index]->GetPc()),
caller_frame_top_, ms);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment