Skip to content

Instantly share code, notes, and snippets.

Last active Dec 17, 2019
What would you like to do?
gdb --batch -return-child-result --args ./a.out
gcc -g test.c
set pagination off
set logging file gdb.txt
set logging on
init-if-undefined $_exitcode = -1
handle SIGTERM nostop print pass
handle SIGPIPE nostop noprint pass
if ($_exitcode == -1)
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
char *buf;
buf = malloc(1<<31);
fgets(buf, 1024, stdin);
printf("%s\n", buf);
return 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment