From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11041 invoked by alias); 17 Apr 2009 22:16:23 -0000 Received: (qmail 11030 invoked by uid 22791); 17 Apr 2009 22:16:22 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 17 Apr 2009 22:16:17 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id F40DC2BAB28; Fri, 17 Apr 2009 18:16:15 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id sE0I5Fp1lFkg; Fri, 17 Apr 2009 18:16:15 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id BF7CA2BAB23; Fri, 17 Apr 2009 18:16:15 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 4EEE6F58C1; Fri, 17 Apr 2009 15:16:10 -0700 (PDT) Date: Fri, 17 Apr 2009 22:16:00 -0000 From: Joel Brobecker To: Eli Zaretskii , gdb-patches@sourceware.org Subject: Re: [RFA] print error message if (auto) disassembly failed Message-ID: <20090417221610.GX7585@adacore.com> References: <20090416173918.GP7557@adacore.com> <834owolc51.fsf@gnu.org> <20090416180146.GH7585@adacore.com> <831vrslb0f.fsf@gnu.org> <20090416190654.GJ7585@adacore.com> <83vdp4jn6j.fsf@gnu.org> <20090416235735.GO7585@adacore.com> <20090417173407.GC13377@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090417173407.GC13377@caradoc.them.org> User-Agent: Mutt/1.5.18 (2008-05-17) 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: 2009-04/txt/msg00467.txt.bz2 > > 2009-04-17 Joel Brobecker > > > > * stack.c (do_gdb_disassembly): Print an error message if an error > > was thrown while trying to perform the disassembly. > > > > I'm currently testing this patch on x86_64-linux, but I don't really > > expect any problem. > > My two cents: this should really match whatever x/i does. Is that > code now shared, or does it still have the old (IMO perfectly fine) > error message? The code is not shared. They both call gdbarch_print_insn to print the instruction but from different code paths. In the "x/i" case, I think that the top-level command exception handler ends up printing the exception message. In the case at hand, do_gdb_disassembly traps the exception. What my first patch does is just print the exception message to give the user a clue of what's going on. What the second patch adds is a bit of extra code to handle memory errors differently, in order to print the shorter error message. Since we can decide on the particular error message we want for memory errors is only midly related to the issue of printing something, I suggest I commit my first patch, and let Eli promote the idea of his shorter error message. I agree to write and test the change, but I don't want to spend time discussing something that I think is only cosmetic. -- Joel