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

In an elf file, how to find which compile unit the variable is defined?

I'm writing a tool to add variables to a2l file, the input is elf file. For searching which compile unit (CU) has the variable, I have to search through all CUs (till meet the variable). Because the SW is very big, it takes time to find a…
0
votes
1 answer

DW_AT_location DW_OP_fbreg DW_OP_addr

How to calculate the value of DW_AT_location can anybody help? And I also want to know when to use DW_OP_addr and DW_OP_fbreg with this attribute .uleb128 0x2 # (DIE (0x75) DW_TAG_variable) .ascii "c\0" # DW_AT_name .byte 0x1 …
0
votes
1 answer

unable to build binutils on macosx

I need to build ld from sources on OSX 10.12.3 (16D32). I cloned the last version from git://sourceware.org/git/binutils-gdb.git and tried to build it: ./configure --prefix=/usr --disable-werror (there are a lot of warnings, so I disable…
AC-93
  • 85
  • 1
  • 7
0
votes
1 answer

IOS symbolication formula

I have read in various sites that while manually symbolicating an ios Crash report, we can get the symbol address using: symbol address = slide address + stack address - load address But how do we get this? These are the sites which mentions the…
riddler0212
  • 95
  • 1
  • 1
  • 8
0
votes
2 answers

Why there is no DWARF info?

I am using the following commands to compile a source file(hello.c) into an executable file(hello), and expect to dump out the DWARF info of the executable file. However, there is no DWARF info no matter using "readelf -wi hello" or "llvm-dwarfdump…
Qi Zhang
  • 631
  • 1
  • 7
  • 15
0
votes
1 answer

How to derive the length of a string or an array from DWARF?

For the following code, after being compiled by GCC, is it possible to derive the length of the "teststr" and "testarray" variables from DWARF? void func(char *str1, char *str2){ ... ... return; } int main(void){ char *teststr =…
Qi Zhang
  • 631
  • 1
  • 7
  • 15
0
votes
1 answer

Best way to "mangle" (represent) the memory

I would like to know what would be the best way to map/represent the memory. I mean, how to describe, for example, a structure with all its field to be serialized. I am creating a RPC library that will create the client and server using the dwarf…
0
votes
1 answer

Error with Dwarf version when compile program associated with netcdf

I'm trying to compile a program which is a chemical emission preprocessor. This is the offical tutorial of its compile process. I have already upload the original source code here. With predefine the netcdf_dir, the source code should be compiled…
Han Zhengzu
  • 3,694
  • 7
  • 44
  • 94
0
votes
1 answer

objdump --dwarf of assembly code does not list function

I wrote simple x86 assembly routine: $ cat asm.s .global foo .section .text foo: nop ret And compiled it with $ gcc -c -g asm.s -o asm.o But when I do objdump --dwarf asm.o, it does not display any info about function foo. Looks like,…
Ravi
  • 1,574
  • 2
  • 16
  • 28
0
votes
1 answer

GCC. Generate limited debug info

Is there a way to force gcc to generate only subset of full debug info that will be sufficient for addr2line utility? Or any way to strip unneeded? I've tried $ objcopy --only-keep-debug --remove-section=.debug_loc --remove-section=.debug_aranges…
Sergio
  • 8,099
  • 2
  • 26
  • 52
0
votes
1 answer

Create LLDB Alias for Debug Symbol

My end goal is to modify an Objective-C program's symfile in LLDB. I want to augment the method names so a new, unique name can be used to reference an existing method in the debug symbol file. For example, if there is a method named -[Foo bar], I…
Sozin's Comet
  • 483
  • 5
  • 13
0
votes
1 answer

GUI based debugging tools using DWARF information from ELF file

I am searching for a GUI based debugging tool which reads DWARF info from ELF file and maps the assembly instructions to the line number of the source code. Are there any such tools existing, please let me know?
vimal prathap
  • 411
  • 7
  • 17
0
votes
1 answer

ELF/DWARF Parser to Out Structure elements

Is there a way to extract the size and address of elements within a structure using an elf file? I am hoping there is a tool available that can do this and export it to a more readable format. My end goal is to convert the ELF file to a ASAM A2L…
Steve S
  • 209
  • 4
  • 13
0
votes
1 answer

print all symbolic info from vmlinux binary

As there was a lot of confusion before, so I am rephrasing question here removing old one. I want to print all the symbolic info from vmlinux binary on power-pc architecture - static, dynamic(.so) as well as run time including kallsyms (module…
Udit Gupta
  • 3,162
  • 11
  • 43
  • 71
0
votes
1 answer

Incorrect DIE entry in ELF file (DWARF2)

I am trying to parse a ELF file in DWARF2 format. There seems to be an incorrect DIE entry for one of the subprogram. It is supposed to have an entry "DW_TAG_subprogram" but has "DW_TAG_compile_unit" and there are some special characters under…