Questions tagged [dwarf]

DWARF is a file format for representing debugging information.

The DWARF format is used to represent information needed for source-level debugging of programs.

The DWARF format is designed to be processor architecture and operating system independent, and supports debugging of programs written in procedural languages like C, C++, FORTRAN, Ada, Java, Modula2 and Pascal.

DWARF is widely used in modern proprietary and open-source operating systems, for example, Linux, Android, BlackBerry OS 10 and others.

288 questions
1
vote
1 answer

.dbug_loc is missing from binary

I was inspecting ELF binary for the code mentioned below. I compiled it on gcc 7.4.0 on Ubuntu x86_64 system in Virtual Box as : gcc -g scratch1.c -o scratch1.out #include void do_stuff(int my_arg){ int my_local = my_arg + 2; …
ultimate cause
  • 2,264
  • 4
  • 27
  • 44
1
vote
1 answer

How do I find a line of code with pyelftools/libdwarf

I have a function name and an offset from the top of that function. I know I can find the line of code from looking at the assembly listing file and compute the offset for the line of code and get the line number that way. What I'm trying to do is…
TreeWater
  • 761
  • 6
  • 13
1
vote
1 answer

How to add Debug symbols for GCC 8.1.0?

I've updated the version of the GCC that I'm using from 4.2.1 to 8.1.0. (This is the only thing that I've changed) The problem is that after I did it the debug symbols were gone. I'm running GDB only with "-g" option. With gcc v8.1.0, there are no…
1
vote
1 answer

How to manually add debug type information to a GNU GAS assembly "array" symbol?

For example, consider the following Linux freestanding true program with an useless my_longs variable for illustrative purposes: main.S .section .rodata my_longs: .quad 0x12, 0x34 .text .global _start _start: asm_main_after_prologue: mov…
Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
1
vote
0 answers

reading the output of readelf -wi, why do some local variables have a DW_AT_location value, but others do not?

I am running readelf -wi file.elf, and looking at the output. I am looking at some of the debug info for local variables, I can find all the variables listed (they all have DW_AT_name), but some do not have DW_AT_location : stuff why? Is there a…
user1426923
  • 67
  • 1
  • 5
1
vote
1 answer

Debug information "DWARF" and crash logs

I am trying to map my understanding of "DWARF" vs "DWARF with dSYM file" debugging info formats to what I see in the crash information for different iOS build configurations. I was trying to fix a problem, where crashes on the build with debug…
Kedar
  • 1,298
  • 10
  • 20
1
vote
1 answer

stack unwinding in dwarf2

I don't understand that how the stack unwinding in dwarf2 ensures reliable recovery of arguments in some very basic ABI(Application Binary Interface) scenarios. Consider a ABI, which says that the first three arguments have to be on registers and…
bbv
  • 501
  • 1
  • 5
  • 14
1
vote
2 answers

Reading DIEs in ELF file

Hello I fairly new to the DWARF standard and ELF format. I have a few questions. I am using the DWARF 2 standard and I have a pretty basic understanding of how DIEs work and I was needing more clarity on how they are represented in bytes. ELF Wiki…
Ryno_XLI
  • 161
  • 9
1
vote
0 answers

Breaking a stack/call frame information chain on ELF/Linux?

I'm trying to do a rather niche thing which is essentially breaking the CFI (Call Frame Information in DWARF EH info) and rbp & rsp links between frames. Main reason for that is that is that past a certain point in thread control flow I want to do …
Kristina
  • 15,859
  • 29
  • 111
  • 181
1
vote
0 answers

The hidden __result local variable in armcc DWARF debug information

I'm writing tools for debugging Cortex-M and I have discovered an artefact when reviewing the DWARF .debug_info section which the armcc outputs for some C source. (The exact compiler is ARM Compiler 5.05.) For example when the C source contains a…
1
vote
2 answers

Using debug symbols with perf

I monitor a process on a PowerPC system in order to extract performance information. How I can load the debug symbols of this process? I use the following command perf record -g dwarf -p 4591 and I take an error that the "dwarf cannot be found (no…
getsoubl
  • 808
  • 10
  • 25
1
vote
1 answer

Showing high and low PC of every program functions using DWARF library

I am trying to make this code work : https://github.com/eliben/code-for-blog/blob/master/2011/dwarf_get_func_addr.c It is extracted from a tutorial made by Eli Bendersky on…
Hugo
  • 138
  • 7
1
vote
1 answer

Linux process access own DWARF debug information?

Is there a simple way for a Linux process to access its own DWARF debug information? I have a process that wants to dump the DWARF information for one specific compilation unit into a log file. This is to simplify some logistics. I have binary log…
Luke Gorrie
  • 467
  • 3
  • 14
1
vote
1 answer

symbolicate line number exactly in swift closure?

Is possible to get line number of crash exactly when error is in a swift closure ? I can't get line number exactly when I re-symbolicate device log or using crash report on firebase, I can just know it happens on which closure, what I miss ?
PatrickSCLin
  • 1,419
  • 3
  • 17
  • 45
1
vote
0 answers

gdb load debug-info failed, get Dwarf Error when I debug webrtc peerconnection_client

Now, I build out peerconnection_client of google webrtc project. But, when input command: gdb out/Default/peerconnection_client, I get error: Reading symbols from /opt/dada/src/webrtc/native/src/out/Default/peerconnection_client...Dwarf Error:…
Janu zhou
  • 31
  • 6