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

how to get from line in disassembled .text section in ELF file to the corresponding line in source code

I am trying to create a line coverage program in Python. The goal is to receive list of PCs from a test running on a device and to get information of which functions, conditions and lines of the FW of said device were covered by the test. The said…
vadim6385
  • 37
  • 5
0
votes
2 answers

Getting symbol name at address in Linux DWARF executable

In an application built with debug symbols I need a function that given an address returns name of the symbol (if exists) at that address. I'm aware of dladdr() but it only works for symbols in shared libraries, not for symbols in the executable or…
sinan
  • 6,809
  • 6
  • 38
  • 67
0
votes
1 answer

DWARF operator to byte swap dwarf-stack value

I am trying to change the endianity of multibyte data(no larger than generic type) stored on dwarf stack. I have gone through dwarfv5 DW_OP_xxx operators but not able to find any operator to swap bytes. although i am able to do it using list of…
Chirag Patel
  • 1,141
  • 1
  • 11
  • 23
0
votes
1 answer

What is DW_AT code 0x05? Not found in DWARF standard

I've code across an elf file with dwarf information produced by a tricore-gcc compiler from HighTec. It contains dwarf attribute encoding 0x05 which isn't mentioned in the standard version 4 which reads DW_AT_sibling 0x01 reference DW_AT_location…
user2052153
  • 129
  • 10
0
votes
1 answer

How to cast a C void* pointer to a pointer to a struct (with definition of the struct as a string)?

I'd like to print the information stored a memory pointed by a void* pointer. But the type information is not available at the compile type. Instead, the string of the definition of the type will be available at the run time. Is there a way to cast…
user1424739
  • 11,937
  • 17
  • 63
  • 152
0
votes
1 answer

Accessing debug information in LLVM

Previously in LLVM version 4 and lower, it was possible to access the debug information for program constructs via some API calls. For example, to get the DWARF info of a struct I could write: MDNode* structNode; DIType…
Arya Mz
  • 581
  • 3
  • 7
  • 20
0
votes
1 answer

Manipulating x64 Unwind Info To Match Assembly Hook

Edit: I appear to have been mistaken, the backtrace works wonderfully from anywhere on Linux -- it is only when remote debugging from gdb on ubuntu to remote windows that the stacktrace gets absolutely destroyed after entering one of the memory…
user6567423
  • 353
  • 4
  • 9
0
votes
1 answer

How does LLDB implement the set breakpoint function?

I want to implement set-breakpoints function through LLDB, I have read the lldb source code and understood part of the implementation. My question is where is the source code set breakpoint implemented? How does lldb interact with DWARF?
sven
  • 86
  • 6
0
votes
1 answer

Why redudant attribute DW_AT_endianity with TAG_variable and TAG_base_type?

I was reading DWARFv4 spec and came across attribute DW_AT_endianity. Correct me if my understanding is wrong. As per spec, Two of the tag values TAG_variable and TAG_base_type both can have that attribute. But as far as, i understand when you…
Chirag Patel
  • 1,141
  • 1
  • 11
  • 23
0
votes
1 answer

How do you append to the list of retained nodes using the LLVM C++ API?

I'm looking at DIBuilder::createLabel() in the LLVM docs here. It says: The optimizer may remove labels. If there is an interest to preserve label info in such situation then append it to the list of retained nodes of the DISubprogram. How does…
Edd Barrett
  • 3,425
  • 2
  • 29
  • 48
0
votes
1 answer

Why are there wrong paths in DWARF table

I compiled my program with armclang with -g option. When I try to debug it with Keil it doesn't recognize the source files ( I cannot set breakpoints in them, or see in which function I currently am). I checked the compiled .o files with objdump and…
0
votes
2 answers

How can i extract constants' addresses,added by compiler optimization, from ELF file?

I'm writing some code size analysis tool for my C program, using the output ELF file. I'm using readelf -debug-dump=info to generate Dwarf format file. I've noticed that My compiler is adding as a part of the optimization new consts, that are not in…
ramsis
  • 13
  • 3
0
votes
1 answer

GDB doesn't list member functions or namespace functions in GHS compiled ELF

I'm attempting to use GDB to debug a PowerPC ELF image compiled by the Green Hills GHS compiler from C++ source. The GHS MULTI debugger uses a proprietary debugging format, but the compiler provides a -dwarf2 option to produce native DWARF-2…
Adam
  • 389
  • 1
  • 4
  • 8
0
votes
0 answers

How to get class information using dwarf information from Linux Executables?

Basically, How to list down all the class information using Dwarf information from Linux Executable. For Example : If a c++ project compile with debug symbol, and we have only Linux Executable with Debug Information than how we can print the the…
M Gem
  • 1
  • 3
0
votes
0 answers

DW_TAG unspecified type on nullptr?

We have an application that is compiled with a recent version of gcc (g++-7.2) Unfortunately, the production server is quite old and has a really old version of gdb (6.5.25-el5rh) It is difficult to debug the software on site, because gdb does not…
phi
  • 71
  • 7