Questions tagged [addr2line]

addr2line translates program addresses into file names and line numbers.

43 questions
80
votes
2 answers

How to use addr2line in Android

I am stuck with my app, as I am unable to debug as it is a multithreaded one and crashes with error SIGSEGV. I get lot of information from LogCat, which gives me addresses in my native library. It would be helpful if I could convert these addresses…
NoAIUser
  • 3,966
  • 6
  • 34
  • 52
60
votes
4 answers

How to use the addr2line command in Linux?

I am trying to use addr2line command in Unix but everytime it is giving the same output as ??:0. I am giving command as addr2line -e a.out 0x4005BDC . I got this address while running this a.out executable with valgrind tool to find the memory…
Prak
  • 979
  • 3
  • 12
  • 17
27
votes
1 answer

What's the "discriminator" in addr2line?

When running addr2line in some programs, I get a "discriminator N" comment at the end of the line: main at /tmp/nsievebits.c:56 (discriminator 3) The man page doesn't mention it, and a quick Google search seems to indicate mostly source code files,…
anol
  • 8,264
  • 3
  • 34
  • 78
24
votes
2 answers

How do I access the `addr2line` functionality within my C++ program?

I need to get the information provided by addr2line (source file and line from backtracing a function call) from within a C++ program. I know I can call addr2line directly as a subprocess and I know that I can copy the source code of addr2line into…
steffen
  • 8,572
  • 11
  • 52
  • 90
14
votes
2 answers

glibc function to retrieve current executable name?

i'm wondering if there is a glibc function that i can use from gcc/g++ that will retrieve the current executable. The purpose of this is to provide the -e argument to addr2line as shown in this answer
lurscher
  • 25,930
  • 29
  • 122
  • 185
7
votes
0 answers

addr2line command search path for debug symbols

I cannot make addr2line to work. It does look for symbols at three (unexisting) paths: /usr/bin/*.debug /usr/bin/.debug/*.debug /usr/lib/debug/usr/bin/*.debug But it just seems to ignore the path where all debugging symbols are actually installed…
j1elo
  • 1,029
  • 8
  • 21
6
votes
2 answers

Analyze backtrace of a crash occurring due to a faulty library

In my application I have setup signal handler to catch Segfaults, and print bactraces. My application loads some plugins libraries, when process starts. If my application crashes with a segfault, due to an error in the main executable binary, I can…
mdk
  • 6,225
  • 1
  • 25
  • 30
5
votes
2 answers

Reverse of addr2line

given an object file and address addr2line tool can relate it to a file and line number in the source code. I'd like to have the opposite. Given a line number and an object file I want to get a list of instruction addresses which correspond to a…
mcsim
  • 1,647
  • 2
  • 16
  • 35
5
votes
0 answers

How to manually map an Android SIGSEGV address to linker map file?

My Java app has a JNI layer for communicating with a native C++ library. When the app is idle for approximately three (3) minutes, the app crashes, with LogCat showing the following stack trace: 07-13 13:21:35.876: A/libc(9889): Fatal signal 11…
Moshe Rubin
  • 1,944
  • 1
  • 17
  • 37
4
votes
0 answers

How to get the function name from base.odex with address and offset

Here is an android app crash stacktrace: F DEBUG : #05 pc 001d0949 /data/app/com.test-2/oat/arm/base.odex (offset 0x12a000) I know for ".so" library, I can use addr2line to get the function name. So how to deal with odex files?
shingo
  • 18,436
  • 5
  • 23
  • 42
4
votes
1 answer

How addr2line can locate the source file and the line of code?

addr2line translates addresses into file names and line numbers. I am still beginner in debugging, and have some questions about addr2line. If am debugging a certain .so (binary) file, how the tool can locate its source code file (from where can…
geek1001
  • 72
  • 1
  • 5
4
votes
0 answers

Is there a way to avoid that addr2line prints "question marks" lines

When I call addr2line on my program, I get an output of this form : ?? ??:0 ?? ??:0 BdmLsim3::InitPopulation() at bdmLsim3/../src/Spatial/BdmLsim3.cpp:634 BdmLsim3::InitSimulation() at bdmLsim3/../src/Spatial/BdmLsim3.cpp:1012 Is there a…
Gauthier Boaglio
  • 10,054
  • 5
  • 48
  • 85
3
votes
0 answers

Detect specific function calls in the source codes with objdump

I need a way to detect places, where a specific function is called. E.g.: myPrint(): main.c, line 28 utils.c, line 89 The point is, I need only function calls, not definitions or declarations. And I need it not only for "simple" C-like identifiers,…
Eenoku
  • 2,741
  • 4
  • 32
  • 64
3
votes
1 answer

How can I provide addr2line with a symbol file for use with a stripped binary in Ubuntu?

I have an C++ application running in Ubuntu. What I'd like to do is to strip the application binary of its symbols so that they are not part of the binary, but use the addr2line utility to get backtrace information by referencing a symbol file…
user2062604
  • 247
  • 3
  • 16
3
votes
1 answer

How to get Crash Point in Java code

My application has android-support-v4.jar in /libs only. I do not use other library. My application is crashing with SIGNAL 11 error. I want to use addr2line utility of android-ndk. Can we find the function and line number of java file using this…
Kushal
  • 8,100
  • 9
  • 63
  • 82
1
2 3