LLVM 19.0.0git
FaultMapParser.cpp
Go to the documentation of this file.
1//===----------------------- FaultMapParser.cpp ---------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
11#include "llvm/Support/Format.h"
13
14using namespace llvm;
15
17 switch (FT) {
18 default:
19 llvm_unreachable("unhandled fault type!");
21 OS << "FaultingLoad";
22 break;
24 OS << "FaultingLoadStore";
25 break;
27 OS << "FaultingStore";
28 break;
29 }
30}
31
35 OS << "Fault kind: ";
37 OS << ", faulting PC offset: " << FFI.getFaultingPCOffset()
38 << ", handling PC offset: " << FFI.getHandlerPCOffset();
39 return OS;
40}
41
44 OS << "FunctionAddress: " << format_hex(FI.getFunctionAddr(), 8)
45 << ", NumFaultingPCs: " << FI.getNumFaultingPCs() << "\n";
46 for (unsigned I = 0, E = FI.getNumFaultingPCs(); I != E; ++I)
47 OS << FI.getFunctionFaultInfoAt(I) << "\n";
48 return OS;
49}
50
52 OS << "Version: " << format_hex(FMP.getFaultMapVersion(), 2) << "\n";
53 OS << "NumFunctions: " << FMP.getNumFunctions() << "\n";
54
55 if (FMP.getNumFunctions() == 0)
56 return OS;
57
59
60 for (unsigned I = 0, E = FMP.getNumFunctions(); I != E; ++I) {
61 FI = (I == 0) ? FMP.getFirstFunctionInfo() : FI.getNextFunctionInfo();
62 OS << FI;
63 }
64
65 return OS;
66}
void printFaultType(FaultMapParser::FaultKind FT, raw_ostream &OS)
#define I(x, y, z)
Definition: MD5.cpp:58
raw_pwrite_stream & OS
HandlerPCOffsetType getHandlerPCOffset() const
FaultingPCOffsetType getFaultingPCOffset() const
FunctionInfoAccessor getNextFunctionInfo() const
NumFaultingPCsType getNumFaultingPCs() const
FunctionFaultInfoAccessor getFunctionFaultInfoAt(uint32_t Index) const
A parser for the __llvm_faultmaps section generated by the FaultMaps class declared in llvm/CodeGen/F...
NumFunctionsType getNumFunctions() const
FunctionInfoAccessor getFirstFunctionInfo() const
FaultMapVersionType getFaultMapVersion() const
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
FormattedNumber format_hex(uint64_t N, unsigned Width, bool Upper=false)
format_hex - Output N as a fixed width hexadecimal.
Definition: Format.h:187
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition: APFixedPoint.h:293