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

elfutils build error on mac: configure: error: __thread support required

Instructions to repro: $ git clone --depth=1 git://sourceware.org/git/elfutils.git $ cd elfutils $ autoreconf -i -f $ ./configure Error log: ... checking whether the compiler generates build-ids... ./configure: line 6951: -n: command not…
A. K.
  • 34,395
  • 15
  • 52
  • 89
0
votes
0 answers

How to reduce the overhead of libunwind

I am working with the following scenario: I need to get the call stack at the entry point of some APIs. So I wrote some wrappers and use libunwind to perform stack backtracing before executing the real API. For example: #include void…
flyingrose
  • 107
  • 2
  • 11
0
votes
0 answers

Why does gcc not produce DWARF5 bin even after passing ``-gdwarf-5`` flag?

I am trying to compile a basic c program to get the binary ELF on my Ubuntu x86-64 machine. I want the binary to comply with the DWARF5 format as I am working on writing a .debug_sup section parser. However I am not sure if this is because I have an…
dg_linux
  • 1
  • 1
0
votes
1 answer

DWARF debug information: Additional byte generated in element inside debug_info

I am fixing a bug in a parser for DWARF debug information (2nd DWARF version). In the process I made the following strange observation: A bytestream was created by reading a dll file (created with ada files by GNAT). At the position of a…
user946822
  • 25
  • 3
0
votes
1 answer

Usage of %line directive in NASM with dwarf debug format does not result in expected line numbers

I'm compiling the following code with NASM (nasm -g -F dwarf -f elf64 test.asm && gcc -g3 test.o). global main section .text main: %line 1 test.txt PUSH 1337 %line 2 test.txt PUSH 1338 %line 3 test.txt PUSH 1339 %line 8 test.txt POP RAX %line 9…
Sindre
  • 3
  • 1
0
votes
0 answers

Why there is no debug info (DISubprogram) for extern function declaration?

I have a header file like this: // test.h #pragma once void func(void); and a source file calling the func: // test.c void func_user() { func(); } Then I compile these files in to LLVM IR using: clang-13 -emit-llvm -O0 -g -S test.c -o…
Richard Chien
  • 81
  • 1
  • 7
0
votes
0 answers

why line number in .debug_line shows 0?

Why I'm seeing so many 0 Line number addresses in recently file compiled by clang? like the result from llvm-dwarfdump below: Address Line Column File ISA Discriminator Flags ------------------ ------ ------ ------ --- -------------…
joey jiao
  • 1
  • 1
0
votes
1 answer

Why .eh_frame and .eh_frame_hdr does not exist in the clang 32bit so?

I'm trying to use the command readelf -S libtest.so on the 32bit libtest.so which compiled with clang11 --target=arm-linux-androideabi21 -march=armv7-a & cflags -funwind-table -fno-exceptions. The .eh_frame or .eh_frame_hdr segment can not be found…
ZengQ
  • 11
  • 1
0
votes
1 answer

How to check if my debugger's program counter is inside a function?

I'm writing a debugger and want to see if its program counter is inside a function. I guess I need to check that it's between DW_AT_low_pc and DW_AT_high_pc. Here's the code I'm trying to debug: void myPrint() { int test_a = 3; int test_b =…
SurvivalMachine
  • 7,946
  • 15
  • 57
  • 87
0
votes
1 answer

WebAssembly debug symbols (wasm:// vs file://)

I need an advice on how WebAssembly binaries produced with emscripten can store their debug symbols to understand why my particular case does not work while a trivial one does. So I was trying to test this AV1 WebAssembly port but it failed with…
Rudolfs Bundulis
  • 11,636
  • 6
  • 33
  • 71
0
votes
1 answer

Efficient way to parse DWARF

I try to build a debugger which allows me to set breakpoints at functions or codelines. The needed debug information should be extracted from the DWARF section from an elf file. I am able to extract these data. The project I want to debug has 50-100…
Feanor
  • 3
  • 3
0
votes
1 answer

DWARF parsing of DW_AT_data_member_location

I am implementing an interpreter of DWARF info for my company and I don't understand how to interpret the DW_AT_data_member_location when it has the following form: DW_FORM = DW_FORM_block Block value (ignoring length) = 0x23xx or 0x23xx01 , where…
gramm
  • 18,786
  • 7
  • 27
  • 27
0
votes
1 answer

What format is xlc debug info?

I'm trying to look at the debug info for a program compiled with xlc v11.1 on AIX. I used -g flag when compiled, but looking at the help page I don't see it mention DWARF anywhere or if I can specify what format I want. Any ideas how I can tell what…
TreeWater
  • 761
  • 6
  • 13
0
votes
0 answers

Perf Script Erroneous Dwarf Stacktrace Output

I used the following command to sample backtraces for an ffmpeg benchmark: sudo perf record -d --call-graph dwarf,65528 -c 1000000 -e mem_load_uops_retired.l3_miss:u ffmpeg -i /media/ahmad/DATA/Videos/video.mp4 -threads 1 -vf spp out.mp4 As can be…
TheAhmad
  • 810
  • 1
  • 9
  • 21
0
votes
3 answers

Converting endianness of struct-Data

What i have is: a hex file with the bytes of a c-struct in it, orderd in big-endian the struct definition as *.h file the struct information as dwarf2 debug info My application has to be written in C / C++. Intermediate scripts using for example…
Philipp G.
  • 11
  • 1