Differences between version 11 and previous revision of DeBugging.
Other diffs: Previous Major Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 11 | Last edited on Sunday, March 7, 2004 3:53:45 pm | by JohnMcPherson | Revert |
Older page: | version 10 | Last edited on Monday, February 23, 2004 2:13:21 pm | by JohnMcPherson | Revert |
@@ -29,16 +29,16 @@
If your program hangs, you can press Alt-\ to send it a SIGQUIT and force it to dump core. You can also force them to dump core with the command:
kill -QUIT ''programpid''
!Core files
-To create core files
you have to remove the ulimit(1) on them. This can be done with the command:
+To allow crashing programs to
create [CoreDump]s
you have to remove the ulimit(1) on them. This can be done with the command:
ulimit -c unlimited
-Note, this is for the shell (and all it's
children) only.
+Note, this is for the shell (and all its
children) only.
gdb(1) can also do postmortem analysis on core files like so:
gdb ./''program'' ./''corefile''
-If you run gdb(1) on your program and it displays the names of the functions but doesn't display their types (eg: what arguments they have or line number information) you probably didn't compile them with -g
+If you run gdb(1) on your program and it displays the names of the functions but doesn't display their types (eg: what arguments they have or line number information) you probably didn't compile them with "
-g".
! modifying a running process
You can use gdb to attach to a currently running process. For example, to change where its stderr is going: