Last active
December 17, 2019 19:25
-
-
Save kelunik/a5ae41c9a47bc29e965da1e6a5f5dd29 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gdb --batch --command=gdb.bt -return-child-result --args ./a.out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gcc -g test.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| run | |
| if ($_exitcode == -1) | |
| bt | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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