public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM] gsoc-kayral-python: Add Python command to handle segmentation faults. (check_segfault)
@ 2009-08-22 13:38 kayral
0 siblings, 0 replies; only message in thread
From: kayral @ 2009-08-22 13:38 UTC (permalink / raw)
To: archer-commits
The branch, gsoc-kayral-python has been updated
via 2b4a13e414cb0a96fa70364c2463d380b51f0156 (commit)
from 713204c118bbf07c3d55c6bbe8a4676a74902422 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit 2b4a13e414cb0a96fa70364c2463d380b51f0156
Author: oguz <oguz@pardus.(none)>
Date: Sat Aug 22 16:37:54 2009 +0300
Add Python command to handle segmentation faults. (check_segfault)
-----------------------------------------------------------------------
Summary of changes:
gdb/Makefile.in | 5 ++-
gdb/python/lib/gdb/command/check_segfault.py | 35 ++++++++++++++++++++++++++
2 files changed, 38 insertions(+), 2 deletions(-)
create mode 100644 gdb/python/lib/gdb/command/check_segfault.py
First 500 lines of diff:
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index d86da04..f08a200 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2006,8 +2006,9 @@ PY_FILES = gdb/FrameIterator.py gdb/FrameWrapper.py gdb/command/alias.py \
gdb/command/backtrace.py gdb/command/require.py \
gdb/command/pahole.py gdb/command/upto.py gdb/command/__init__.py \
gdb/command/ignore_errors.py gdb/command/save_breakpoints.py \
- gdb/function/caller_is.py gdb/function/in_scope.py \
- gdb/function/__init__.py gdb/backtrace.py gdb/__init__.py
+ gdb/command/check_segfault.py gdb/function/caller_is.py \
+ gdb/function/in_scope.py gdb/function/__init__.py \
+ gdb/backtrace.py gdb/__init__.py
# Install the Python library. Python library files go under
# $(pythondir).
diff --git a/gdb/python/lib/gdb/command/check_segfault.py b/gdb/python/lib/gdb/command/check_segfault.py
new file mode 100644
index 0000000..552b904
--- /dev/null
+++ b/gdb/python/lib/gdb/command/check_segfault.py
@@ -0,0 +1,35 @@
+# Copyright (C) 2009 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import gdb
+
+def sigsegv_handler (event):
+ if (event.stop_signal == "SIGSEGV"):
+ print "event type : %s" % (event.event_type)
+ print "stop reason: %s" % (event.stop_reason)
+ print "stop signal: %s" % (event.stop_signal)
+ gdb.execute ("backtrace")
+
+class Check_Segfault (gdb.Command):
+ """Check segfault."""
+
+ def __init__ (self):
+ gdb.Command.__init__ (self, "check_segfault", gdb.COMMAND_STACK)
+
+ def invoke (self, arg, from_tty):
+ gdb.selected_thread().signal_stop_eventregistry.connect (sigsegv_handler)
+ print "SIGSEGV handler registered."
+
+Check_Segfault ()
hooks/post-receive
--
Repository for Project Archer.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-22 13:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-22 13:38 [SCM] gsoc-kayral-python: Add Python command to handle segmentation faults. (check_segfault) kayral
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).