From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25930 invoked by alias); 10 Nov 2005 16:17:33 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 25873 invoked by uid 22791); 10 Nov 2005 16:17:27 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 10 Nov 2005 16:17:27 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1EaF76-0006Uv-Rk; Thu, 10 Nov 2005 11:17:24 -0500 Date: Thu, 10 Nov 2005 16:17:00 -0000 From: Daniel Jacobowitz To: Vladimir Prus Cc: gdb@sources.redhat.com Subject: Re: convenience variables in "target remote" Message-ID: <20051110161724.GA24925@nevyn.them.org> Mail-Followup-To: Vladimir Prus , gdb@sources.redhat.com References: <20051110134340.GA21648@nevyn.them.org> <200511101703.15903.ghost@cs.msu.su> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200511101703.15903.ghost@cs.msu.su> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-11/txt/msg00220.txt.bz2 On Thu, Nov 10, 2005 at 05:03:15PM +0300, Vladimir Prus wrote: > That's pretty vague, I think. Does documentation say where exactly that "(C)" > expression evaluator is used? If not, then guesswork is the only way to find > out. Really, it's pretty obvious. It's used in the same places we're evaluating an expression in the context of the target program / architecture. Print, call, set. > > Most places > > that take a number do not support them; that's by design, the full > > range of expressions are not supported for ports. > > In fact, it seems like only literals are supported for ports. This, just like > requirements that "x" command accept only literal as the number of bugs, > seems like arbitrary restriction for me. > > Specifically, in KDevelop for remote debugging, user should provide a shell > script to run program remotely, and a gdb script to connect to a program. > The gdb script can just containg "target remote somehost:1234". But I don't > think it's unreasonable for two people to remotely debug program on the same > box. So, port should not be hardcoded. > > I though about using convenience variables to pass port number from "run > program" script to "connect to target" gdb script, but due to above > limitation, this is not possible. So, I should have shell script that will be > given port number and will produce the set of gdb commands to connect to the > target. Another level of scripting just to overcome arbitrary restriction in > gdb. Or an arbitrary restriction in kdevelop, which is what it looks like to me. We could add support for "convenience variables" just about anywhere. But in general, we want them to behave exactly like target variables, set in the running program; that's how they're defined, with the very specific exceptions of the $arg* variables. In places where, say, a user-defined struct type wouldn't make any sense, convenience variables are probably inappropriate. This is one part of the CLI that I'm trying to hold feature creep to a minimum, pending a better-specified scripting language. -- Daniel Jacobowitz CodeSourcery, LLC