svn commit: samba r19150 - in branches/SAMBA_4_0/source/script: .
metze at samba.org
metze at samba.org
Fri Oct 6 18:04:49 GMT 2006
Author: metze
Date: 2006-10-06 18:04:48 +0000 (Fri, 06 Oct 2006)
New Revision: 19150
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19150
Log:
add a usefull tool to test the gdb_backtrace script
just compile it with
cc -g -o gdb_backtrace_test gdb_backtrace_test.c
and run it in the same directory where your gdb_backtrace script is.
metze
Added:
branches/SAMBA_4_0/source/script/gdb_backtrace_test.c
Changeset:
Added: branches/SAMBA_4_0/source/script/gdb_backtrace_test.c
===================================================================
--- branches/SAMBA_4_0/source/script/gdb_backtrace_test.c 2006-10-06 17:55:17 UTC (rev 19149)
+++ branches/SAMBA_4_0/source/script/gdb_backtrace_test.c 2006-10-06 18:04:48 UTC (rev 19150)
@@ -0,0 +1,42 @@
+/*
+
+add a usefull tool to test the gdb_backtrace script
+
+just compile it with
+cc -g -o gdb_backtrace_test gdb_backtrace_test.c
+
+and run it in the same directory where your gdb_backtrace script is.
+
+2006 - Stefan Metzmacher <metze at samba.org>
+
+*/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+
+static const char *prog;
+
+static void sig_fault(int sig)
+{
+ int ret;
+ char cmdstr[200];
+
+ snprintf(cmdstr, sizeof(cmdstr),
+ "./gdb_backtrace %u %s",
+ getpid(), prog);
+ printf("sig_fault start: %s\n", cmdstr);
+ ret = system(cmdstr);
+ printf("sig_fault end: %d\n", ret);
+}
+
+int main(int argc, const char **argv)
+{
+ prog = argv[0];
+
+ signal(SIGABRT, sig_fault);
+
+ abort();
+ return 0;
+}
More information about the samba-cvs
mailing list