mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
norm: remove print_backtrace
This commit is contained in:
parent
d30db395a0
commit
f3a38fb430
3 changed files with 0 additions and 51 deletions
|
|
@ -1,32 +0,0 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* print_backtrace.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/03 11:56:35 by khais #+# #+# */
|
||||
/* Updated: 2025/03/03 13:02:28 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
#define _GNU_SOURCE // Important for dladdr
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <execinfo.h>
|
||||
#include <dlfcn.h>
|
||||
#include <string.h>
|
||||
|
||||
void print_backtrace() {
|
||||
void* buffer[100];
|
||||
int num_addresses = backtrace(buffer, 100);
|
||||
Dl_info info;
|
||||
|
||||
printf("Backtrace:\n");
|
||||
for (int i = 0; i < num_addresses; i++) {
|
||||
if (dladdr(buffer[i], &info)) {
|
||||
printf("\t%s (%s:%p)\n", info.dli_sname, info.dli_fname, buffer[i]);
|
||||
} else {
|
||||
printf("0x%p\n", buffer[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* print_backtrace.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/03 11:56:54 by khais #+# #+# */
|
||||
/* Updated: 2025/03/03 12:15:50 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef BACKTRACE_H
|
||||
#define BACKTRACE_H
|
||||
|
||||
void print_backtrace();
|
||||
|
||||
#endif // BACKTRACE_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue