Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
40 views

For -std=c17 (and higher) DW_AT_language is C11: $ echo "int x;" | gcc -c -xc - -fPIC -o x.o -g -std=c17 $ gcc -shared -o x.so x.o $ readelf x.so -w | grep -P '(DW_AT_language\s*:|DWARF ...
pmor's user avatar
  • 6,757
4 votes
1 answer
879 views

I need some help, trying to put this very basic DWARF example to work. I found this link: Dwarf hello world assembly example or tutoral?, where the only answer says "...there is a simple "...
nostromo's user avatar
  • 423
2 votes
1 answer
109 views

MSVC has a very useful flag /SOURCELINK. This allows you to tell where in your versioning system the sources are stored, such that they can be downloaded. For example: (Also holds for C++) { "...
JVApen's user avatar
  • 11.5k
0 votes
0 answers
42 views

I have a DIE that looks like this (output from llvm-dwarfdump): DW_AT_Location [DW_FORM_sec_offset] (0x00000e65) [0x000000001c1ef510, 0x00000000mc1ef530] [0x000000001c1ef5d1, 0x00000000mc1ef5d5] ...
user2296145's user avatar
0 votes
0 answers
78 views

I'm trying to implement my own debugger, and I've implemented a way of parsing DWARF4 information contained in the executable.When printing out the line entry table generated by the Line Number ...
franzageek's user avatar
1 vote
1 answer
70 views

I am working on some low-level project. This project has many c files which has function calls to .s files. Now how to get the stack unwinding for this kind of situation, as dwarf cfi frames won't be ...
Chintha Siva Prasad's user avatar
3 votes
0 answers
109 views

Context I'm creating an DWARF parser, this parser must be able to detect which classes are abstract classes. The parser is created to parse the output of a certain code-base. I have a working method ...
Petzep's user avatar
  • 53
1 vote
1 answer
73 views

Even when building with the default development profile (cargo build), the generated debuginfo often only includes the last segment of paths to source files. This then affects the output of perf, ...
Camelid's user avatar
  • 1,655
2 votes
2 answers
236 views

I'm trying to implement a function that retrieves the call stack unwinding from the caller. Take the following program as an example: // test.c void func2(int a, double b, int* c) { ...
Jordan's user avatar
  • 23
1 vote
1 answer
124 views

I have a shared library /opt/evince-3.28.4/lib/evince/4/backends/libpdfdocument.so. In GDB, I can easily detect a function at offset 0xa830 of this library, as shown below: (gdb) disas 0xa830 Dump of ...
TheAhmad's user avatar
  • 940
0 votes
1 answer
187 views

My compiler is writing DWARF DIE's and I am currently coming across an issue with tracking variables. For example, the abbreviation would look something like: DW_AT_name DW_FORM_string ...
Connor's user avatar
  • 13
1 vote
0 answers
157 views

Generated by compiler I'm adding debug info to a go compiller (github.com/goplus/llgo) that used LLVM as backend, it passed in most cases, excludes a few simple cases likes below: func ...
Jacky Lee's user avatar
  • 1,374
0 votes
1 answer
408 views

I want to understand when Linux with BPF BTF enabled, what is the process of extracting BTF from kernel image vmlinux binary that has BTF info encoded and mount in /sys/kernel/btf/vmlinux, I get that ...
99Linux's user avatar
  • 186
1 vote
0 answers
46 views

iOS binary, release build, ARM64. I am looking at a function that does some floating point work. The binary has both an __unwind_info section and an __eh_frame section. The IP (PC) for the function ...
Seva Alekseyev's user avatar
1 vote
1 answer
78 views

Consider the following C code: struct all_t { unsigned a:13; char b; }; struct all_t all; int main(int argc, char* argv[]) { all.b = 3; all.a = 0xf; printf("%d\n", ...
so.very.tired's user avatar
0 votes
1 answer
58 views

I have a .out eabi binary file and I'm trying to parse out all the symbol names, addresses, types, and byte sizes. I found some information about this using readelf, but its not super clear to me ...
user1174394's user avatar
0 votes
0 answers
438 views

I am using Emscripten to compile C++ source code into WASM modules. I am compiling with several debug settings and am able to get the module to print out the line number in the WASM where the error ...
Josh Majors's user avatar
1 vote
1 answer
480 views

The test code below produces a breakpad minidump, and GDB cannot display the stack from the dmp converted to core using minidump-2-core. Why does minidump-2-core need debug symbols in order to ...
patraulea's user avatar
  • 986
0 votes
1 answer
40 views

I am using a python script which runs OBJDUMP to extract dwarf information from an elf file, this is part of the code: # Run objdump to extract DWARF information from the ELF file ps = ...
ziz's user avatar
  • 1
1 vote
1 answer
995 views

I'm hacking the Linux kernel v5.15 and try to debug it with gdb line by line. I've opened the dwarf debug info through make menuconfig. However, it seems that some line will still be skipped. I find ...
Lemonorn's user avatar
1 vote
1 answer
379 views

We have some static libraries for a know arch (e.g. powerpc) in which we need to display source code with disassembly to perform some asm review activities. However, the binaries were cross-compiled ...
JoseleMG's user avatar
  • 312
1 vote
0 answers
3k views

I'm trying to update a complex project to use newer toolchain. Previous toolchain: GCC 4.9.2; C++11; CMake 3.10.1; Binutils 2.23.52; GDB 8.0.1 Newer toolchain: GCC 13.1; C++20; CMake 3.26.3; Binutils ...
Cat Dynamics's user avatar
1 vote
1 answer
91 views

I have been going through the assembly code of the sort program in the GNU Coreutils and found something I can't figure out and explain in a technological sense of why this is happening. It all ...
Jay's user avatar
  • 394
1 vote
1 answer
251 views

I'm going through a book on x64 assembly. The book described a little on how to use gdb I was able to examine integers however print wouldn't work. examine would work for integers if I included the ...
Tim's user avatar
  • 169
3 votes
0 answers
52 views

I'm writing a JIT that compiles c fragments using libtcc to an ELF object (output type TCC_OUTPUT_OBJ) with dwarf-5 debug info, loads the resulting ELF object manually (mapping, relocating and linking ...
Cyan Ogilvie's user avatar
3 votes
1 answer
204 views

I'm building a custom ELF object loader which resolves the library dependencies (DT_NEEDED) and recursively loads those, performs relocations and symbol resolution, calls preinit, etc. ld.so is ...
Cyan Ogilvie's user avatar
1 vote
1 answer
1k views

I am trying to implement a dwarf parser in c++ without using any external dependencies. As mentioned in dwarf5 standard, debug info first 4 bytes or 12 bytes denotes the unit length Basically this: ...
Rishi's user avatar
  • 70
0 votes
1 answer
292 views

Consider the following AVR program: #define F_CPU 500000ul #include <avr/io.h> #include <util/delay.h> // Not used, but it has significance. I suspect its presence is causing some ...
navnav's user avatar
  • 259
1 vote
1 answer
605 views

Libdw, part of elfutils, is more recent than libdwarf. Unfortunately there is virtually no available documentation, nor examples. I just finished writing a program that, given an instruction pointer ...
Carlo Wood's user avatar
  • 7,155
1 vote
0 answers
91 views

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 ...
Troels Lund's user avatar
0 votes
1 answer
576 views

Summary I have a C++ ARM TrustZone project which is running on a R7FA4M2 controller and the embOS-MPU RTOS should be used. When I try do debug this project, the debugger does not find the source files ...
Fabian's user avatar
  • 1
1 vote
1 answer
214 views

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 ...
Seva Alekseyev's user avatar
0 votes
0 answers
890 views

I think I have the correct understanding of my question, but as I'm going purely with documentation and intuition, I was hoping someone with more expertise than me could verify or correct my ...
Jay's user avatar
  • 394
0 votes
0 answers
150 views

When reading about sections like .eh_frame and .debug_frame in the DWARF standard it says that in Frame Description Entries (FDE) there is a field that's called: address_range (target address) The ...
carmius's user avatar
  • 161
1 vote
1 answer
131 views

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&...
flansel's user avatar
  • 45
2 votes
1 answer
1k views

Preface: I apologize for the lengthy preparation for my question, the reason for this is to make sure this post is self-contained and wanted to include all of the necessary information that I found. ...
Jay's user avatar
  • 394
0 votes
1 answer
124 views

Is there a way to extract the uuid from a dSYM on linux? And specifically on CentOS if it's possible. I tried to use dwarfdump, mediainfo, exiftool, llvm-dwarfdump, and I Couldn't extract it. ...
Avi Gelkop's user avatar
3 votes
1 answer
2k views

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 ...
Fee's user avatar
  • 897
0 votes
1 answer
628 views

I am learning LLVM and trying to write a backend for a specific target architecture. When I compile a hello-world with clang -g, the result of llvm-dwarfdump --verify is as follows. I traced the ...
user avatar
1 vote
1 answer
258 views

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 (....
Fee's user avatar
  • 897
0 votes
1 answer
293 views

I compile an ELF file including debug info and then read the debug-info back and parse it to get a list of all variables (global variables and class variables) in the RAM. This already works with the ...
Martin's user avatar
  • 31
0 votes
3 answers
636 views

I am wondering how the location information of a variable is presented in a dwarf-file (a file with debug symbols), when the variable is declared as extern. A very simple example to illustrate my ...
DeadCat's user avatar
  • 29
2 votes
0 answers
171 views

(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 ...
stefanct's user avatar
  • 3,048
1 vote
1 answer
1k views

#include <stdio.h> #define A "hello world\n" void main() { printf(A); } $ gcc -gdwarf-4 -g3 a.c \ && gdb -ex 'set confirm off' \ -ex 'break main' \ -ex 'run' ...
x-yuri's user avatar
  • 19.4k
0 votes
0 answers
858 views

I want to build a linux kernel with as many C source files as possible for testing, so I use make allyesconfig at first. Meanwhile I need debug info, so I tried some ways to add it: make menuconfig ...
Absoler's user avatar
1 vote
2 answers
652 views

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, ...
SangYoon's user avatar
0 votes
0 answers
77 views

It's ./drivers/net/virtio_net.c in linux kernel 6.0.0 and compiled to virtio_net.o with optimization -O2 and debuginfo(dwarf4). The readelf --debug-dump=decodedline drivers/net/virtio_net.o shows: ...
Absoler's user avatar
1 vote
1 answer
11k views

I installed gcc 11 using homebrew on my machine (linux 20.04). And It is not running on vscode as it shows as: unrecognized option '--gdwarf-5' I'm not sure if it's a path problem or not. Cause when ...
Hasib Al Fuad's user avatar
1 vote
1 answer
56 views

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 ....
yugr's user avatar
  • 22.7k
0 votes
0 answers
146 views

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 ...
radong's user avatar
  • 45

1
2 3 4 5
7