diff options
author | Malfurious <m@lfurio.us> | 2024-04-24 13:32:58 -0400 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2024-04-24 13:32:58 -0400 |
commit | c0a76847fbabd5742ec4b678b9588f394fbefc78 (patch) | |
tree | b80b15c03034aeea0376766bc87cc53563138398 /helpers.c | |
parent | 1b5f8d2e5a118a80a4373a7be1ca4e4eceebf7be (diff) | |
parent | b86dd03abe59b6b410de4da3e44f62e62599c5ce (diff) | |
download | misplays-c0a76847fbabd5742ec4b678b9588f394fbefc78.tar.gz misplays-c0a76847fbabd5742ec4b678b9588f394fbefc78.zip |
Merge branch 'threads'
This branch adds initial support for multithreaded targets, as well as
forking and exec syscalls. All of the bugs from initial testing are
fixed so far.
* threads: (25 commits)
Don't spin waiting to interrupt zombie process
Allow termination and exec events to propagate immediately
Implement support for PTRACE_EVENT_FORK and ui
Handle PTRACE_EVENT_EXIT to capture a final state snapshot
Detect out-of-band thread exec state changes to prevent deadlock
Enable user creation of thread-specific breakpoints
Add orig_rax to register display
Tweak SCHEDULER_DELAY for use with installing breakpoints
Ignore breakpoints during singlestep
Fix bug with cleaning temporary breakpoints
Independent thread control refactor
Multithread version 3
Add strict_strtoul
Prevent lingering traps after detach
Handle PTRACE_EVENT_EXEC
Workaround SIGSTOP on child process startup
setpgid is redundant with setsid and causes an error
Display name of pending signal
dbg_realcont for testing purposes
Display installed status of breakpoints
...
Diffstat (limited to '')
-rw-r--r-- | helpers.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -11,6 +11,12 @@ void *xmalloc(size_t size) { return ptr; } +unsigned long strict_strtoul(const char *nptr, int base) { + char *endptr; + unsigned long ret = strtoul(nptr, &endptr, base); + return (*endptr ? 0 : ret); +} + void cursinit(void) { setlocale(LC_ALL, ""); initscr(); @@ -20,6 +26,14 @@ void cursinit(void) { curs_set(FALSE); timeout(25); refresh(); + + start_color(); + use_default_colors(); + + init_pair(1, COLOR_GREEN, -1); + init_pair(2, COLOR_CYAN, -1); + init_pair(3, COLOR_RED, -1); + init_pair(4, COLOR_YELLOW, -1); } void cursupdate(void) { @@ -57,3 +71,11 @@ int pprintw(PANEL *pan, const char *fmt, ...) { int pclear(PANEL *pan) { return wclear(panel_window(pan)); } + +int pattron(PANEL *pan, int attrs) { + return wattron(panel_window(pan), attrs); +} + +int pattroff(PANEL *pan, int attrs) { + return wattroff(panel_window(pan), attrs); +} |