oh so gdb actually is crashing in a completely different spot regardless of the bug Ok I really do give up holy shit
This commit is contained in:
parent
8bbaad6da3
commit
b362e3764f
3 changed files with 4 additions and 7 deletions
2
Makefile
2
Makefile
|
|
@ -1,5 +1,5 @@
|
||||||
SOURCES := src/main.c src/util/calloc.c src/util/string.c src/util/hash.c src/lexer/lexer.c src/builtins/builtins.c src/util/memset.c
|
SOURCES := src/main.c src/util/calloc.c src/util/string.c src/util/hash.c src/lexer/lexer.c src/builtins/builtins.c src/util/memset.c
|
||||||
CFLAGS := -Oz -nostdlib
|
CFLAGS := -g -Oz -nostdlib
|
||||||
|
|
||||||
UNAME := $(shell uname)
|
UNAME := $(shell uname)
|
||||||
ARCH := $(shell uname -m)
|
ARCH := $(shell uname -m)
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ int msh_execute(char *cmd, char **args) {
|
||||||
SIZE_TYPE ret;
|
SIZE_TYPE ret;
|
||||||
char *status_str;
|
char *status_str;
|
||||||
|
|
||||||
// msh_linux_setup_signals();
|
/* msh_linux_setup_signals(); */
|
||||||
|
|
||||||
ret = (SIZE_TYPE)SYSCALL(waitid, P_ALL, fork, &status, WEXITED, &ru);
|
ret = (SIZE_TYPE)SYSCALL(waitid, P_ALL, fork, &status, WEXITED, &ru);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,7 @@
|
||||||
#include <asm-generic/signal-defs.h>
|
#include <asm-generic/signal-defs.h>
|
||||||
#include <asm-generic/signal.h>
|
#include <asm-generic/signal.h>
|
||||||
|
|
||||||
#define INIT_SIGNAL(x) \
|
#define INIT_SIGNAL(x) SYSCALL(rt_sigaction, x, &sigact, 0, sizeof(sigset_t));
|
||||||
SYSCALL(rt_sigaction, x, &sigact, &sigact_old, sizeof(sigset_t));
|
|
||||||
|
|
||||||
static void signal_handler(int sig) {
|
static void signal_handler(int sig) {
|
||||||
char *status_str = msh_allocate(64);
|
char *status_str = msh_allocate(64);
|
||||||
|
|
@ -25,16 +24,14 @@ static void signal_restorer(void) { SYSCALL_0(rt_sigreturn); }
|
||||||
|
|
||||||
void msh_linux_setup_signals() {
|
void msh_linux_setup_signals() {
|
||||||
struct sigaction sigact;
|
struct sigaction sigact;
|
||||||
struct sigaction sigact_old;
|
|
||||||
|
|
||||||
memset(&sigact, 0, sizeof(sigact));
|
memset(&sigact, 0, sizeof(sigact));
|
||||||
memset(&sigact_old, 0, sizeof(sigact));
|
|
||||||
|
|
||||||
sigact.sa_handler = signal_handler;
|
sigact.sa_handler = signal_handler;
|
||||||
sigact.sa_restorer = signal_restorer;
|
sigact.sa_restorer = signal_restorer;
|
||||||
sigact.sa_flags = SA_RESTORER | SA_RESTART | SA_SIGINFO;
|
sigact.sa_flags = SA_RESTORER | SA_RESTART | SA_SIGINFO;
|
||||||
|
|
||||||
SYSCALL(rt_sigprocmask, SIG_UNBLOCK, &sigact.sa_mask, &sigact_old.sa_mask,
|
SYSCALL(rt_sigprocmask, SIG_UNBLOCK, &sigact.sa_mask, &sigact.sa_mask,
|
||||||
sizeof(sigset_t));
|
sizeof(sigset_t));
|
||||||
|
|
||||||
INIT_SIGNAL(SIGINT);
|
INIT_SIGNAL(SIGINT);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue