bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

addr2line seems to be off by one


From: Albert Netymk
Subject: addr2line seems to be off by one
Date: Sat, 16 Jul 2016 21:06:10 +0200

== addr.c

```
#include <stdio.h>

void f() { }

int main(int argc, char **argv)
{
  f();
  puts("done");
  return 0;
}
```

```
$ clang -g addr.c ; objdump -d a.out | grep -B 3 puts | tail -n 4
  400556:       e8 d5 ff ff ff          callq  400530 <f>
  40055b:       48 bf 04 06 40 00 00    movabs $0x400604,%rdi
  400562:       00 00 00
  400565:       e8 a6 fe ff ff          callq  400410 <address@hidden>
```
`40055b` is corresponding to placing "done" in `%rdi`, so I expect it
to be associated to line of `puts("done")`. However, `addr2line
40055b` shows the line of `f()`.


== ENV

clang: clang version 3.8.1-svn271230-1~exp1 (branches/release_38)
addr2line: GNU addr2line (GNU Binutils for Ubuntu) 2.24

-- 
Best Regards

Yours faithfully
Albert Netymk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]