Код: Выделить всё
crash.shКод: Выделить всё
#!/bin/bash
g++ -o crash crash.cpp -g -O2
objcopy --only-keep-debug crash crash.debug
strip crash
./crash
Код: Выделить всё
crash.cppКод: Выделить всё
#include
#include
#include
static void sigsegv_handler(int sig)
{
size_t bufsize = 100;
void *buffer[bufsize];
int numptrs;
numptrs = ::backtrace(buffer, bufsize);
char **strings;
strings = ::backtrace_symbols(buffer, bufsize);
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79765201/analyze-backtrace-of-linux-executable-with-separated-debug-files[/url]
Мобильная версия