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


David Lamy-Charrier wrote:
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...

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


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