From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31789 invoked by alias); 29 Nov 2013 17:26:49 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 31777 invoked by uid 89); 29 Nov 2013 17:26:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL,BAYES_40,FREEMAIL_FROM,RDNS_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mail-ob0-f175.google.com Received: from Unknown (HELO mail-ob0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 29 Nov 2013 17:26:47 +0000 Received: by mail-ob0-f175.google.com with SMTP id uz6so10159761obc.6 for ; Fri, 29 Nov 2013 09:26:40 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.60.98.69 with SMTP id eg5mr25061340oeb.42.1385745999988; Fri, 29 Nov 2013 09:26:39 -0800 (PST) Received: by 10.76.105.174 with HTTP; Fri, 29 Nov 2013 09:26:39 -0800 (PST) In-Reply-To: <20121129174220.GB31369@intel.com> References: <20121129174220.GB31369@intel.com> Date: Fri, 29 Nov 2013 21:56:00 -0000 Message-ID: Subject: Re: [PATCH] Put a breakpoint on __asan_report_error for ASAN From: "H.J. Lu" To: GCC Patches Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg03813.txt.bz2 On Thu, Nov 29, 2012 at 9:42 AM, H.J. Lu wrote: > 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 > > * 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 Ping. -- H.J.