From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126607 invoked by alias); 25 Feb 2016 02:09:09 -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 126441 invoked by uid 89); 25 Feb 2016 02:09:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1446, gdb.server, UD:gdb.server X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 25 Feb 2016 02:09:08 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id E8033C0005D1; Thu, 25 Feb 2016 02:09:06 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1P295Zg021057; Wed, 24 Feb 2016 21:09:05 -0500 Message-ID: <56CE6241.2060305@redhat.com> Date: Thu, 25 Feb 2016 02:09:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Luis Machado , gdb-patches@sourceware.org CC: gbenson@redhat.com Subject: Re: [PATCH 1/2] Debugging without a binary (regression) References: <1456324014-17961-1-git-send-email-lgustavo@codesourcery.com> <56CE5399.5060907@redhat.com> <56CE5A9E.6030306@codesourcery.com> In-Reply-To: <56CE5A9E.6030306@codesourcery.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-02/txt/msg00772.txt.bz2 On 02/25/2016 01:36 AM, Luis Machado wrote: > That's what i originally did with a single try/catch block, but i > noticed with two of them we are prone to having two warnings of the same > kind, one after the other. So i ended up leaving them empty. > > For example: > > warning: > /home/test/build-binutils-gdb/gdb/testsuite/outputs/gdb.server/attach-with-no-symbol/attach-with-no-symbol: > Permission denied.^M > warning: > /home/test/build-binutils-gdb/gdb/testsuite/outputs/gdb.server/attach-with-no-symbol/attach-with-no-symbol: > Permission denied.^M > > Shouldn't we go back to a single block? I'd think not. Pedantically, the file could fail to load as executable but load as symbol file. Also, if both fail, and the errors are different, having both may give a better hint to the user to fix whatever needs fixing. > Checking if both exceptions' messages match seems a bit too much. That doesn't sound so bad to me. static int exception_print_same (struct gdb_exception e1, struct gdb_exception e2) { const char *msg1 = e1.message; const char *msg2 = e2.message; if (msg1 == NULL) msg1 = ""; if (msg2 == NULL) msg2 = ""; return (e1.reason == e2.reason && e1.error == e2.error && strcmp (e1.message, e2.message) == 0); } ... CATCH (err, ...) { warn err; prev_err = err; } ... CATCH (err, ...) { if (!exception_print_same (prev_err, err)) warn err; } Thanks, Pedro Alves