[libcxxabi] r225187 - Make the Unwinder -Werror clean.
Nico Weber
thakis at chromium.org
Mon Jan 5 10:46:01 PST 2015
On Mon, Jan 5, 2015 at 10:12 AM, Dan Albert <danalbert at google.com> wrote:
> Anyone mind if I make -Werror on by default?
>
Since you don't know which compiler people will use when building this,
that seems like a bad idea to me. clang usually builds with a warning or
two for me on OS X for example (due to a since-fixed buggy warning in
clang; the fix just isn't in Xcode yet).
>
> On Mon, Jan 5, 2015 at 10:07 AM, Dan Albert <danalbert at google.com> wrote:
>
>> Author: danalbert
>> Date: Mon Jan 5 12:07:36 2015
>> New Revision: 225187
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=225187&view=rev
>> Log:
>> Make the Unwinder -Werror clean.
>>
>> Mostly just format string fixes.
>> Tested clean on arm, x86, and x86_64 Linux.
>>
>> Modified:
>> libcxxabi/trunk/src/Unwind/AddressSpace.hpp
>> libcxxabi/trunk/src/Unwind/DwarfInstructions.hpp
>> libcxxabi/trunk/src/Unwind/DwarfParser.hpp
>> libcxxabi/trunk/src/Unwind/UnwindLevel1-gcc-ext.c
>> libcxxabi/trunk/src/Unwind/UnwindLevel1.c
>>
>> Modified: libcxxabi/trunk/src/Unwind/AddressSpace.hpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/AddressSpace.hpp?rev=225187&r1=225186&r2=225187&view=diff
>>
>> ==============================================================================
>> --- libcxxabi/trunk/src/Unwind/AddressSpace.hpp (original)
>> +++ libcxxabi/trunk/src/Unwind/AddressSpace.hpp Mon Jan 5 12:07:36 2015
>> @@ -325,7 +325,7 @@ inline LocalAddressSpace::pint_t LocalAd
>> #endif
>>
>> inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,
>> - UnwindInfoSections
>> &info) {
>> + UnwindInfoSections &
>> info) {
>>
>
?
> #if __APPLE__
>> dyld_unwind_sections dyldInfo;
>> if (_dyld_find_unwind_sections((void *)targetAddr, &dyldInfo)) {
>>
>> Modified: libcxxabi/trunk/src/Unwind/DwarfInstructions.hpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/DwarfInstructions.hpp?rev=225187&r1=225186&r2=225187&view=diff
>>
>> ==============================================================================
>> --- libcxxabi/trunk/src/Unwind/DwarfInstructions.hpp (original)
>> +++ libcxxabi/trunk/src/Unwind/DwarfInstructions.hpp Mon Jan 5 12:07:36
>> 2015
>> @@ -156,11 +156,11 @@ int DwarfInstructions<A, R>::stepWithDwa
>> pint_t fdeStart, R
>> ®isters) {
>> FDE_Info fdeInfo;
>> CIE_Info cieInfo;
>> - if (CFI_Parser<A>::decodeFDE(addressSpace, fdeStart,
>> - &fdeInfo, &cieInfo) ==
>> NULL) {
>> + if (CFI_Parser<A>::decodeFDE(addressSpace, fdeStart, &fdeInfo,
>> + &cieInfo) == NULL) {
>> PrologInfo prolog;
>> if (CFI_Parser<A>::parseFDEInstructions(addressSpace, fdeInfo,
>> cieInfo, pc,
>> -
>> &prolog)) {
>> + &prolog)) {
>> // get pointer to cfa (architecture specific)
>> pint_t cfa = getCFA(addressSpace, prolog, registers);
>>
>> @@ -168,10 +168,10 @@ int DwarfInstructions<A, R>::stepWithDwa
>> R newRegisters = registers;
>> pint_t returnAddress = 0;
>> const int lastReg = R::lastDwarfRegNum();
>> - assert((int)CFI_Parser<A>::kMaxRegisterNumber > lastReg
>> - && "register range too
>> large");
>> - assert(lastReg <= (int)cieInfo.returnAddressRegister
>> - && "register range does not contain return address
>> register");
>> + assert((int)CFI_Parser<A>::kMaxRegisterNumber > lastReg &&
>> + "register range too large");
>> + assert(lastReg <= (int)cieInfo.returnAddressRegister &&
>> + "register range does not contain return address register");
>> for (int i = 0; i <= lastReg; ++i) {
>> if (prolog.savedRegisters[i].location !=
>> CFI_Parser<A>::kRegisterUnused) {
>> @@ -223,7 +223,8 @@ DwarfInstructions<A, R>::evaluateExpress
>> pint_t length = (pint_t)addressSpace.getULEB128(p, expressionEnd);
>> expressionEnd = p + length;
>> if (log)
>> - fprintf(stderr, "evaluateExpression(): length=%llu\n",
>> (uint64_t)length);
>> + fprintf(stderr, "evaluateExpression(): length=%" PRIu64 "\n",
>> + (uint64_t)length);
>> pint_t stack[100];
>> pint_t *sp = stack;
>> *(++sp) = initialStackValue;
>> @@ -231,7 +232,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> while (p < expressionEnd) {
>> if (log) {
>> for (pint_t *t = sp; t > stack; --t) {
>> - fprintf(stderr, "sp[] = 0x%llX\n", (uint64_t)(*t));
>> + fprintf(stderr, "sp[] = 0x%" PRIx64 "\n", (uint64_t)(*t));
>> }
>> }
>> uint8_t opcode = addressSpace.get8(p++);
>> @@ -245,7 +246,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> p += sizeof(pint_t);
>> *(++sp) = value;
>> if (log)
>> - fprintf(stderr, "push 0x%llX\n", (uint64_t) value);
>> + fprintf(stderr, "push 0x%" PRIx64 "\n", (uint64_t)value);
>> break;
>>
>> case DW_OP_deref:
>> @@ -253,7 +254,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> value = *sp--;
>> *(++sp) = addressSpace.getP(value);
>> if (log)
>> - fprintf(stderr, "dereference 0x%llX\n", (uint64_t) value);
>> + fprintf(stderr, "dereference 0x%" PRIx64 "\n", (uint64_t)value);
>> break;
>>
>> case DW_OP_const1u:
>> @@ -262,7 +263,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> p += 1;
>> *(++sp) = value;
>> if (log)
>> - fprintf(stderr, "push 0x%llX\n", (uint64_t) value);
>> + fprintf(stderr, "push 0x%" PRIx64 "\n", (uint64_t)value);
>> break;
>>
>> case DW_OP_const1s:
>> @@ -271,7 +272,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> p += 1;
>> *(++sp) = (pint_t)svalue;
>> if (log)
>> - fprintf(stderr, "push 0x%llX\n", (uint64_t) svalue);
>> + fprintf(stderr, "push 0x%" PRIx64 "\n", (uint64_t)svalue);
>> break;
>>
>> case DW_OP_const2u:
>> @@ -280,7 +281,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> p += 2;
>> *(++sp) = value;
>> if (log)
>> - fprintf(stderr, "push 0x%llX\n", (uint64_t) value);
>> + fprintf(stderr, "push 0x%" PRIx64 "\n", (uint64_t)value);
>> break;
>>
>> case DW_OP_const2s:
>> @@ -289,7 +290,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> p += 2;
>> *(++sp) = (pint_t)svalue;
>> if (log)
>> - fprintf(stderr, "push 0x%llX\n", (uint64_t) svalue);
>> + fprintf(stderr, "push 0x%" PRIx64 "\n", (uint64_t)svalue);
>> break;
>>
>> case DW_OP_const4u:
>> @@ -298,7 +299,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> p += 4;
>> *(++sp) = value;
>> if (log)
>> - fprintf(stderr, "push 0x%llX\n", (uint64_t) value);
>> + fprintf(stderr, "push 0x%" PRIx64 "\n", (uint64_t)value);
>> break;
>>
>> case DW_OP_const4s:
>> @@ -307,7 +308,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> p += 4;
>> *(++sp) = (pint_t)svalue;
>> if (log)
>> - fprintf(stderr, "push 0x%llX\n", (uint64_t) svalue);
>> + fprintf(stderr, "push 0x%" PRIx64 "\n", (uint64_t)svalue);
>> break;
>>
>> case DW_OP_const8u:
>> @@ -316,7 +317,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> p += 8;
>> *(++sp) = value;
>> if (log)
>> - fprintf(stderr, "push 0x%llX\n", (uint64_t) value);
>> + fprintf(stderr, "push 0x%" PRIx64 "\n", (uint64_t)value);
>> break;
>>
>> case DW_OP_const8s:
>> @@ -325,7 +326,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> p += 8;
>> *(++sp) = value;
>> if (log)
>> - fprintf(stderr, "push 0x%llX\n", (uint64_t) value);
>> + fprintf(stderr, "push 0x%" PRIx64 "\n", (uint64_t)value);
>> break;
>>
>> case DW_OP_constu:
>> @@ -333,7 +334,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> value = (pint_t)addressSpace.getULEB128(p, expressionEnd);
>> *(++sp) = value;
>> if (log)
>> - fprintf(stderr, "push 0x%llX\n", (uint64_t) value);
>> + fprintf(stderr, "push 0x%" PRIx64 "\n", (uint64_t)value);
>> break;
>>
>> case DW_OP_consts:
>> @@ -341,7 +342,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> svalue = (sint_t)addressSpace.getSLEB128(p, expressionEnd);
>> *(++sp) = (pint_t)svalue;
>> if (log)
>> - fprintf(stderr, "push 0x%llX\n", (uint64_t) svalue);
>> + fprintf(stderr, "push 0x%" PRIx64 "\n", (uint64_t)svalue);
>> break;
>>
>> case DW_OP_dup:
>> @@ -401,7 +402,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> value = *sp--;
>> *sp = *((pint_t*)value);
>> if (log)
>> - fprintf(stderr, "x-dereference 0x%llX\n", (uint64_t) value);
>> + fprintf(stderr, "x-dereference 0x%" PRIx64 "\n",
>> (uint64_t)value);
>> break;
>>
>> case DW_OP_abs:
>> @@ -518,7 +519,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> p += 2;
>> p = (pint_t)((sint_t)p + svalue);
>> if (log)
>> - fprintf(stderr, "skip %lld\n", (uint64_t) svalue);
>> + fprintf(stderr, "skip %" PRIu64 "\n", (uint64_t)svalue);
>> break;
>>
>> case DW_OP_bra:
>> @@ -527,7 +528,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> if (*sp--)
>> p = (pint_t)((sint_t)p + svalue);
>> if (log)
>> - fprintf(stderr, "bra %lld\n", (uint64_t) svalue);
>> + fprintf(stderr, "bra %" PRIu64 "\n", (uint64_t)svalue);
>> break;
>>
>> case DW_OP_eq:
>> @@ -607,7 +608,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> value = opcode - DW_OP_lit0;
>> *(++sp) = value;
>> if (log)
>> - fprintf(stderr, "push literal 0x%llX\n", (uint64_t) value);
>> + fprintf(stderr, "push literal 0x%" PRIx64 "\n", (uint64_t)value);
>> break;
>>
>> case DW_OP_reg0:
>> @@ -652,7 +653,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> reg = (uint32_t)addressSpace.getULEB128(p, expressionEnd);
>> *(++sp) = registers.getRegister((int)reg);
>> if (log)
>> - fprintf(stderr, "push reg %d + 0x%llX\n", reg, (uint64_t)
>> svalue);
>> + fprintf(stderr, "push reg %d + 0x%" PRIx64 "\n", reg,
>> (uint64_t)svalue);
>> break;
>>
>> case DW_OP_breg0:
>> @@ -692,7 +693,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> svalue += registers.getRegister((int)reg);
>> *(++sp) = (pint_t)(svalue);
>> if (log)
>> - fprintf(stderr, "push reg %d + 0x%llX\n", reg, (uint64_t)
>> svalue);
>> + fprintf(stderr, "push reg %d + 0x%" PRIx64 "\n", reg,
>> (uint64_t)svalue);
>> break;
>>
>> case DW_OP_bregx:
>> @@ -701,7 +702,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> svalue += registers.getRegister((int)reg);
>> *(++sp) = (pint_t)(svalue);
>> if (log)
>> - fprintf(stderr, "push reg %d + 0x%llX\n", reg, (uint64_t)
>> svalue);
>> + fprintf(stderr, "push reg %d + 0x%" PRIx64 "\n", reg,
>> (uint64_t)svalue);
>> break;
>>
>> case DW_OP_fbreg:
>> @@ -733,7 +734,7 @@ DwarfInstructions<A, R>::evaluateExpress
>> }
>> *(++sp) = value;
>> if (log)
>> - fprintf(stderr, "sized dereference 0x%llX\n", (uint64_t) value);
>> + fprintf(stderr, "sized dereference 0x%" PRIx64 "\n",
>> (uint64_t)value);
>> break;
>>
>> case DW_OP_xderef_size:
>> @@ -748,7 +749,7 @@ DwarfInstructions<A, R>::evaluateExpress
>>
>> }
>> if (log)
>> - fprintf(stderr, "expression evaluates to 0x%llX\n", (uint64_t) * sp);
>> + fprintf(stderr, "expression evaluates to 0x%" PRIx64 "\n",
>> (uint64_t)*sp);
>> return *sp;
>> }
>>
>>
>> Modified: libcxxabi/trunk/src/Unwind/DwarfParser.hpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/DwarfParser.hpp?rev=225187&r1=225186&r2=225187&view=diff
>>
>> ==============================================================================
>> --- libcxxabi/trunk/src/Unwind/DwarfParser.hpp (original)
>> +++ libcxxabi/trunk/src/Unwind/DwarfParser.hpp Mon Jan 5 12:07:36 2015
>> @@ -13,6 +13,7 @@
>> #ifndef __DWARF_PARSER_HPP__
>> #define __DWARF_PARSER_HPP__
>>
>> +#include <inttypes.h>
>> #include <stdint.h>
>> #include <stdio.h>
>> #include <stdlib.h>
>> @@ -370,8 +371,8 @@ bool CFI_Parser<A>::parseInstructions(A
>> pint_t codeOffset = 0;
>> PrologInfo initialState = *results;
>> if (logDwarf)
>> - fprintf(stderr, "parseInstructions(instructions=0x%0llX)\n",
>> - (uint64_t) instructionsEnd);
>> + fprintf(stderr, "parseInstructions(instructions=0x%0" PRIx64 ")\n",
>> + (uint64_t)instructionsEnd);
>>
>> // see Dwarf Spec, section 6.4.2 for details on unwind opcodes
>> while ((p < instructionsEnd) && (codeOffset < pcoffset)) {
>> @@ -398,22 +399,22 @@ bool CFI_Parser<A>::parseInstructions(A
>> codeOffset += (addressSpace.get8(p) * cieInfo.codeAlignFactor);
>> p += 1;
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_advance_loc1: new offset=%llu\n",
>> - (uint64_t)codeOffset);
>> + fprintf(stderr, "DW_CFA_advance_loc1: new offset=%" PRIu64 "\n",
>> + (uint64_t)codeOffset);
>> break;
>> case DW_CFA_advance_loc2:
>> codeOffset += (addressSpace.get16(p) * cieInfo.codeAlignFactor);
>> p += 2;
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_advance_loc2: new offset=%llu\n",
>> - (uint64_t)codeOffset);
>> + fprintf(stderr, "DW_CFA_advance_loc2: new offset=%" PRIu64 "\n",
>> + (uint64_t)codeOffset);
>> break;
>> case DW_CFA_advance_loc4:
>> codeOffset += (addressSpace.get32(p) * cieInfo.codeAlignFactor);
>> p += 4;
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_advance_loc4: new offset=%llu\n",
>> - (uint64_t)codeOffset);
>> + fprintf(stderr, "DW_CFA_advance_loc4: new offset=%" PRIu64 "\n",
>> + (uint64_t)codeOffset);
>> break;
>> case DW_CFA_offset_extended:
>> reg = addressSpace.getULEB128(p, instructionsEnd);
>> @@ -427,8 +428,9 @@ bool CFI_Parser<A>::parseInstructions(A
>> results->savedRegisters[reg].location = kRegisterInCFA;
>> results->savedRegisters[reg].value = offset;
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_offset_extended(reg=%lld,
>> offset=%lld)\n", reg,
>> - offset);
>> + fprintf(stderr,
>> + "DW_CFA_offset_extended(reg=%" PRIu64 ", offset=%"
>> PRId64 ")\n",
>> + reg, offset);
>> break;
>> case DW_CFA_restore_extended:
>> reg = addressSpace.getULEB128(p, instructionsEnd);
>> @@ -441,7 +443,7 @@ bool CFI_Parser<A>::parseInstructions(A
>> }
>> results->savedRegisters[reg] = initialState.savedRegisters[reg];
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_restore_extended(reg=%lld)\n", reg);
>> + fprintf(stderr, "DW_CFA_restore_extended(reg=%" PRIu64 ")\n",
>> reg);
>> break;
>> case DW_CFA_undefined:
>> reg = addressSpace.getULEB128(p, instructionsEnd);
>> @@ -452,7 +454,7 @@ bool CFI_Parser<A>::parseInstructions(A
>> }
>> results->savedRegisters[reg].location = kRegisterUnused;
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_undefined(reg=%lld)\n", reg);
>> + fprintf(stderr, "DW_CFA_undefined(reg=%" PRIu64 ")\n", reg);
>> break;
>> case DW_CFA_same_value:
>> reg = addressSpace.getULEB128(p, instructionsEnd);
>> @@ -469,7 +471,7 @@ bool CFI_Parser<A>::parseInstructions(A
>> // set flag to disable conversion to compact unwind
>> results->sameValueUsed = true;
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_same_value(reg=%lld)\n", reg);
>> + fprintf(stderr, "DW_CFA_same_value(reg=%" PRIu64 ")\n", reg);
>> break;
>> case DW_CFA_register:
>> reg = addressSpace.getULEB128(p, instructionsEnd);
>> @@ -489,7 +491,8 @@ bool CFI_Parser<A>::parseInstructions(A
>> // set flag to disable conversion to compact unwind
>> results->registersInOtherRegisters = true;
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_register(reg=%lld, reg2=%lld)\n", reg,
>> reg2);
>> + fprintf(stderr, "DW_CFA_register(reg=%" PRIu64 ", reg2=%" PRIu64
>> ")\n",
>> + reg, reg2);
>> break;
>> case DW_CFA_remember_state:
>> // avoid operator new, because that would be an upward dependency
>> @@ -526,7 +529,8 @@ bool CFI_Parser<A>::parseInstructions(A
>> results->cfaRegister = (uint32_t)reg;
>> results->cfaRegisterOffset = (int32_t)offset;
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_def_cfa(reg=%lld, offset=%lld)\n", reg,
>> offset);
>> + fprintf(stderr, "DW_CFA_def_cfa(reg=%" PRIu64 ", offset=%"
>> PRIu64 ")\n",
>> + reg, offset);
>> break;
>> case DW_CFA_def_cfa_register:
>> reg = addressSpace.getULEB128(p, instructionsEnd);
>> @@ -538,7 +542,7 @@ bool CFI_Parser<A>::parseInstructions(A
>> }
>> results->cfaRegister = (uint32_t)reg;
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_def_cfa_register(%lld)\n", reg);
>> + fprintf(stderr, "DW_CFA_def_cfa_register(%" PRIu64 ")\n", reg);
>> break;
>> case DW_CFA_def_cfa_offset:
>> results->cfaRegisterOffset = (int32_t)
>> @@ -554,8 +558,8 @@ bool CFI_Parser<A>::parseInstructions(A
>> length = addressSpace.getULEB128(p, instructionsEnd);
>> p += length;
>> if (logDwarf)
>> - fprintf(stderr,
>> - "DW_CFA_def_cfa_expression(expression=0x%llX,
>> length=%llu)\n",
>> + fprintf(stderr, "DW_CFA_def_cfa_expression(expression=0x%" PRIx64
>> + ", length=%" PRIu64 ")\n",
>> results->cfaExpression, length);
>> break;
>> case DW_CFA_expression:
>> @@ -570,8 +574,8 @@ bool CFI_Parser<A>::parseInstructions(A
>> length = addressSpace.getULEB128(p, instructionsEnd);
>> p += length;
>> if (logDwarf)
>> - fprintf(stderr,
>> - "DW_CFA_expression(reg=%lld, expression=0x%llX,
>> length=%llu)\n",
>> + fprintf(stderr, "DW_CFA_expression(reg=%" PRIu64
>> + ", expression=0x%" PRIx64 ", length=%" PRIu64
>> ")\n",
>> reg, results->savedRegisters[reg].value, length);
>> break;
>> case DW_CFA_offset_extended_sf:
>> @@ -587,7 +591,8 @@ bool CFI_Parser<A>::parseInstructions(A
>> results->savedRegisters[reg].location = kRegisterInCFA;
>> results->savedRegisters[reg].value = offset;
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_offset_extended_sf(reg=%lld,
>> offset=%lld)\n",
>> + fprintf(stderr, "DW_CFA_offset_extended_sf(reg=%" PRIu64
>> + ", offset=%" PRId64 ")\n",
>> reg, offset);
>> break;
>> case DW_CFA_def_cfa_sf:
>> @@ -602,7 +607,8 @@ bool CFI_Parser<A>::parseInstructions(A
>> results->cfaRegister = (uint32_t)reg;
>> results->cfaRegisterOffset = (int32_t)offset;
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_def_cfa_sf(reg=%lld, offset=%lld)\n",
>> reg,
>> + fprintf(stderr,
>> + "DW_CFA_def_cfa_sf(reg=%" PRIu64 ", offset=%" PRId64
>> ")\n", reg,
>> offset);
>> break;
>> case DW_CFA_def_cfa_offset_sf:
>> @@ -620,7 +626,8 @@ bool CFI_Parser<A>::parseInstructions(A
>> results->savedRegisters[reg].location = kRegisterOffsetFromCFA;
>> results->savedRegisters[reg].value = offset;
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_val_offset(reg=%lld, offset=%lld\n", reg,
>> + fprintf(stderr,
>> + "DW_CFA_val_offset(reg=%" PRIu64 ", offset=%" PRId64
>> "\n", reg,
>> offset);
>> break;
>> case DW_CFA_val_offset_sf:
>> @@ -635,8 +642,9 @@ bool CFI_Parser<A>::parseInstructions(A
>> results->savedRegisters[reg].location = kRegisterOffsetFromCFA;
>> results->savedRegisters[reg].value = offset;
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_val_offset_sf(reg=%lld, offset=%lld\n",
>> reg,
>> - offset);
>> + fprintf(stderr,
>> + "DW_CFA_val_offset_sf(reg=%" PRIu64 ", offset=%" PRId64
>> "\n",
>> + reg, offset);
>> break;
>> case DW_CFA_val_expression:
>> reg = addressSpace.getULEB128(p, instructionsEnd);
>> @@ -650,16 +658,15 @@ bool CFI_Parser<A>::parseInstructions(A
>> length = addressSpace.getULEB128(p, instructionsEnd);
>> p += length;
>> if (logDwarf)
>> - fprintf(
>> - stderr,
>> - "DW_CFA_val_expression(reg=%lld, expression=0x%llX,
>> length=%lld)\n",
>> - reg, results->savedRegisters[reg].value, length);
>> + fprintf(stderr, "DW_CFA_val_expression(reg=%" PRIu64
>> + ", expression=0x%" PRIx64 ", length=%" PRIu64
>> ")\n",
>> + reg, results->savedRegisters[reg].value, length);
>> break;
>> case DW_CFA_GNU_args_size:
>> length = addressSpace.getULEB128(p, instructionsEnd);
>> results->spExtraArgSize = (uint32_t)length;
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_GNU_args_size(%lld)\n", length);
>> + fprintf(stderr, "DW_CFA_GNU_args_size(%" PRIu64 ")\n", length);
>> break;
>> case DW_CFA_GNU_negative_offset_extended:
>> reg = addressSpace.getULEB128(p, instructionsEnd);
>> @@ -673,7 +680,8 @@ bool CFI_Parser<A>::parseInstructions(A
>> results->savedRegisters[reg].location = kRegisterInCFA;
>> results->savedRegisters[reg].value = -offset;
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_GNU_negative_offset_extended(%lld)\n",
>> offset);
>> + fprintf(stderr, "DW_CFA_GNU_negative_offset_extended(%" PRId64
>> ")\n",
>> + offset);
>> break;
>> default:
>> operand = opcode & 0x3F;
>> @@ -685,20 +693,20 @@ bool CFI_Parser<A>::parseInstructions(A
>> results->savedRegisters[reg].location = kRegisterInCFA;
>> results->savedRegisters[reg].value = offset;
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_offset(reg=%d, offset=%lld)\n",
>> operand,
>> - offset);
>> + fprintf(stderr, "DW_CFA_offset(reg=%d, offset=%" PRId64 ")\n",
>> + operand, offset);
>> break;
>> case DW_CFA_advance_loc:
>> codeOffset += operand * cieInfo.codeAlignFactor;
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_advance_loc: new offset=%llu\n",
>> -
>> (uint64_t)codeOffset);
>> + fprintf(stderr, "DW_CFA_advance_loc: new offset=%" PRIu64 "\n",
>> + (uint64_t)codeOffset);
>> break;
>> case DW_CFA_restore:
>> reg = operand;
>> results->savedRegisters[reg] = initialState.savedRegisters[reg];
>> if (logDwarf)
>> - fprintf(stderr, "DW_CFA_restore(reg=%lld)\n", reg);
>> + fprintf(stderr, "DW_CFA_restore(reg=%" PRIu64 ")\n", reg);
>> break;
>> default:
>> if (logDwarf)
>>
>> Modified: libcxxabi/trunk/src/Unwind/UnwindLevel1-gcc-ext.c
>> URL:
>> http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/UnwindLevel1-gcc-ext.c?rev=225187&r1=225186&r2=225187&view=diff
>>
>> ==============================================================================
>> --- libcxxabi/trunk/src/Unwind/UnwindLevel1-gcc-ext.c (original)
>> +++ libcxxabi/trunk/src/Unwind/UnwindLevel1-gcc-ext.c Mon Jan 5 12:07:36
>> 2015
>> @@ -10,10 +10,11 @@
>> //
>>
>> //===----------------------------------------------------------------------===//
>>
>> -#include <stdint.h>
>> +#include <inttypes.h>
>> #include <stdbool.h>
>> -#include <stdlib.h>
>> +#include <stdint.h>
>> #include <stdio.h>
>> +#include <stdlib.h>
>>
>> #include "libunwind.h"
>> #include "unwind.h"
>> @@ -196,8 +197,8 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetC
>> unw_cursor_t *cursor = (unw_cursor_t *)context;
>> unw_word_t result;
>> unw_get_reg(cursor, UNW_REG_SP, &result);
>> - _LIBUNWIND_TRACE_API("_Unwind_GetCFA(context=%p) => 0x%llX\n", context,
>> - (uint64_t) result);
>> + _LIBUNWIND_TRACE_API("_Unwind_GetCFA(context=%p) => 0x%" PRIx64 "\n",
>> context,
>> + (uint64_t)result);
>> return (uintptr_t)result;
>> }
>>
>>
>> Modified: libcxxabi/trunk/src/Unwind/UnwindLevel1.c
>> URL:
>> http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/UnwindLevel1.c?rev=225187&r1=225186&r2=225187&view=diff
>>
>> ==============================================================================
>> --- libcxxabi/trunk/src/Unwind/UnwindLevel1.c (original)
>> +++ libcxxabi/trunk/src/Unwind/UnwindLevel1.c Mon Jan 5 12:07:36 2015
>> @@ -12,6 +12,7 @@
>> //
>>
>> //===----------------------------------------------------------------------===//
>>
>> +#include <inttypes.h>
>> #include <stdint.h>
>> #include <stdbool.h>
>> #include <stdlib.h>
>> @@ -67,8 +68,9 @@ unwind_phase1(unw_context_t *uc, _Unwind
>> unw_word_t pc;
>> unw_get_reg(&cursor1, UNW_REG_IP, &pc);
>> _LIBUNWIND_TRACE_UNWINDING(
>> - "unwind_phase1(ex_ojb=%p): pc=0x%llX, start_ip=0x%llX,
>> func=%s, "
>> - "lsda=0x%llX, personality=0x%llX\n",
>> + "unwind_phase1(ex_ojb=%p): pc=0x%" PRIx64 ", start_ip=0x%"
>> PRIx64
>> + ", func=%s, "
>> + "lsda=0x%" PRIx64 ", personality=0x%" PRIx64 "\n",
>> exception_object, pc, frameInfo.start_ip, functionName,
>> frameInfo.lsda, frameInfo.handler);
>> }
>> @@ -160,8 +162,9 @@ unwind_phase2(unw_context_t *uc, _Unwind
>> UNW_ESUCCESS) || (frameInfo.start_ip + offset >
>> frameInfo.end_ip))
>> strcpy(functionName, ".anonymous.");
>> _LIBUNWIND_TRACE_UNWINDING(
>> - "unwind_phase2(ex_ojb=%p): start_ip=0x%llX, func=%s,
>> sp=0x%llX, "
>> - "lsda=0x%llX, personality=0x%llX\n",
>> + "unwind_phase2(ex_ojb=%p): start_ip=0x%" PRIx64
>> + ", func=%s, sp=0x%" PRIx64 ", "
>> + "lsda=0x%" PRIx64 ", personality=0x%" PRIx64 "\n",
>> exception_object, frameInfo.start_ip, functionName, sp,
>> frameInfo.lsda, frameInfo.handler);
>> }
>> @@ -201,7 +204,8 @@ unwind_phase2(unw_context_t *uc, _Unwind
>> unw_get_reg(&cursor2, UNW_REG_IP, &pc);
>> unw_get_reg(&cursor2, UNW_REG_SP, &sp);
>> _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p):
>> re-entering "
>> - "user code with ip=0x%llX,
>> sp=0x%llX\n",
>> + "user code with ip=0x%" PRIx64
>> + ", sp=0x%" PRIx64 "\n",
>> exception_object, pc, sp);
>> }
>> unw_resume(&cursor2);
>> @@ -247,12 +251,12 @@ unwind_phase2_forced(unw_context_t *uc,
>> if ((unw_get_proc_name(&cursor2, functionName, 512, &offset) !=
>> UNW_ESUCCESS) || (frameInfo.start_ip + offset >
>> frameInfo.end_ip))
>> strcpy(functionName, ".anonymous.");
>> - _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): "
>> - "start_ip=0x%llX, func=%s, lsda=0x%llX,
>> "
>> - " personality=0x%llX\n",
>> - exception_object, frameInfo.start_ip,
>> - functionName, frameInfo.lsda,
>> - frameInfo.handler);
>> + _LIBUNWIND_TRACE_UNWINDING(
>> + "unwind_phase2_forced(ex_ojb=%p): "
>> + "start_ip=0x%" PRIx64 ", func=%s, lsda=0x%" PRIx64 ", "
>> + " personality=0x%" PRIx64 "\n",
>> + exception_object, frameInfo.start_ip, functionName,
>> frameInfo.lsda,
>> + frameInfo.handler);
>> }
>>
>> // Call stop function at each frame.
>> @@ -406,10 +410,12 @@ _Unwind_GetLanguageSpecificData(struct _
>> if (unw_get_proc_info(cursor, &frameInfo) == UNW_ESUCCESS)
>> result = (uintptr_t)frameInfo.lsda;
>> _LIBUNWIND_TRACE_API("_Unwind_GetLanguageSpecificData(context=%p)"
>> - "=> 0x%lX\n", context, result);
>> + "=> 0x%" PRIxPTR "\n",
>> + context, result);
>> if (result != 0) {
>> if (*((uint8_t *)result) != 0xFF)
>> - _LIBUNWIND_DEBUG_LOG("lsda at 0x%lX does not start with 0xFF\n",
>> result);
>> + _LIBUNWIND_DEBUG_LOG("lsda at 0x%" PRIxPTR " does not start with
>> 0xFF\n",
>> + result);
>> }
>> return result;
>> }
>> @@ -422,9 +428,8 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetG
>> unw_cursor_t *cursor = (unw_cursor_t *)context;
>> unw_word_t result;
>> unw_get_reg(cursor, index, &result);
>> - _LIBUNWIND_TRACE_API("_Unwind_GetGR(context=%p, reg=%d) => 0x%llX\n",
>> - context,
>> - index, (uint64_t) result);
>> + _LIBUNWIND_TRACE_API("_Unwind_GetGR(context=%p, reg=%d) => 0x%" PRIx64
>> "\n",
>> + context, index, (uint64_t)result);
>> return (uintptr_t)result;
>> }
>>
>> @@ -434,8 +439,8 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetG
>> _LIBUNWIND_EXPORT void _Unwind_SetGR(struct _Unwind_Context *context,
>> int index,
>> uintptr_t new_value) {
>> _LIBUNWIND_TRACE_API("_Unwind_SetGR(context=%p, reg=%d, "
>> - "value=0x%0llX)\n", context,
>> - index, (uint64_t) new_value);
>> + "value=0x%0" PRIx64 ")\n",
>> + context, index, (uint64_t)new_value);
>> unw_cursor_t *cursor = (unw_cursor_t *)context;
>> unw_set_reg(cursor, index, new_value);
>> }
>> @@ -447,8 +452,8 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetI
>> unw_cursor_t *cursor = (unw_cursor_t *)context;
>> unw_word_t result;
>> unw_get_reg(cursor, UNW_REG_IP, &result);
>> - _LIBUNWIND_TRACE_API("_Unwind_GetIP(context=%p) => 0x%llX\n", context,
>> - (uint64_t) result);
>> + _LIBUNWIND_TRACE_API("_Unwind_GetIP(context=%p) => 0x%" PRIx64 "\n",
>> context,
>> + (uint64_t)result);
>> return (uintptr_t)result;
>> }
>>
>> @@ -459,8 +464,8 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetI
>> /// start executing in the landing pad.
>> _LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context,
>> uintptr_t new_value) {
>> - _LIBUNWIND_TRACE_API("_Unwind_SetIP(context=%p, value=0x%0llX)\n",
>> - context, (uint64_t) new_value);
>> + _LIBUNWIND_TRACE_API("_Unwind_SetIP(context=%p, value=0x%0" PRIx64
>> ")\n",
>> + context, (uint64_t)new_value);
>> unw_cursor_t *cursor = (unw_cursor_t *)context;
>> unw_set_reg(cursor, UNW_REG_IP, new_value);
>> }
>> @@ -475,8 +480,8 @@ _Unwind_GetRegionStart(struct _Unwind_Co
>> uintptr_t result = 0;
>> if (unw_get_proc_info(cursor, &frameInfo) == UNW_ESUCCESS)
>> result = (uintptr_t)frameInfo.start_ip;
>> - _LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p) => 0x%lX\n",
>> - context, result);
>> + _LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p) => 0x%"
>> PRIxPTR "\n",
>> + context, result);
>> return result;
>> }
>>
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150105/4ffc03ae/attachment.html>
More information about the cfe-commits
mailing list