当前位置: 首页>>代码示例>>C++>>正文


C++ PrintStream::printf方法代码示例

本文整理汇总了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;
    }
}
开发者ID:fatman2021,项目名称:webkitgtk,代码行数:32,代码来源:DFGVariableEvent.cpp

示例2: dump

void BitVector::dump(PrintStream& out) {
  for (size_t i = 0; i < size(); ++i) {
    if (get(i))
      out.printf("1");
    else
      out.printf("-");
  }
}
开发者ID:mirror,项目名称:chromium,代码行数:8,代码来源:BitVector.cpp

示例3: printInternal

void printInternal(PrintStream& out, unsigned long long value)
{
#if OS(WINDOWS)
    out.printf("%I64u", value);
#else
    out.printf("%llu", value);
#endif
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:8,代码来源:PrintStream.cpp

示例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()));
}
开发者ID:B-Stefan,项目名称:webkit,代码行数:13,代码来源:DFGVariableEvent.cpp

示例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);
}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:7,代码来源:Disassembler.cpp

示例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);
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:7,代码来源:Disassembler.cpp

示例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;
    }
}
开发者ID:feel2d,项目名称:webkit,代码行数:34,代码来源:DFGVariableEvent.cpp

示例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" : "");
}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:59,代码来源:IndexingType.cpp

示例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("]>");
}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:10,代码来源:JSFixedArray.cpp

示例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();
}
开发者ID:srinivas-kakarla,项目名称:WebKitForWayland,代码行数:54,代码来源:AirArg.cpp

示例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");
}
开发者ID:eocanha,项目名称:webkit,代码行数:40,代码来源:JSCJSValue.cpp

示例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;
}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:50,代码来源:LLVMDisassembler.cpp

示例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;
}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:17,代码来源:ARM64Disassembler.cpp

示例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;
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:23,代码来源:UDis86Disassembler.cpp

示例15:

void StackMaps::Constant::dump(PrintStream& out) const
{
    out.printf("0x%016llx", integer);
}
开发者ID:PTaylour,项目名称:webkit,代码行数:4,代码来源:FTLStackMaps.cpp


注:本文中的PrintStream::printf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。