addr2line: Always parse addresses as hex numbers.

We would sometimes interpret input addresses as decimal or octal.
That could be confusing and isn't what binutils addr2line does.
Be consistent and always treat input addresses as hex.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
This commit is contained in:
Mark Wielaard
2015-05-19 23:08:00 +02:00
parent 472890f580
commit d76d73f490
5 changed files with 15 additions and 3 deletions
+3
View File
@@ -2,6 +2,9 @@ Version 0.162
libdw: Install new header elfutils/known-dwarf.h.
addr2line: Input addresses are now always interpreted as hexadecimal
numbers, never as octal or decimal numbers.
Version 0.161
libdw: New function dwarf_peel_type. dwarf_aggregate_size now uses
+5
View File
@@ -1,3 +1,8 @@
2015-05-20 Mark Wielaard <mjw@redhat.com>
* addr2line.c (handle_address): Call strtoumax with base 16. Make
sure all input has been processed.
2015-05-20 Mark Wielaard <mjw@redhat.com>
* addr2line (argp_option): Group 'section' under "Input format
+2 -2
View File
@@ -532,8 +532,8 @@ static int
handle_address (const char *string, Dwfl *dwfl)
{
char *endp;
uintmax_t addr = strtoumax (string, &endp, 0);
if (endp == string)
uintmax_t addr = strtoumax (string, &endp, 16);
if (endp == string || *endp != '\0')
{
bool parsed = false;
int i, j;
+4
View File
@@ -1,3 +1,7 @@
2015-05-20 Mark Wielaard <mjw@redhat.com>
* run-addrname-test.sh: Make sure all input addresses are hex.
2015-05-04 Max Filippov <jcmvbkbc@gmail.com>
* backtrace-child.c (stdarg, main): Replace assert_perror with assert.
+1 -1
View File
@@ -277,7 +277,7 @@ EOF
# local l0local2, 0
# offset 12
testfiles testfile64
testrun_compare ${abs_top_builddir}/src/addr2line -S -e testfile64 1 4 5 8 9 12 <<\EOF
testrun_compare ${abs_top_builddir}/src/addr2line -S -e testfile64 1 4 5 8 9 c <<\EOF
gglobal2
??:0
g0global2