From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10058 invoked by alias); 9 Sep 2010 12:31:00 -0000 Received: (qmail 10042 invoked by uid 22791); 9 Sep 2010 12:30:57 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,TW_KG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 09 Sep 2010 12:30:43 +0000 Received: (qmail 20864 invoked from network); 9 Sep 2010 12:30:41 -0000 Received: from unknown (HELO ?192.168.44.101?) (nathan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 9 Sep 2010 12:30:41 -0000 Message-ID: <4C88D379.6000200@codesourcery.com> Date: Thu, 09 Sep 2010 14:52:00 -0000 From: Nathan Sidwell User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.12) Gecko/20100826 Thunderbird/3.0.7 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: add enable-inprocess-agent configure option Content-Type: multipart/mixed; boundary="------------040100080604090804080001" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-09/txt/msg00196.txt.bz2 This is a multi-part message in MIME format. --------------040100080604090804080001 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 345 This patch adds explicit configure control over whether the fast/static-tracepoint inprocess agent is built, on targets that support it. Also, if you explicitly enable the agent, but the target does not support it, you get a configure-time error. ok? nathan -- Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery --------------040100080604090804080001 Content-Type: text/plain; name="all.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="all.diff" Content-length: 3340 2010-09-09 Nathan Sidwell * configure.ac: Add --enable-inprocess-agent option. * configure: Rebuilt. Index: gdb/gdbserver/configure.ac =================================================================== --- gdb/gdbserver/configure.ac (revision 298677) +++ gdb/gdbserver/configure.ac (working copy) @@ -357,15 +357,35 @@ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), [gdbsrv_cv_have_visibility_hidden=no]) CFLAGS="$saved_cflags" + IPA_DEPFILES="" +extra_libraries="" -# Rather than allowing to build a broken IPA, we simply disable it if -# we don't find a compiler supporting all the features we need. +# check whether to enable the inprocess agent if test "$ipa_obj" != "" \ -a "$gdbsrv_cv_have_sync_builtins" = yes \ -a "$gdbsrv_cv_have_visibility_hidden" = yes; then - IPA_DEPFILES="$ipa_obj" - extra_libraries="libinproctrace.so" + have_ipa=true +else + have_ipa=false +fi + +AC_ARG_ENABLE(inprocess-agent, +AS_HELP_STRING([--enable-inprocess-agent], [inprocess agent]), +[case "$enableval" in + yes) want_ipa=true ;; + no) want_ipa=false ;; + *) AC_MSG_ERROR([bad value $enableval for inprocess-agent]) ;; +esac], +[want_ipa=$have_ipa]) + +if $want_ipa ; then + if $have_ipa ; then + IPA_DEPFILES="$ipa_obj" + extra_libraries="$extra_libraries libinproctrace.so" + else + AC_MSG_ERROR([inprocess agent not supported for this target]) + fi fi AC_SUBST(GDBSERVER_DEPFILES) Index: gdb/gdbserver/configure =================================================================== --- gdb/gdbserver/configure (revision 298677) +++ gdb/gdbserver/configure (working copy) @@ -680,6 +680,7 @@ enable_werror with_pkgversion with_bugurl with_libthread_db +enable_inprocess_agent ' ac_precious_vars='build_alias host_alias @@ -1309,6 +1310,8 @@ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-werror treat compile warnings as errors + --enable-inprocess-agent + inprocess agent Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -4904,15 +4907,38 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$saved_cflags" + IPA_DEPFILES="" +extra_libraries="" -# Rather than allowing to build a broken IPA, we simply disable it if -# we don't find a compiler supporting all the features we need. +# check whether to enable the inprocess agent if test "$ipa_obj" != "" \ -a "$gdbsrv_cv_have_sync_builtins" = yes \ -a "$gdbsrv_cv_have_visibility_hidden" = yes; then - IPA_DEPFILES="$ipa_obj" - extra_libraries="libinproctrace.so" + have_ipa=true +else + have_ipa=false +fi + +# Check whether --enable-inprocess-agent was given. +if test "${enable_inprocess_agent+set}" = set; then : + enableval=$enable_inprocess_agent; case "$enableval" in + yes) want_ipa=true ;; + no) want_ipa=false ;; + *) as_fn_error "bad value $enableval for inprocess-agent" "$LINENO" 5 ;; +esac +else + want_ipa=$have_ipa +fi + + +if $want_ipa ; then + if $have_ipa ; then + IPA_DEPFILES="$ipa_obj" + extra_libraries="$extra_libraries libinproctrace.so" + else + as_fn_error "inprocess agent not supported for this target" "$LINENO" 5 + fi fi --------------040100080604090804080001--