public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Put a breakpoint on __asan_report_error for ASAN
@ 2012-11-29 17:42 H.J. Lu
  2013-11-29 21:56 ` H.J. Lu
  0 siblings, 1 reply; 3+ messages in thread
From: H.J. Lu @ 2012-11-29 17:42 UTC (permalink / raw)
  To: gcc-patches

Hi,

This patch puts a breakpoint on __asan_report_error if CFLAGS contains
-fsanitize=address, similar to fancy_abort and internal_error.  OK to
install?


H.J.
--
2012-11-24  H.J. Lu  <hongjiu.lu@intel.com>

	* configure.ac: Append gdbasan.in to .gdbinit if CFLAGS contains
	-fsanitize=address.
	* configure: Regenerated.

	* gdbasan.in: New file.

diff --git a/gcc/configure b/gcc/configure
index e2c119e..004910f 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -27032,6 +27032,14 @@ if test "x$subdirs" != x; then
 fi
 echo "source ${srcdir}/gdbinit.in" >> .gdbinit
 
+# Put a breakpoint on __asan_report_error to help with debugging buffer
+# overflow.
+case "$CFLAGS" in
+*-fsanitize=address*)
+  echo "source ${srcdir}/gdbasan.in" >> .gdbinit
+  ;;
+esac
+
 gcc_tooldir='$(libsubdir)/$(libsubdir_to_prefix)$(target_noncanonical)'
 
 
diff --git a/gcc/configure.ac b/gcc/configure.ac
index c6f57bd..b9aaadb 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -5017,6 +5017,14 @@ if test "x$subdirs" != x; then
 fi
 echo "source ${srcdir}/gdbinit.in" >> .gdbinit
 
+# Put a breakpoint on __asan_report_error to help with debugging buffer
+# overflow.
+case "$CFLAGS" in
+*-fsanitize=address*)
+  echo "source ${srcdir}/gdbasan.in" >> .gdbinit
+  ;;
+esac
+
 gcc_tooldir='$(libsubdir)/$(libsubdir_to_prefix)$(target_noncanonical)'
 AC_SUBST(gcc_tooldir)
 AC_SUBST(dollar)
diff --git a/gcc/gdbasan.in b/gcc/gdbasan.in
new file mode 100644
index 0000000..cf05825
--- /dev/null
+++ b/gcc/gdbasan.in
@@ -0,0 +1,3 @@
+# Put a breakpoint on __asan_report_error to help with debugging buffer
+# overflow.
+b __asan_report_error
-- 
1.7.11.7

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-12-02  8:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-29 17:42 [PATCH] Put a breakpoint on __asan_report_error for ASAN H.J. Lu
2013-11-29 21:56 ` H.J. Lu
2013-12-02  8:09   ` Dodji Seketeli

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).