String argument within a gdb command file

First Last nvk4444@yahoo.com
Wed Jan 11 06:57:00 GMT 2012


Hi,
 
I am trying to use add-symbol-file with arguments within a gdb command file.
add-symbol-file $filename $load_addr
I found that the $filename is not evaluated
 
(gdb) add-symbol-file $filename $load_addr
add symbol table from file "$filename" at
        .text_addr = 0x800000
(y or n) 

but print $filename works.
(gdb) print $filename
$1 = 0xabcd5678 "correct-obj-file.o"
(gdb) print $load_addr
$2 = (void*) 0x800000

I tried
shell awk '{printf "add-symbol-file $arg0 $arg1\n"}'
 
but, it did not help.
 
Any suggestions?
 
Thanks,
NK
 



More information about the Gdb mailing list