From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5770 invoked by alias); 12 Jan 2011 19:28:01 -0000 Received: (qmail 5758 invoked by uid 22791); 12 Jan 2011 19:28:00 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from a4.complang.tuwien.ac.at (HELO a4.complang.tuwien.ac.at) (128.130.173.65) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Jan 2011 19:27:55 +0000 Received: from anton by a4.complang.tuwien.ac.at with local (Exim 4.69) (envelope-from ) id 1Pd6MI-0007y4-T0 for gdb@sourceware.org; Wed, 12 Jan 2011 20:27:50 +0100 Date: Wed, 12 Jan 2011 19:28:00 -0000 From: Anton Ertl To: gdb@sourceware.org Subject: Dealing with version-specific syntax Message-ID: <20110112192750.GA30525@a4.complang.tuwien.ac.at> Reply-To: anton@mips.complang.tuwien.ac.at MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-01/txt/msg00036.txt.bz2 What I am trying to do: Get the disassembly for a specific address range. And I try to do it with gdb. The problem here ist that as far as I can tell, up to gdb-7.0 the way to do this is disassemble 0x404E22 0x404E40 Starting from gdb-7.1, this syntax is invalid, and instead we have to use disassemble 0x404E22,0x404E40 Unfortunately, this syntax does something else in gdb-7.0 and earlier (it disassembles whole functions). Is there a good way inside gdb for deciding which syntax to use? Ideally, I would test if the space-separated syntax works, and use it if it does, and otherwise use the comma-syntax. Or I might test for the gdb version and use the syntax depending on that. If there is no easy way, we will probably take the approach of testing the gdb version outside of gdb. - anton