From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4013 invoked by alias); 29 Sep 2005 13:38:15 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 3788 invoked by uid 22791); 29 Sep 2005 13:37:43 -0000 Received: from nproxy.gmail.com (HELO nproxy.gmail.com) (64.233.182.192) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 29 Sep 2005 13:37:43 +0000 Received: by nproxy.gmail.com with SMTP id l37so612620nfc for ; Thu, 29 Sep 2005 06:37:41 -0700 (PDT) Received: by 10.48.226.11 with SMTP id y11mr46727nfg; Thu, 29 Sep 2005 06:37:41 -0700 (PDT) Received: by 10.48.157.14 with HTTP; Thu, 29 Sep 2005 06:37:41 -0700 (PDT) Message-ID: <6541ed4c0509290637259f1b9f@mail.gmail.com> Date: Thu, 29 Sep 2005 13:38:00 -0000 From: David Lamy-Charrier Reply-To: David Lamy-Charrier To: gdb@sources.redhat.com Subject: Re: Convenience variable for filename in add-symbol-file not expanded In-Reply-To: <433BE4EE.6040100@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200509291235.j8TCZHg16388@haiti.swb.siemens.de> <6541ed4c0509290550663f5331@mail.gmail.com> <433BE4EE.6040100@st.com> X-SW-Source: 2005-09/txt/msg00244.txt.bz2 Thanks Andrew, I already have a static buffer in the inferior program containing the path to the file I want to use. You mean that I should declare a pointer to the variable in the inferior program too ? And then how can I access the pointed value in gdb, using value_of_internalvar() or parse_and_eval_address() or anything else) ? Thanks, David > I wanted to do much the same thing a while back. > > Unless I am very much mistaken, there is no way to assign a string to a > convenience variable. The nearest you can get is to place it in the > inferior program's memory somewhere (perhaps using malloc, or some fixed > location) and then assign a pointer to the variable. Obviously you can't > do this until there is some memory to write to. However, you could > extend the patch to expect a 'char *' variable for the name. > > Also, all convenience variables are wiped by the file and symbol-file > commands (because their types disappear along with the old symbol > table), so they aren't that convenient for scripting this kind of thing. > > Andrew >