[llvm] r262361 - [DebugInfo] Dump CIE augmentation data as a list of hex bytes
Simon Atanasyan via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 1 10:38:05 PST 2016
Author: atanasyan
Date: Tue Mar 1 12:38:05 2016
New Revision: 262361
URL: http://llvm.org/viewvc/llvm-project?rev=262361&view=rev
Log:
[DebugInfo] Dump CIE augmentation data as a list of hex bytes
CIE augmentation data might contain non-printable characters.
The patch prints the data as a list of hex bytes.
Differential Revision: http://reviews.llvm.org/D17759
Added:
llvm/trunk/test/tools/llvm-objdump/Inputs/eh_frame.elf-mipsel (with props)
llvm/trunk/test/tools/llvm-objdump/eh_frame-mipsel.test
Modified:
llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
llvm/trunk/test/tools/llvm-objdump/eh_frame-arm64.test
Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp?rev=262361&r1=262360&r2=262361&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp Tue Mar 1 12:38:05 2016
@@ -12,6 +12,7 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/Dwarf.h"
@@ -244,8 +245,12 @@ public:
(int32_t)DataAlignmentFactor);
OS << format(" Return address column: %d\n",
(int32_t)ReturnAddressRegister);
- if (!AugmentationData.empty())
- OS << " Augmentation data: " << AugmentationData << "\n";
+ if (!AugmentationData.empty()) {
+ OS << " Augmentation data: ";
+ for (uint8_t Byte : AugmentationData)
+ OS << ' ' << hexdigit(Byte >> 4) << hexdigit(Byte & 0xf);
+ OS << "\n";
+ }
OS << "\n";
}
Added: llvm/trunk/test/tools/llvm-objdump/Inputs/eh_frame.elf-mipsel
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/Inputs/eh_frame.elf-mipsel?rev=262361&view=auto
==============================================================================
Binary files llvm/trunk/test/tools/llvm-objdump/Inputs/eh_frame.elf-mipsel (added) and llvm/trunk/test/tools/llvm-objdump/Inputs/eh_frame.elf-mipsel Tue Mar 1 12:38:05 2016 differ
Propchange: llvm/trunk/test/tools/llvm-objdump/Inputs/eh_frame.elf-mipsel
------------------------------------------------------------------------------
svn:executable = *
Modified: llvm/trunk/test/tools/llvm-objdump/eh_frame-arm64.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/eh_frame-arm64.test?rev=262361&r1=262360&r2=262361&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/eh_frame-arm64.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/eh_frame-arm64.test Tue Mar 1 12:38:05 2016
@@ -8,7 +8,7 @@
# CHECK: Code alignment factor: 1
# CHECK: Data alignment factor: -8
# CHECK: Return address column: 30
-# CHECK: Augmentation data:
+# CHECK: Augmentation data: 10
# CHECK: DW_CFA_def_cfa: reg31 +0
Added: llvm/trunk/test/tools/llvm-objdump/eh_frame-mipsel.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/eh_frame-mipsel.test?rev=262361&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/eh_frame-mipsel.test (added)
+++ llvm/trunk/test/tools/llvm-objdump/eh_frame-mipsel.test Tue Mar 1 12:38:05 2016
@@ -0,0 +1,27 @@
+# RUN: llvm-objdump -dwarf=frames %p/Inputs/eh_frame.elf-mipsel | FileCheck %s
+
+# CHECK: .eh_frame contents:
+
+# CHECK: 00000000 00000018 ffffffff CIE
+# CHECK: Version: 1
+# CHECK: Augmentation: "zPLR"
+# CHECK: Code alignment factor: 1
+# CHECK: Data alignment factor: -4
+# CHECK: Return address column: 31
+# CHECK: Augmentation data: 80 90 0B 41 00 00 0B
+
+# CHECK: DW_CFA_def_cfa: reg29 +0
+
+# CHECK: 0000001c 00000018 00000020 FDE cie=00000020 pc=00400890...004008dc
+# CHECK: DW_CFA_advance_loc: 4
+# CHECK: DW_CFA_def_cfa_offset: +24
+# CHECK: DW_CFA_advance_loc: 4
+# CHECK: DW_CFA_offset: reg31 -4
+# CHECK: DW_CFA_nop:
+
+# CHECK: 00000038 00000000 ffffffff CIE
+# CHECK: Version: 0
+# CHECK: Augmentation: ""
+# CHECK: Code alignment factor: 0
+# CHECK: Data alignment factor: 0
+# CHECK: Return address column: 0
More information about the llvm-commits
mailing list