Lines Matching +full:os +full:- +full:code +full:- +full:offset

1 //===- Win64EHDumper.cpp - Win64 EH Printer ---------------------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 #include "llvm-readobj.h"
46 - reinterpret_cast<const char*>(&UI);
55 // Returns the name of the unwind code.
56 static StringRef getUnwindCodeTypeName(uint8_t Code) {
57 switch (Code) {
58 default: llvm_unreachable("Invalid unwind code");
94 // Calculates the number of array slots required for the unwind code.
97 default: llvm_unreachable("Invalid unwind code");
144 uint32_t Offset = CoffSym.getValue() + SymbolOffset - CS.getValue();
145 // For the end of a range, don't pick a symbol with a zero offset;
146 // prefer a symbol with a small positive offset.
147 if (Offset <= SymbolOffset && (!IsRangeEnd || Offset > 0)) {
148 SymbolOffset = Offset;
160 const coff_section *Section, uint64_t Offset,
164 raw_string_ostream OS(Buffer);
167 if (!Ctx.ResolveSymbol(Section, Offset, Symbol, Ctx.UserData)) {
168 // We found a relocation at the given offset in the section, pointing
176 OS << *Name;
178 OS << format(" +0x%X (0x%" PRIX64 ")", Displacement, Offset);
180 OS << format(" (0x%" PRIX64 ")", Offset);
181 return OS.str();
190 OS << *Name;
191 OS << format(" (0x%" PRIX64 ")", Ctx.COFF.getImageBase() + Displacement);
192 return OS.str();
199 OS << format("(0x%" PRIX64 ")", Ctx.COFF.getImageBase() + Displacement);
201 OS << format("(0x%" PRIX64 ")", Offset);
202 return OS.str();
207 uint64_t Offset,
212 Ctx.ResolveSymbol(Section, Offset, Symbol, Ctx.UserData))
233 if (VA >= Address && (VA - Address) <= Size)
243 uint64_t Offset,
246 formatSymbol(Ctx, Section, Offset + 0, RF.StartAddress));
248 formatSymbol(Ctx, Section, Offset + 4, RF.EndAddress,
251 formatSymbol(Ctx, Section, Offset + 8, RF.UnwindInfoOffset));
254 // Prints one unwind code. Because an unwind code can occupy up to 3 slots in
265 OS << " reg=" << getUnwindRegisterName(UC[0].getOpInfo());
269 OS << " size="
275 OS << " size=" << (UC[0].getOpInfo() + 1) * 8;
280 OS << " reg=<invalid>";
282 OS << " reg=" << getUnwindRegisterName(UI.getFrameRegister())
283 << format(", offset=0x%X", UI.getFrameOffset() * 16);
287 OS << " reg=" << getUnwindRegisterName(UC[0].getOpInfo())
288 << format(", offset=0x%X", UC[1].FrameOffset * 8);
292 OS << " reg=" << getUnwindRegisterName(UC[0].getOpInfo())
293 << format(", offset=0x%X", getLargeSlotValue(UC));
297 OS << " reg=XMM" << static_cast<uint32_t>(UC[0].getOpInfo())
298 << format(", offset=0x%X", UC[1].FrameOffset * 16);
302 OS << " reg=XMM" << static_cast<uint32_t>(UC[0].getOpInfo())
303 << format(", offset=0x%X", getLargeSlotValue(UC));
307 OS << " errcode=" << (UC[0].getOpInfo() == 0 ? "no" : "yes");
311 OS << "\n";
315 off_t Offset, const UnwindInfo &UI) {
325 SW.printString("FrameRegister", StringRef("-"));
326 SW.printString("FrameOffset", StringRef("-"));
341 UCI = UCI + UsedSlots - 1;
345 uint64_t LSDAOffset = Offset + getOffsetOfLSDA(UI);
366 uint64_t Offset;
367 resolveRelocation(Ctx, Section, SectionOffset + 8, XData, Offset);
368 Offset = Offset + RF.UnwindInfoOffset;
375 Offset = RF.UnwindInfoOffset - XData->VirtualAddress;
385 if (Offset > Contents.size())
388 const auto UI = reinterpret_cast<const UnwindInfo*>(Contents.data() + Offset);
389 printUnwindInfo(Ctx, XData, Offset, *UI);