Skip to content

Commit d9dbf0a

Browse files
committed
Fix debug output
1 parent d0b3760 commit d9dbf0a

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

bolt/lib/Passes/PAuthGadgetScanner.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,14 @@ Analysis::computeDfState(BinaryFunction &BF,
446446

447447
PacRetAnalysis PRWIA(BF, AllocatorId, RegsToTrackVec);
448448
PRWIA.run();
449+
LLVM_DEBUG({
450+
dbgs() << " After detailed PacRetAnalysis:\n";
451+
BF.dump();
452+
});
453+
449454
for (auto Report : Result.Diagnostics) {
455+
LLVM_DEBUG(
456+
{ traceInst(BC, "Attaching clobbering info to", Report->Location); });
450457
Report->setOverwritingInstrs(PRWIA.getLastClobberingInsts(
451458
Report->Location, BF, Report->getAffectedRegisters()));
452459
}

bolt/test/binary-analysis/AArch64/gs-pauth-debug-output.s

+3-7
Original file line numberDiff line numberDiff line change
@@ -118,20 +118,16 @@ clobber:
118118
// CHECK-NEXT: .. result: (pacret-state<NonAutClobRegs: W30 , Insts: [0](0x{{[0-9a-f]+}} )>)
119119
// CHECK-NEXT: PacRetAnalysis::ComputeNext( ret x30, pacret-state<NonAutClobRegs: W30 , Insts: [0](0x{{[0-9a-f]+}} )>)
120120
// CHECK-NEXT: .. result: (pacret-state<NonAutClobRegs: W30 , Insts: [0](0x{{[0-9a-f]+}} )>)
121-
// CHECK-NEXT: After PacRetAnalysis:
121+
// CHECK-NEXT: After detailed PacRetAnalysis:
122122
// CHECK-NEXT: Binary Function "clobber" {
123123
// ...
124124
// CHECK: End of Function "clobber"
125125

126126
// The analysis was re-computed with register tracking, as an issue was found in this function.
127-
// Re-checking the instructions:
127+
// Iterating over the reports and attaching clobbering info:
128128

129129
// CHECK-EMPTY:
130-
// CHECK-NEXT: Found RET inst: 00000000: ret # PacRetAnalysis: pacret-state<NonAutClobRegs: BitVector, Insts: [0](0x{{[0-9a-f]+}} )>
131-
// CHECK-NEXT: RetReg: LR
132-
// CHECK-NEXT: Authenticated reg: (none)
133-
// CHECK-NEXT: NonAutClobRegs at Ret: W30
134-
// CHECK-NEXT: Intersection with RetReg: W30
130+
// CHECK-NEXT: Attaching clobbering info to: 00000000: ret # PacRetAnalysis: pacret-state<NonAutClobRegs: BitVector, Insts: [0](0x{{[0-9a-f]+}} )>
135131

136132

137133
// CHECK-LABEL:Analyzing in function main, AllocatorId 1

0 commit comments

Comments
 (0)