Unwinding the stack the hard way (lesenechal.fr)
from tedu to programming on 14 Aug 2023 05:36
https://azorius.net/g/programming/p/hYg2Qh92tq52BFJWlp-Unwinding-the-stack-the-hard-way

Let’s say you have a program, in C or Rust, whatever; and this program has a bug. The only thing you see in your terminal is the dreaded Segmentation fault (core dumped). Well… let’s say it’s a C program then. You would like to know what happened, and even fix that! Normal people would launch GDB and run bt to get a backtrace; but we aren’t normal people, we like to suffer. We will do our backtrace ourselves, and I don’t mean calling backtrace(): that is a rookie solution. And no, libunwind is not acceptable either; real developpers unwind their stack themselves with bare hands. In this article, we will delve into the intricacies of stack unwinding, exception-handling, call frames, and dissect ELFs and DWARFs.

#programming

threaded - newest