Lines Matching +full:sw +full:- +full:exception
1 //===--- ARMEHABIPrinter.h - ARM EHABI Unwind Information Printer ----------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 #include "llvm-readobj.h"
28 ScopedPrinter &SW; variable
65 OpcodeDecoder(ScopedPrinter &SW) : SW(SW), OS(SW.getOStream()) {} in OpcodeDecoder() argument
100 SW.startLine() << format("0x%02X ; vsp = vsp + %u\n", Opcode, in Decode_00xxxxxx()
106 SW.startLine() << format("0x%02X ; vsp = vsp - %u\n", Opcode, in Decode_01xxxxxx()
115 SW.startLine() in Decode_1000iiii_iiiiiiii()
125 SW.startLine() << format("0x%02X ; reserved (ARM MOVrr)\n", Opcode); in Decode_10011101()
130 SW.startLine() << format("0x%02X ; reserved (WiMMX MOVrr)\n", Opcode); in Decode_10011111()
135 SW.startLine() << format("0x%02X ; vsp = r%u\n", Opcode, (Opcode & 0x0f)); in Decode_1001nnnn()
140 SW.startLine() << format("0x%02X ; pop ", Opcode); in Decode_10100nnn()
141 PrintGPR((((1 << ((Opcode & 0x7) + 1)) - 1) << 4)); in Decode_10100nnn()
147 SW.startLine() << format("0x%02X ; pop ", Opcode); in Decode_10101nnn()
148 PrintGPR((((1 << ((Opcode & 0x7) + 1)) - 1) << 4) | (1 << 14)); in Decode_10101nnn()
154 SW.startLine() << format("0x%02X ; finish\n", Opcode); in Decode_10110000()
161 SW.startLine() << format("0x%02X 0x%02X ; %s", Opcode0, Opcode1, in Decode_10110001_0000iiii()
170 SW.startLine() << format("0x%02X ", Opcode); in Decode_10110010_uleb128()
188 SW.startLine() << format("0x%02X 0x%02X ; pop ", Opcode0, Opcode1); in Decode_10110011_sssscccc()
191 PrintRegisters((((1 << (Count + 1)) - 1) << Start), "d"); in Decode_10110011_sssscccc()
197 SW.startLine() << format("0x%02X ; %s\n", Opcode, in Decode_101101nn()
203 SW.startLine() << format("0x%02X ; pop ", Opcode); in Decode_10111nnn()
204 PrintRegisters((((1 << ((Opcode & 0x07) + 1)) - 1) << 8), "d"); in Decode_10111nnn()
211 SW.startLine() << format("0x%02X 0x%02X ; pop ", Opcode0, Opcode1); in Decode_11000110_sssscccc()
214 PrintRegisters((((1 << (Count + 1)) - 1) << Start), "wR"); in Decode_11000110_sssscccc()
221 SW.startLine() in Decode_11000111_0000iiii()
232 SW.startLine() << format("0x%02X 0x%02X ; pop ", Opcode0, Opcode1); in Decode_11001000_sssscccc()
235 PrintRegisters((((1 << (Count + 1)) - 1) << Start), "d"); in Decode_11001000_sssscccc()
242 SW.startLine() << format("0x%02X 0x%02X ; pop ", Opcode0, Opcode1); in Decode_11001001_sssscccc()
245 PrintRegisters((((1 << (Count + 1)) - 1) << Start), "d"); in Decode_11001001_sssscccc()
251 SW.startLine() << format("0x%02X ; spare\n", Opcode); in Decode_11001yyy()
256 SW.startLine() << format("0x%02X ; pop ", Opcode); in Decode_11000nnn()
257 PrintRegisters((((1 << ((Opcode & 0x07) + 1)) - 1) << 10), "wR"); in Decode_11000nnn()
263 SW.startLine() << format("0x%02X ; pop ", Opcode); in Decode_11010nnn()
264 PrintRegisters((((1 << ((Opcode & 0x07) + 1)) - 1) << 8), "d"); in Decode_11010nnn()
270 SW.startLine() << format("0x%02X ; spare\n", Opcode); in Decode_11xxxyyy()
312 (this->*RE.Routine)(Opcodes, OCI); in Decode()
318 SW.startLine() << format("0x%02X ; reserved\n", Opcodes[OCI++ ^ 3]); in Decode()
329 ScopedPrinter &SW; variable
356 PrinterContext(ScopedPrinter &SW, const object::ELFFile<ET> &ELF, in PrinterContext() argument
358 : SW(SW), ELF(ELF), FileName(FileName), Symtab(Symtab) {} in PrinterContext()
402 /// IndexTableOffset. The symbol is the section symbol for the exception in FindExceptionTable()
403 /// handling table. Use this symbol to recover the actual exception handling in FindExceptionTable()
454 /// ARM EHABI Section 6.2 - The generic model in PrintExceptionTable()
456 /// An exception-handling table entry for the generic model is laid out as: in PrintExceptionTable()
460 /// +-+------------------------------+ in PrintExceptionTable()
462 /// +-+------------------------------+ in PrintExceptionTable()
466 /// ARM EHABI Section 6.3 - The ARM-defined compact model in PrintExceptionTable()
468 /// An exception-handling table entry for the compact model looks like: in PrintExceptionTable()
472 /// +-+---+----+-----------------------+ in PrintExceptionTable()
474 /// +-+---+----+-----------------------+ in PrintExceptionTable()
478 *reinterpret_cast<const support::ulittle32_t *>(Contents->data() + TableEntryOffset); in PrintExceptionTable()
481 SW.printString("Model", StringRef("Compact")); in PrintExceptionTable()
484 SW.printNumber("PersonalityIndex", PersonalityIndex); in PrintExceptionTable()
488 PrintOpcodes(Contents->data() + TableEntryOffset, 3, 1); in PrintExceptionTable()
493 PrintOpcodes(Contents->data() + TableEntryOffset, 2 + 4 * AdditionalWords, in PrintExceptionTable()
498 SW.printString("Model", StringRef("Generic")); in PrintExceptionTable()
503 SW.printHex("PersonalityRoutineAddress", Address); in PrintExceptionTable()
507 SW.printString("PersonalityRoutineName", *Name); in PrintExceptionTable()
514 ListScope OCC(SW, "Opcodes"); in PrintOpcodes()
515 OpcodeDecoder(SW).Decode(Entry, Offset, Length); in PrintOpcodes()
526 /// ARM EHABI Section 5 - Index Table Entries in PrintIndexTable()
530 /// - The PREL31 offset of the start of the table entry for the function, in PrintIndexTable()
532 /// - The exception-handling table entry itself with bit 31 set in PrintIndexTable()
533 /// - The special bit pattern EXIDX_CANTUNWIND, indicating that associated in PrintIndexTable()
537 reinterpret_cast<const support::ulittle32_t *>(Contents->data()); in PrintIndexTable()
538 const unsigned Entries = IT->sh_size / IndexTableEntrySize; in PrintIndexTable()
541 ListScope E(SW, "Entries"); in PrintIndexTable()
543 DictScope E(SW, "Entry"); in PrintIndexTable()
565 // For a non-relocatable object, Word0 contains a place-relative signed in PrintIndexTable()
569 ? PREL31(Word0, IT->sh_addr) in PrintIndexTable()
570 : PREL31(Word0, IT->sh_addr + Entry * IndexTableEntrySize); in PrintIndexTable()
571 SW.printHex("FunctionAddress", Address); in PrintIndexTable()
574 // their code sections via the sh_link field. For a non-relocatable ELF file in PrintIndexTable()
578 IsRelocatable ? std::optional<unsigned>(IT->sh_link) : std::nullopt; in PrintIndexTable()
580 SW.printString("FunctionName", *Name); in PrintIndexTable()
583 SW.printString("Model", StringRef("CantUnwind")); in PrintIndexTable()
588 SW.printString("Model", StringRef("Compact (Inline)")); in PrintIndexTable()
591 SW.printNumber("PersonalityIndex", PersonalityIndex); in PrintIndexTable()
593 PrintOpcodes(Contents->data() + Entry * IndexTableEntrySize + 4, 3, 1); in PrintIndexTable()
598 TableEntryAddress = PREL31(Word1, IT->sh_addr); in PrintIndexTable()
602 PREL31(Word1, IT->sh_addr + Entry * IndexTableEntrySize + 4); in PrintIndexTable()
609 SW.printString("ExceptionHandlingTable", *Name); in PrintIndexTable()
611 SW.printHex(IsRelocatable ? "TableEntryOffset" : "TableEntryAddress", in PrintIndexTable()
617 PrintExceptionTable(*EHT, TableEntryAddress - EHT->sh_addr); in PrintIndexTable()
625 DictScope UI(SW, "UnwindInformation"); in PrintUnwindInformation()
630 DictScope UIT(SW, "UnwindIndexTable"); in PrintUnwindInformation()
632 SW.printNumber("SectionIndex", SectionIndex); in PrintUnwindInformation()
635 SW.printString("SectionName", *SectionName); in PrintUnwindInformation()
636 SW.printHex("SectionOffset", Sec.sh_offset); in PrintUnwindInformation()