| 548 | } |
| 549 | |
| 550 | String X86CPU::InstructionToString(X86Instr* inst, uint32 addr) |
| 551 | { |
| 552 | StringRef annotationsStr; |
| 553 | |
| 554 | SmallVector<char, 256> insnStr; |
| 555 | raw_svector_ostream OS(insnStr); |
| 556 | //mInstPrinter->CurPCRelImmOffset = addr + inst->GetLength(); |
| 557 | mInstPrinter->printInst(&inst->mMCInst, addr, annotationsStr, *mSubtargetInfo, OS); |
| 558 | //OS.flush(); |
| 559 | //llvm::StringRef str = OS.str(); |
| 560 | |
| 561 | String result; |
| 562 | for (int idx = 0; idx < (int)insnStr.size(); idx++) |
| 563 | { |
| 564 | char c = insnStr[idx]; |
| 565 | if (c == '\t') |
| 566 | { |
| 567 | if (idx != 0) |
| 568 | { |
| 569 | int numSpaces = 10 - ((int)result.length() % 10); |
| 570 | result.Append(' ', numSpaces); |
| 571 | } |
| 572 | } |
| 573 | else |
| 574 | result.Append(c); |
| 575 | } |
| 576 | |
| 577 | /*String result = String(insnStr.data(), insnStr.size()); |
| 578 | for (int i = 0; i < (int)result.length(); i++) |
| 579 | { |
| 580 | if (result[i] == '\t') |
| 581 | result[i] = ' '; |
| 582 | }*/ |
| 583 | return result; |
| 584 | } |
| 585 | |
| 586 | DbgBreakKind X86CPU::GetDbgBreakKind(uint32 address, DbgModuleMemoryCache* memoryCache, int32* regs, int32* outObjectPtr) |
| 587 | { |
no test coverage detected