From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36334 invoked by alias); 26 Mar 2015 16:15:43 -0000 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 Received: (qmail 36319 invoked by uid 89); 26 Mar 2015 16:15:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00,LIKELY_SPAM_BODY,SPF_PASS,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-HELO: userp1040.oracle.com Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 26 Mar 2015 16:15:36 +0000 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t2QGFSlM002620 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 26 Mar 2015 16:15:28 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t2QGFRNU016544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 26 Mar 2015 16:15:28 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t2QGFQlI009272; Thu, 26 Mar 2015 16:15:27 GMT Received: from termi.oracle.com (/88.128.80.124) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 26 Mar 2015 09:15:26 -0700 From: jose.marchesi@oracle.com (Jose E. Marchesi) To: Joel Brobecker Cc: Sergio Durigan Junior , gdb-patches@sourceware.org Subject: Re: [PATCH V4 5/9] New probe type: DTrace USDT probes. References: <1422874968-382-1-git-send-email-jose.marchesi@oracle.com> <1422874968-382-6-git-send-email-jose.marchesi@oracle.com> <87r3tp722i.fsf@redhat.com> <20150325191418.GA32233@adacore.com> Date: Thu, 26 Mar 2015 16:15:00 -0000 In-Reply-To: <20150325191418.GA32233@adacore.com> (Joel Brobecker's message of "Wed, 25 Mar 2015 12:14:18 -0700") Message-ID: <87bnjfraq1.fsf@oracle.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00856.txt.bz2 Hi Joel! > > + /* Try to parse a type expression from the type string. If > > + this does not work then we set the type to `long > > + int'. */ > > + arg.type = builtin_type (gdbarch)->builtin_long; > > + expr = parse_expression (arg.type_str); ^^^^^^^^^^^^^^^^ there The most obvious issue is that type "mutex_t" does not exist in my program, so I think that the code should handle that case. Certainly. The second, less obvious issue, is that the parsing is done using the current language, which I don't think is a good idea. Attached is small prototype that attempts to do something like that. I think we need a function that parses an expression using a specific language, but I went for short prototype to test my theory first. That solves most of the issues, even if I don't really know if it's not just sweeping them under the carpet instead. Well, the TRY..CATCH in your prototype would catch any error that may be thrown in parse_expression, and the `set_language' must take care of changing the language, so I would say that is enough... And once I had that fixed, the next issue that I looked at was: (gdb) b adainit Breakpoint 1 at 0x8051f03 (gdb) run Starting program: /[...]/a [Thread debugging using libthread_db enabled] zsh: 12378 segmentation fault (core dumped) /[...]/gdb -q a This is where I'm getting even more out of my league, here. The SEGV happens on the following line: 377 uint32_t enabler_offset 378 = ((uint32_t *) eofftab)[DOF_UINT (dof, probe->dofpr_enoffidx) + i]; I will debug that SIGSEGV in solaris, but the problem seems to be related to the DOF program embedded in your program, more than to the platform. Could you please send me your sparc-solaris reproducer? Salud!