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