This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Convenience variable for filename in add-symbol-file not expanded
- From: David Lamy-Charrier <david dot lamy at gmail dot com>
- To: gdb at sources dot redhat dot com
- Date: Thu, 29 Sep 2005 14:50:04 +0200
- Subject: Re: Convenience variable for filename in add-symbol-file not expanded
- References: <200509291235.j8TCZHg16388@haiti.swb.siemens.de>
- Reply-to: David Lamy-Charrier <david dot lamy at gmail dot com>
Dieter,
Thanks for your response, but your solution allows to expand
convenience variable used
for section address parameter, I want to expand a convenience variable
for the filename parameter, so instead of value_as_address() it should
be a kind of value_as_string...
Regards,
David
On 9/29/05, Ruppert <dieter_ruppert@siemens.com> wrote:
>
>
> >Does anyone know if a patch exists for that ?
> >If not, could you give me some hints to implement it (any
> >parse_and_eval_string or equivalent i can use...) ?
> >
>
> If you can't find a more general solution:
> I got this working with the following local hack in
> parse-and_eval_address (this was gdb-6.1):
>
> CORE_ADDR addr;
> if (exp[0] == '$')
> {
>
> struct value* valx;
> valx = value_of_internalvar(lookup_internalvar(&exp[1]));
> if (TYPE_CODE( VALUE_TYPE(valx)) != TYPE_CODE_INT)
> error("Invalid type given as section address.");
> addr = value_as_address(valx);
> }
> else
> {
>
> ... the current code goes here
>
>
> HTH
>
> regards
> d.ruppert
> dieter_ruppert@siemens.com
>
>