@@ -421,8 +421,7 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions,
421
421
offset = (int64_t )addressSpace.getULEB128 (p, instructionsEnd)
422
422
* cieInfo.dataAlignFactor ;
423
423
if (reg > kMaxRegisterNumber ) {
424
- fprintf (stderr,
425
- " malformed DW_CFA_offset_extended DWARF unwind, reg too big\n " );
424
+ _LIBUNWIND_LOG (" malformed DWARF DW_CFA_offset_extended, reg too big" );
426
425
return false ;
427
426
}
428
427
results->savedRegisters [reg].location = kRegisterInCFA ;
@@ -436,9 +435,7 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions,
436
435
reg = addressSpace.getULEB128 (p, instructionsEnd);
437
436
;
438
437
if (reg > kMaxRegisterNumber ) {
439
- fprintf (
440
- stderr,
441
- " malformed DW_CFA_restore_extended DWARF unwind, reg too big\n " );
438
+ _LIBUNWIND_LOG (" malformed DWARF DW_CFA_restore_extended, reg too big" );
442
439
return false ;
443
440
}
444
441
results->savedRegisters [reg] = initialState.savedRegisters [reg];
@@ -448,8 +445,7 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions,
448
445
case DW_CFA_undefined:
449
446
reg = addressSpace.getULEB128 (p, instructionsEnd);
450
447
if (reg > kMaxRegisterNumber ) {
451
- fprintf (stderr,
452
- " malformed DW_CFA_undefined DWARF unwind, reg too big\n " );
448
+ _LIBUNWIND_LOG (" malformed DWARF DW_CFA_undefined, reg too big" );
453
449
return false ;
454
450
}
455
451
results->savedRegisters [reg].location = kRegisterUnused ;
@@ -459,8 +455,7 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions,
459
455
case DW_CFA_same_value:
460
456
reg = addressSpace.getULEB128 (p, instructionsEnd);
461
457
if (reg > kMaxRegisterNumber ) {
462
- fprintf (stderr,
463
- " malformed DW_CFA_same_value DWARF unwind, reg too big\n " );
458
+ _LIBUNWIND_LOG (" malformed DWARF DW_CFA_same_value, reg too big" );
464
459
return false ;
465
460
}
466
461
// <rdar://problem/8456377> DW_CFA_same_value unsupported
@@ -477,13 +472,11 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions,
477
472
reg = addressSpace.getULEB128 (p, instructionsEnd);
478
473
reg2 = addressSpace.getULEB128 (p, instructionsEnd);
479
474
if (reg > kMaxRegisterNumber ) {
480
- fprintf (stderr,
481
- " malformed DW_CFA_register DWARF unwind, reg too big\n " );
475
+ _LIBUNWIND_LOG (" malformed DWARF DW_CFA_register, reg too big" );
482
476
return false ;
483
477
}
484
478
if (reg2 > kMaxRegisterNumber ) {
485
- fprintf (stderr,
486
- " malformed DW_CFA_register DWARF unwind, reg2 too big\n " );
479
+ _LIBUNWIND_LOG (" malformed DWARF DW_CFA_register, reg2 too big" );
487
480
return false ;
488
481
}
489
482
results->savedRegisters [reg].location = kRegisterInRegister ;
@@ -525,7 +518,7 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions,
525
518
reg = addressSpace.getULEB128 (p, instructionsEnd);
526
519
offset = (int64_t )addressSpace.getULEB128 (p, instructionsEnd);
527
520
if (reg > kMaxRegisterNumber ) {
528
- fprintf (stderr, " malformed DW_CFA_def_cfa DWARF unwind , reg too big\n " );
521
+ _LIBUNWIND_LOG ( " malformed DWARF DW_CFA_def_cfa , reg too big" );
529
522
return false ;
530
523
}
531
524
results->cfaRegister = (uint32_t )reg;
@@ -537,9 +530,7 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions,
537
530
case DW_CFA_def_cfa_register:
538
531
reg = addressSpace.getULEB128 (p, instructionsEnd);
539
532
if (reg > kMaxRegisterNumber ) {
540
- fprintf (
541
- stderr,
542
- " malformed DW_CFA_def_cfa_register DWARF unwind, reg too big\n " );
533
+ _LIBUNWIND_LOG (" malformed DWARF DW_CFA_def_cfa_register, reg too big" );
543
534
return false ;
544
535
}
545
536
results->cfaRegister = (uint32_t )reg;
@@ -567,8 +558,7 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions,
567
558
case DW_CFA_expression:
568
559
reg = addressSpace.getULEB128 (p, instructionsEnd);
569
560
if (reg > kMaxRegisterNumber ) {
570
- fprintf (stderr,
571
- " malformed DW_CFA_expression DWARF unwind, reg too big\n " );
561
+ _LIBUNWIND_LOG (" malformed DWARF DW_CFA_expression, reg too big" );
572
562
return false ;
573
563
}
574
564
results->savedRegisters [reg].location = kRegisterAtExpression ;
@@ -583,9 +573,8 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions,
583
573
case DW_CFA_offset_extended_sf:
584
574
reg = addressSpace.getULEB128 (p, instructionsEnd);
585
575
if (reg > kMaxRegisterNumber ) {
586
- fprintf (
587
- stderr,
588
- " malformed DW_CFA_offset_extended_sf DWARF unwind, reg too big\n " );
576
+ _LIBUNWIND_LOG (
577
+ " malformed DWARF DW_CFA_offset_extended_sf, reg too big" );
589
578
return false ;
590
579
}
591
580
offset =
@@ -602,8 +591,7 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions,
602
591
offset =
603
592
addressSpace.getSLEB128 (p, instructionsEnd) * cieInfo.dataAlignFactor ;
604
593
if (reg > kMaxRegisterNumber ) {
605
- fprintf (stderr,
606
- " malformed DW_CFA_def_cfa_sf DWARF unwind, reg too big\n " );
594
+ _LIBUNWIND_LOG (" malformed DWARF DW_CFA_def_cfa_sf, reg too big" );
607
595
return false ;
608
596
}
609
597
results->cfaRegister = (uint32_t )reg;
@@ -635,8 +623,7 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions,
635
623
case DW_CFA_val_offset_sf:
636
624
reg = addressSpace.getULEB128 (p, instructionsEnd);
637
625
if (reg > kMaxRegisterNumber ) {
638
- fprintf (stderr,
639
- " malformed DW_CFA_val_offset_sf DWARF unwind, reg too big\n " );
626
+ _LIBUNWIND_LOG (" malformed DWARF DW_CFA_val_offset_sf, reg too big" );
640
627
return false ;
641
628
}
642
629
offset =
@@ -651,8 +638,7 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions,
651
638
case DW_CFA_val_expression:
652
639
reg = addressSpace.getULEB128 (p, instructionsEnd);
653
640
if (reg > kMaxRegisterNumber ) {
654
- fprintf (stderr,
655
- " malformed DW_CFA_val_expression DWARF unwind, reg too big\n " );
641
+ _LIBUNWIND_LOG (" malformed DWARF DW_CFA_val_expression, reg too big" );
656
642
return false ;
657
643
}
658
644
results->savedRegisters [reg].location = kRegisterIsExpression ;
@@ -673,8 +659,8 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions,
673
659
case DW_CFA_GNU_negative_offset_extended:
674
660
reg = addressSpace.getULEB128 (p, instructionsEnd);
675
661
if (reg > kMaxRegisterNumber ) {
676
- fprintf (stderr, " malformed DW_CFA_GNU_negative_offset_extended DWARF "
677
- " unwind , reg too big\n " );
662
+ _LIBUNWIND_LOG (
663
+ " malformed DWARF DW_CFA_GNU_negative_offset_extended , reg too big" );
678
664
return false ;
679
665
}
680
666
offset = (int64_t )addressSpace.getULEB128 (p, instructionsEnd)
0 commit comments