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
0 answers

looking for a way to check an elf binary for CUs missing dwarf info/data

I'm looking for a way to check an elf binary for CUs missing dwarf info/data. I wondering if there is already a tool to do this? I figure it can it can be done by building a map of what is described by the available dwarf data and then listing any…
John Kearney
  • 322
  • 3
  • 9
1
vote
0 answers

Single line number mapped to multiple starting address in `.debug_line`

When I tried to get the content of .debug_line section, I used the commands like decodedline to get the readable format. But when I tried to dig into the details of the results, I could not understand the reason why there would be single line number…
Rafael
  • 45
  • 2
  • 10
1
vote
0 answers

Relocate files in .debug_line section

Is it possible to change the file paths in a .debug_line section in an ELF file? I'm trying to set up Debug Fission, so far I have my_library.so (in release mode, with no debug info) and my_library.so.dbg (with debug symbols). I've linked the two…
dogman288
  • 613
  • 3
  • 9
1
vote
0 answers

C++ - Struct packing and GCC debugging symbols mismatch

I am working on a project where I need to parse the DWARF output of a compiler. I am working a Debian x64 (windows WSL) with GCC 8.3.0. I face a compiler behaviour that I think might be a bug, but I am unsure if there's a subtlety I don't get. I…
1
vote
1 answer

Is there a way to modify DWARF format output in .elf file regarding external variabels

We have a third party Software that's picks out information from generated .elf about our global variables which are using DWARF debug info to find it. Previously we have been using IAR compiler which producing the .elf file including debugging…
slatte
  • 11
  • 2
1
vote
1 answer

Find frame base and variable locations using DWARF version 4

I'm following Eli Bendersky's blog on parsing the DWARF debug information. He shows an example of parsing the binary with DWARF version 2 in his blog. The frame base of a function (further used for retrieving local variables) can be retrieved from…
xiaogw
  • 653
  • 8
  • 18
1
vote
1 answer

GDB: manually inject debug symbols

I'm currently debugging a BIOS raw binary (no source code available), and I'd like to teach gdb debug symbols (eg. function offsets, local vars, stack params) that I've found out manually. gdb can load various debug symbol file formats, but I didn't…
1
vote
1 answer

How can I find a proper DWARF symbol for address in a Linux kernel module?

I have a kernel module with DWARF debug info. All its ELF sections have zero start addresses. Its DWARF info contains multiple overlapping code and data symbols. It also has many compilation units with zero DW_AT_low_pc address. Is there a way to…
Denis
  • 13
  • 2
1
vote
0 answers

How to put custom DWARF in C resulting binary?

I have two questions: Is it possible to add custom DWARF on the resulting binary of a C program? (I explain later why i want to do this) How does DWARF work? First of all, i don't understand DWARF. I tried to read some docs on dwarfstd.org, but i…
Daniel Däschle
  • 766
  • 10
  • 32
1
vote
2 answers

source code name and line number of the remote process

Hi I am trying to create some sort of a debugger that looks at system calls to detect them, but from an usability standpoint I wish to be able to get the source code name and line number where the error is detected. I have been using library called…
1
vote
0 answers

Need help understanding DW_AT_ranges values

All the following was obtained via dwarfdump. I have the following DIE (one of many showing the call to inline function foo): 0x0004076c: DW_TAG_inlined_subroutine DW_AT_ranges (0x00002730 …
TreeWater
  • 761
  • 6
  • 13
1
vote
0 answers

MingW64 doesn't generate complete debugging information for lambda

I am working on a debugger that supports range of debugging information formats, including DWARF. Recently I've experienced strange thing: mingw64 doesn't emit information about line numbers for code inside lambdas. Here what I compiled: void…
Artem Razin
  • 1,234
  • 8
  • 22
1
vote
2 answers

Determine inlined function address in dwarf

I have a virtual address (instruction pointer) of the function, obtained from backtrace call. I need to figure out the debug information about it. For example, I need the information about attach_backtraces function. nm -a Backtrace.so | grep…
Ivan Baidakou
  • 713
  • 9
  • 14
1
vote
1 answer

Why don't C++ class functions don't have low_pc / high_pc DWARF info

I'm trying to find the offset range of a c++ class function but when I look in the DWARF information, I don't see the low_pc or high_pc attributes. There are also no DW_AT_specification or DW_AT_abstract_origin entries for the DIE that has the rest…
TreeWater
  • 761
  • 6
  • 13
1
vote
1 answer

Profiling my program with linux perf and different call graph modes gives different results

I want to profile my c++ program with linux perf. For this I used the three following commands and I do not understand why I get three completely different reports. perf record --call-graph dwarf ./myProg perf report perf record --call-graph fp…
rsaill
  • 91
  • 1
  • 7