- I->UnwindInfoOffset);
- outs() << "\n";
-
- ArrayRef<uint8_t> XContents;
- uint64_t UnwindInfoOffset = 0;
- if (error(getSectionContents(Obj, Rels, SectionOffset +
- /*offsetof(RuntimeFunction, UnwindInfoOffset)*/ 8,
- XContents, UnwindInfoOffset))) continue;
- if (XContents.empty()) continue;
-
- UnwindInfoOffset += I->UnwindInfoOffset;
- if (UnwindInfoOffset > XContents.size()) continue;
-
- const Win64EH::UnwindInfo *UI =
- reinterpret_cast<const Win64EH::UnwindInfo *>
- (XContents.data() + UnwindInfoOffset);
-
- // The casts to int are required in order to output the value as number.
- // Without the casts the value would be interpreted as char data (which
- // results in garbage output).
- outs() << " Version: " << static_cast<int>(UI->getVersion()) << "\n";
- outs() << " Flags: " << static_cast<int>(UI->getFlags());
- if (UI->getFlags()) {
- if (UI->getFlags() & UNW_ExceptionHandler)
- outs() << " UNW_ExceptionHandler";
- if (UI->getFlags() & UNW_TerminateHandler)
- outs() << " UNW_TerminateHandler";
- if (UI->getFlags() & UNW_ChainInfo)
- outs() << " UNW_ChainInfo";
- }
- outs() << "\n";
- outs() << " Size of prolog: "
- << static_cast<int>(UI->PrologSize) << "\n";
- outs() << " Number of Codes: "
- << static_cast<int>(UI->NumCodes) << "\n";
- // Maybe this should move to output of UOP_SetFPReg?
- if (UI->getFrameRegister()) {
- outs() << " Frame register: "
- << getUnwindRegisterName(UI->getFrameRegister())
- << "\n";
- outs() << " Frame offset: "
- << 16 * UI->getFrameOffset()
- << "\n";
- } else {
- outs() << " No frame pointer used\n";
- }
- if (UI->getFlags() & (UNW_ExceptionHandler | UNW_TerminateHandler)) {
- // FIXME: Output exception handler data
- } else if (UI->getFlags() & UNW_ChainInfo) {
- // FIXME: Output chained unwind info
- }