MCPcopy Create free account
hub / github.com/beefytech/Beef / InstructionToString

Method InstructionToString

IDEHelper/X86.cpp:550–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

548}
549
550String 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
586DbgBreakKind X86CPU::GetDbgBreakKind(uint32 address, DbgModuleMemoryCache* memoryCache, int32* regs, int32* outObjectPtr)
587{

Callers 2

DisassembleAtRawMethod · 0.45
DisassembleAtMethod · 0.45

Calls 3

AppendMethod · 0.80
sizeMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected