This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Convenience variable for filename in add-symbol-file not expanded


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
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]