本文整理汇总了C++中PrintStream::printf方法的典型用法代码示例。如果您正苦于以下问题:C++ PrintStream::printf方法的具体用法?C++ PrintStream::printf怎么用?C++ PrintStream::printf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PrintStream
的用法示例。
在下文中一共展示了PrintStream::printf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dump
void VariableEvent::dump(PrintStream& out) const
{
switch (kind()) {
case Reset:
out.printf("Reset");
break;
case BirthToFill:
dumpFillInfo("BirthToFill", out);
break;
case BirthToSpill:
dumpSpillInfo("BirthToSpill", out);
break;
case Fill:
dumpFillInfo("Fill", out);
break;
case Spill:
dumpSpillInfo("Spill", out);
break;
case Death:
out.print("Death(", id(), ")");
break;
case MovHint:
out.print("MovHint(", id(), ", r", operand(), ")");
break;
case SetLocalEvent:
out.printf("SetLocal(r%d, %s)", operand(), dataFormatToString(dataFormat()));
break;
default:
RELEASE_ASSERT_NOT_REACHED();
break;
}
}
示例2: dump
void BitVector::dump(PrintStream& out) {
for (size_t i = 0; i < size(); ++i) {
if (get(i))
out.printf("1");
else
out.printf("-");
}
}
示例3: printInternal
void printInternal(PrintStream& out, unsigned long long value)
{
#if OS(WINDOWS)
out.printf("%I64u", value);
#else
out.printf("%llu", value);
#endif
}
示例4: dumpFillInfo
void VariableEvent::dumpFillInfo(const char* name, PrintStream& out) const
{
out.print(name, "(", id(), ", ");
if (dataFormat() == DataFormatDouble)
out.printf("%s", FPRInfo::debugName(fpr()));
#if USE(JSVALUE32_64)
else if (dataFormat() & DataFormatJS)
out.printf("%s:%s", GPRInfo::debugName(tagGPR()), GPRInfo::debugName(payloadGPR()));
#endif
else
out.printf("%s", GPRInfo::debugName(gpr()));
out.printf(", %s)", dataFormatToString(dataFormat()));
}
示例5: disassemble
void disassemble(const MacroAssemblerCodePtr<DisassemblyPtrTag>& codePtr, size_t size, const char* prefix, PrintStream& out)
{
if (tryToDisassemble(codePtr, size, prefix, out))
return;
out.printf("%sdisassembly not available for range %p...%p\n", prefix, codePtr.untaggedExecutableAddress(), codePtr.untaggedExecutableAddress<char*>() + size);
}
示例6: disassemble
void disassemble(const MacroAssemblerCodePtr& codePtr, size_t size, const char* prefix, PrintStream& out)
{
if (tryToDisassemble(codePtr, size, prefix, out))
return;
out.printf("%sdisassembly not available for range %p...%p\n", prefix, codePtr.executableAddress(), static_cast<char*>(codePtr.executableAddress()) + size);
}
示例7: dump
void VariableEvent::dump(PrintStream& out) const
{
switch (kind()) {
case Reset:
out.printf("Reset");
break;
case BirthToFill:
dumpFillInfo("BirthToFill", out);
break;
case BirthToSpill:
dumpSpillInfo("BirthToSpill", out);
break;
case Fill:
dumpFillInfo("Fill", out);
break;
case Spill:
dumpSpillInfo("Spill", out);
break;
case Death:
out.print("Death(", id(), ")");
break;
case MovHintEvent:
out.print("MovHint(", id(), ", ", bytecodeRegister(), ")");
break;
case SetLocalEvent:
out.print(
"SetLocal(machine:", machineRegister(), " -> bytecode:", bytecodeRegister(),
", ", dataFormatToString(dataFormat()), ")");
break;
default:
RELEASE_ASSERT_NOT_REACHED();
break;
}
}
示例8: dumpIndexingType
void dumpIndexingType(PrintStream& out, IndexingType indexingType)
{
const char* basicName;
switch (indexingType & AllArrayTypes) {
case NonArray:
basicName = "NonArray";
break;
case NonArrayWithInt32:
basicName = "NonArrayWithInt32";
break;
case NonArrayWithDouble:
basicName = "NonArrayWithDouble";
break;
case NonArrayWithContiguous:
basicName = "NonArrayWithContiguous";
break;
case NonArrayWithArrayStorage:
basicName = "NonArrayWithArrayStorage";
break;
case NonArrayWithSlowPutArrayStorage:
basicName = "NonArrayWithSlowPutArrayStorage";
break;
case ArrayClass:
basicName = "ArrayClass";
break;
case ArrayWithUndecided:
basicName = "ArrayWithUndecided";
break;
case ArrayWithInt32:
basicName = "ArrayWithInt32";
break;
case ArrayWithDouble:
basicName = "ArrayWithDouble";
break;
case ArrayWithContiguous:
basicName = "ArrayWithContiguous";
break;
case ArrayWithArrayStorage:
basicName = "ArrayWithArrayStorage";
break;
case ArrayWithSlowPutArrayStorage:
basicName = "ArrayWithSlowPutArrayStorage";
break;
case CopyOnWriteArrayWithInt32:
basicName = "CopyOnWriteArrayWithInt32";
break;
case CopyOnWriteArrayWithDouble:
basicName = "CopyOnWriteArrayWithDouble";
break;
case CopyOnWriteArrayWithContiguous:
basicName = "CopyOnWriteArrayWithContiguous";
break;
default:
basicName = "Unknown!";
break;
}
out.printf("%s%s", basicName, (indexingType & MayHaveIndexedAccessors) ? "|MayHaveIndexedAccessors" : "");
}
示例9: dumpToStream
void JSFixedArray::dumpToStream(const JSCell* cell, PrintStream& out)
{
VM& vm = *cell->vm();
const auto* thisObject = jsCast<const JSFixedArray*>(cell);
out.printf("<%p, %s, [%u], [", thisObject, thisObject->className(vm), thisObject->length());
CommaPrinter comma;
for (unsigned index = 0; index < thisObject->length(); ++index)
out.print(comma, thisObject->get(index));
out.print("]>");
}
示例10: dump
void Arg::dump(PrintStream& out) const
{
switch (m_kind) {
case Invalid:
out.print("<invalid>");
return;
case Tmp:
out.print(tmp());
return;
case Imm:
out.print("$", m_offset);
return;
case Imm64:
out.printf("$0x%llx", static_cast<long long unsigned>(m_offset));
return;
case Addr:
if (offset())
out.print(offset());
out.print("(", base(), ")");
return;
case Index:
if (offset())
out.print(offset());
out.print("(", base(), ",", index());
if (scale() != 1)
out.print(",", scale());
out.print(")");
return;
case Stack:
if (offset())
out.print(offset());
out.print("(", pointerDump(stackSlot()), ")");
return;
case CallArg:
if (offset())
out.print(offset());
out.print("(callArg)");
return;
case RelCond:
out.print(asRelationalCondition());
return;
case ResCond:
out.print(asResultCondition());
return;
case DoubleCond:
out.print(asDoubleCondition());
return;
case Special:
out.print(pointerDump(special()));
return;
}
RELEASE_ASSERT_NOT_REACHED();
}
示例11: dumpForBacktrace
void JSValue::dumpForBacktrace(PrintStream& out) const
{
if (!*this)
out.print("<JSValue()>");
else if (isInt32())
out.printf("%d", asInt32());
else if (isDouble())
out.printf("%lf", asDouble());
else if (isCell()) {
if (asCell()->inherits(JSString::info())) {
JSString* string = jsCast<JSString*>(asCell());
const StringImpl* impl = string->tryGetValueImpl();
if (impl)
out.print("\"", impl, "\"");
else
out.print("(unresolved string)");
} else if (asCell()->inherits(Structure::info())) {
out.print("Structure[ ", asCell()->structure()->classInfo()->className);
#if USE(JSVALUE64)
out.print(" ID: ", asCell()->structureID());
#endif
out.print("]: ", RawPointer(asCell()));
} else {
out.print("Cell[", asCell()->structure()->classInfo()->className);
#if USE(JSVALUE64)
out.print(" ID: ", asCell()->structureID());
#endif
out.print("]: ", RawPointer(asCell()));
}
} else if (isTrue())
out.print("True");
else if (isFalse())
out.print("False");
else if (isNull())
out.print("Null");
else if (isUndefined())
out.print("Undefined");
else
out.print("INVALID");
}
示例12: tryToDisassembleWithLLVM
bool tryToDisassembleWithLLVM(
const MacroAssemblerCodePtr& codePtr, size_t size, const char* prefix, PrintStream& out,
InstructionSubsetHint)
{
initializeLLVM();
const char* triple;
#if CPU(X86_64)
triple = "x86_64-apple-darwin";
#elif CPU(X86)
triple = "x86-apple-darwin";
#elif CPU(ARM64)
triple = "arm64-apple-darwin";
#else
#error "LLVM disassembler currently not supported on this CPU."
#endif
char symbolString[symbolStringSize];
LLVMDisasmContextRef disassemblyContext =
llvm->CreateDisasm(triple, symbolString, 0, 0, symbolLookupCallback);
RELEASE_ASSERT(disassemblyContext);
char pcString[20];
char instructionString[1000];
uint8_t* pc = static_cast<uint8_t*>(codePtr.executableAddress());
uint8_t* end = pc + size;
while (pc < end) {
snprintf(
pcString, sizeof(pcString), "0x%lx",
static_cast<unsigned long>(bitwise_cast<uintptr_t>(pc)));
size_t instructionSize = llvm->DisasmInstruction(
disassemblyContext, pc, end - pc, bitwise_cast<uintptr_t>(pc),
instructionString, sizeof(instructionString));
if (!instructionSize)
snprintf(instructionString, sizeof(instructionString), ".byte 0x%02x", *pc++);
else
pc += instructionSize;
out.printf("%s%16s: %s\n", prefix, pcString, instructionString);
}
llvm->DisasmDispose(disassemblyContext);
return true;
}
示例13: tryToDisassemble
bool tryToDisassemble(const MacroAssemblerCodePtr<DisassemblyPtrTag>& codePtr, size_t size, const char* prefix, PrintStream& out)
{
A64DOpcode arm64Opcode;
uint32_t* currentPC = codePtr.untaggedExecutableAddress<uint32_t*>();
size_t byteCount = size;
while (byteCount) {
char pcString[20];
snprintf(pcString, sizeof(pcString), "0x%lx", reinterpret_cast<unsigned long>(currentPC));
out.printf("%s%16s: %s\n", prefix, pcString, arm64Opcode.disassemble(currentPC));
currentPC++;
byteCount -= sizeof(uint32_t);
}
return true;
}
示例14: tryToDisassemble
bool tryToDisassemble(const MacroAssemblerCodePtr& codePtr, size_t size, const char* prefix, PrintStream& out)
{
ud_t disassembler;
ud_init(&disassembler);
ud_set_input_buffer(&disassembler, static_cast<unsigned char*>(codePtr.executableAddress()), size);
#if CPU(X86_64)
ud_set_mode(&disassembler, 64);
#else
ud_set_mode(&disassembler, 32);
#endif
ud_set_pc(&disassembler, bitwise_cast<uintptr_t>(codePtr.executableAddress()));
ud_set_syntax(&disassembler, UD_SYN_ATT);
uint64_t currentPC = disassembler.pc;
while (ud_disassemble(&disassembler)) {
char pcString[20];
print(pcString, sizeof(pcString), currentPC);
out.printf("%s%16s: %s\n", prefix, pcString, ud_insn_asm(&disassembler));
currentPC = disassembler.pc;
}
return true;
}
示例15:
void StackMaps::Constant::dump(PrintStream& out) const
{
out.printf("0x%016llx", integer);
}