public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* String argument within a gdb command file
@ 2012-01-11  6:57 First Last
  2012-01-11 14:32 ` Tom Tromey
  2012-01-11 19:21 ` First Last
  0 siblings, 2 replies; 3+ messages in thread
From: First Last @ 2012-01-11  6:57 UTC (permalink / raw)
  To: gdb

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
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: String argument within a gdb command file
  2012-01-11  6:57 String argument within a gdb command file First Last
@ 2012-01-11 14:32 ` Tom Tromey
  2012-01-11 19:21 ` First Last
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2012-01-11 14:32 UTC (permalink / raw)
  To: First Last; +Cc: gdb

>>>>> "NK" == First Last <nvk4444@yahoo.com> writes:

NK> I am trying to use add-symbol-file with arguments within a gdb command file.
NK> add-symbol-file $filename $load_addr
NK> I found that the $filename is not evaluated

NK> Any suggestions?

You can use 'eval', or Python scripting.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: String argument within a gdb command file
  2012-01-11  6:57 String argument within a gdb command file First Last
  2012-01-11 14:32 ` Tom Tromey
@ 2012-01-11 19:21 ` First Last
  1 sibling, 0 replies; 3+ messages in thread
From: First Last @ 2012-01-11 19:21 UTC (permalink / raw)
  To: gdb

I set logging to a file and sourced the command file.
 
Thanks,
NK

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-11 19:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-11  6:57 String argument within a gdb command file First Last
2012-01-11 14:32 ` Tom Tromey
2012-01-11 19:21 ` First Last

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).