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
2
votes
1 answer

Change DW_AT_name in debug info of dwarf format

I'm compiling u-boot using gcc, it generate dwarf info : ... <74cb> DW_AT_name : (indirect string, offset: 0x1a6a): board.c <74cf> DW_AT_comp_dir : (indirect string, offset: 0x2689): /root/file/u-boot/u-boot-am33x/arch/arm/lib…
2
votes
2 answers

dtrace: failed to compile script Preprocessor not found

I'm trying to test this script from oracle to get active NFS clients on Ubuntu 10.04, but I can' get it to run. To achieve that, I first installed dtrace following these instructions. This is what I've done exactly: apt-get install bison flex…
Jorge Suárez de Lis
  • 565
  • 1
  • 10
  • 29
1
vote
0 answers

Is it possible to encode DWARF debug information into wat (wasm textual format)?

I'm developing a compiler that compiles to WebAssembly Text format (.wat) and want to include debug info. Is it feasible to include DWARF debug information within the .wat file, or is it more practical to generate source maps directly?
1
vote
1 answer

DWARF register numbers on MIPS

What is the canonical mapping between DWARF register numbers and MIPS32 CPU registers, please? The first 32 ones are the general purpose registers, but what about beyond that (e. g. lo/hi)? A link to an authoritative document would be most welcome.…
Seva Alekseyev
  • 59,826
  • 25
  • 160
  • 281
1
vote
1 answer

GDB opaque type resolution strategy for C executables

I am wondering how GDB resolves opaque types for C executables for instance. in a .so // foo.h struct bar; // foo.c #include "foo.h" struct bar { ... } in my program #include "foo.h" struct bar *b; <-- GDB can print the structure. Even when a…
flansel
  • 35
  • 4
1
vote
1 answer

.eh_frame vs .debug_frame section?

The .debug_frame section seems to contain stack unwinding information and is defined by the dwarf standard. The .eh_frame section seems to basically contain the same information with some subtle differences and is defined by the linux…
Fee
  • 719
  • 9
  • 24
1
vote
1 answer

How does C++ inline assembly work with stack unwinding and exception handling?

An elf file contains multiple sections (.eh_frame, .eh_frame_shr) to store precise information about how stack unwdinging has to be done. This is also the basis for throwing exceptions (.gcc_except_table). Inserting inline assembly would certainly…
Fee
  • 719
  • 9
  • 24
1
vote
0 answers

How to make gcc emit basic_block markers in DWARF output?

(Probably unneeded context:) I want to combine information obtained within a gcc plugin with the addresses of the actual basic blocks. Because the final addresses are not known within the plugin unfortunately but only after linking, I need to…
stefanct
  • 2,503
  • 1
  • 28
  • 32
1
vote
0 answers

How to find structure member memory address from dwarf debug information?

I'm trying to find structure member memory address(Non Virtual Memory, embedded) from dwarf. And there's two things i don't understand. First, In below dwarf Info1 DW_AT_location value = [3, 192, 63, 2, 128]. According to dwarf standards, [192, 63,…
SangYoon
  • 11
  • 2
1
vote
1 answer

Specify MIPS floating-pointer registers in CFI directives

I'm trying to generate a call-frame info about saved FP register on MIPS: .text .cfi_startproc addiu $sp, $sp, -4 .cfi_adjust_cfa_offset 4 swc1 $f24, 4($sp) .cfi_rel_offset $f24, 0 .cfi_endproc but this results in $…
yugr
  • 19,769
  • 3
  • 51
  • 96
1
vote
0 answers

how dwarf format caculate provious sp pointer

this is example is from dwarf document. How Can I caculate provious sp(r7) pointer,I mean It didnot save sp somewhere since sp is a callee-save register. The architectural ABI committee specifies that the stack pointer (R7) is the same as the…
radong
  • 29
  • 2
1
vote
1 answer

Recompile C++ binary from debug info

This is more out of curiosity than productive need but I have been asking myself if it is possible to extract the C++ source of a binary such that it can be recompiled to produce a working clone of the binary. If have tried to: compile the binary…
1
vote
2 answers

How do I find out where main() is defined in a big project?

Let's say I have the following program (a.c): #include void f() { printf("Hello, world!"); } int main(void) { f(); return 0; } $ gcc -g a.c Having a.out, how do I find out where main() is defined? I mean, in a big project…
x-yuri
  • 16,722
  • 15
  • 114
  • 161
1
vote
1 answer

How to use dwarf to map instructions in object file to source code line

I'm new to dwarf and used some tools like addr2line, objectdump. However, the problem I'm facing is that I want to get all the instructions in object files/static libraries mapping to its source code lines. The tricky part is that there is no…
CXWorks
  • 123
  • 1
  • 10
1
vote
1 answer

Can someone help to know how to extract structure information from DW_TAG_structure_type from .debug_info file?

I am beginner to dwarf library and I know there are tools like GDB to extract structure information from elf file (with ptype command). I am interested to know how do we decode/extract the DW_TAG_structure_type manually from dwarf .debug_info…
Mike
  • 23
  • 5