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.

235 questions
96
votes
8 answers

How to disassemble one single function using objdump?

I've got a binary installed on my system, and would like to look at the disassembly of a given function. Preferrably using objdump, but other solutions would be acceptable as well. From this questions I've learned that I might be able to disassemble…
MvG
  • 51,562
  • 13
  • 126
  • 251
61
votes
2 answers

GAS: Explanation of .cfi_def_cfa_offset

I would like an explanation for the values used with the .cfi_def_cfa_offset directives in assembly generated by GCC. I know vaguely that the .cfi directives are involved in call frames and stack unwinding, but I would like a more detailed…
void-pointer
  • 12,317
  • 11
  • 40
  • 60
26
votes
3 answers

Dwarf Error: wrong version in compilation unit header (is 4, should be 2)

A shared object was built on RedHat Linux and while all the code was compiled with debug, the debugger (gdb) refused to load the symbols and issued an error as in: ... GNU gdb Fedora (6.8-37.el5) ... This GDB was configured as…
Dror Harari
  • 2,597
  • 2
  • 23
  • 22
25
votes
4 answers

Library to read ELF file DWARF debug information

Any recommendations for a good cross-platform library for reading ELF file debug information in DWARF format? I'd like to read the DWARF debug info in a Python program.
Craig McQueen
  • 37,399
  • 27
  • 113
  • 172
22
votes
1 answer

readelf -s does not output full variable names

I need to get the global symbols from a compiled c program file. What I use is the linux command readelf -s filePath when I use that command this is what I get: I draw a blue rectangle to show that variable names do not get displayed correctly.…
Tono Nam
  • 29,637
  • 73
  • 252
  • 421
14
votes
2 answers

Local variable location from DWARF info in ARM

I have a C program in file delay.c: void delay(int num) { volatile int i; for(i=0; i
LostBenjamin
  • 205
  • 1
  • 8
14
votes
6 answers

atos and dwarfdump won't symbolicate my address

I received a crash report via AirBrake.io that isn't symbolicated. Since the crash report is not in exactly the same format as an Apple crashlog I can't just drop it on XCode as usual, so I took the exact same build from my XCode archive tried to…
Mac_Cain13
  • 3,578
  • 2
  • 22
  • 38
13
votes
3 answers

Gcc 4.8 DWARF4 vs DWARF2

GCC 4.8 supports DWARF4. I'm wondering what is the difference between DWARF4 and DWARF2 from user point of view. Lets look at it from GDB point of view. Is there any difference for users when you switch to DWARF4? I have found a Dwarf Home Page,…
CyberGuy
  • 2,653
  • 1
  • 18
  • 29
13
votes
4 answers

where/how does Apples GCC store DWARF inside an executable

Where/how does Apples GCC store DWARF inside an executable? I compiled a binary via gcc -gdwarf-2 (Apples GCC). However, neither objdump -g nor objdump -h does show me any debug information. Also libbfd does not find any debug information. (I asked…
Albert
  • 57,395
  • 54
  • 209
  • 347
12
votes
3 answers

How to find DWARF_DSYM_FOLDER_PATH and DWARF_DSYM_FILE_NAME in xcode 9.3

I am using the Crashlytics in order to report the crash occurs in the iOS app. Here, I want to know how to find the path of these below dwarf folder and file in xcode: DWARF_DSYM_FOLDER_PATH DWARF_DSYM_FILE_NAME
jazzbpn
  • 4,159
  • 6
  • 37
  • 73
12
votes
2 answers

Check DWARF version of compilation unit

all, is there a tool to check DWARF version of file? Something like this: $ dwarf_tool binary_name 4
usamytch
  • 303
  • 4
  • 13
11
votes
6 answers

Analizing MIPS binaries: is there a Python library for parsing binary data?

I'm working on a utility which needs to resolve hex addresses to a symbolic function name and source code line number within a binary. The utility will run on Linux on x86, though the binaries it analyzes will be for a MIPS-based embedded system.…
DGentry
  • 15,552
  • 7
  • 48
  • 65
10
votes
0 answers

Is there a simple DWARF CFI represenation for functions that set up a conventional frame pointer?

I'm programming in a mix of C, C++ and assembly and I'd like to get reliable backtraces from any part of the code. This mostly works fine for the C and C++ code since I can generate debugging info with -g, which for modern x86 compilers and…
BeeOnRope
  • 51,419
  • 13
  • 149
  • 309
10
votes
1 answer

Extract global variables from a.out file

Edit (updated question) I have a simple C program: // it is not important to know what the code does you may skip the code main.c #include unsigned int AppCtr; unsigned char AppFlag; int SOME_LARGE_VARIABLE; static void …
Tono Nam
  • 29,637
  • 73
  • 252
  • 421
9
votes
1 answer

GCC 4.8 inserts version 4 in a compilation unit header even with -gdwarf-2

I compiled an application with GCC 4.8 and I'm trying to debug it on an older system that does not have GDB 7.5+ (which supposedly added support for DWARF-4). Upgrading GDB on that system is not an option. I can't debug it because GDB outputs the…
MuchToLearn
  • 328
  • 2
  • 9
1
2 3
15 16