Hi, I am using the DejaGnu framework and my executables need a simulator to run. For one testcase (and only one, not for all testcases), I need to add some simulator options. I try to do it by creating a new dg function. For example in my code: /* { dg-runner-options sim options "-C EXTERNAL_MEMORY_SIZE=0x9000000" } */
In my library, the proc dg-runner-options is: dg-runner-options { args } { if { [llength $args] > 5 } { error "[lindex $args 0]: too many arguments" return } if { [llength $args] >= 5 } { switch [dg-process-target [lindex $args 4]] { "S" { set rflags [lindex $args 3] } "N" { return } "F" { error "[lindex $args 0]: `xfail' not allowed here" } "P" { error "[lindex $args 0]: `xfail' not allowed here" } } } else { set rflags [lindex $args 3] } set sim [lindex $args 1] set opt [lindex $args 2] set dest [board_info target name] set entry "$sim,$opt" if [board_info $dest exists $entry] { set simflags "[board_info $dest $entry] $rflags" } else { set simflags $rflags } set board_info($dest,$entry) $simflags } I have two questions: 1/ if I replace the line 'set board_info($dest,$entry) $simflags' by 'set_board_info $entry $simflags' I have an error message: ERROR: examples/test_0014/1.c: can't read "board": no such variable for " dg-runner-options 3 sim options "-C EXTERNAL_MEMORY_SIZE=0x9000000" " I try to add 'global board' or 'upvar <level> board' without any success. 2/ the procedure itself isn't functional. If I add this line at the end of the procedure: 'verbose "****check board_info $dest , $entry = [board_info $dest $entry]" 0' I always got an empty value. I don't know what to do. I found this subject in the archive list "Re: how to pass arguments to simulator" (http://lists.gnu.org/archive/html/dejagnu/2009-04/msg00002.html) but it covers all testcases and not a specific one. Thank you for your support. Best regards, -- JM PS: sorry for the mistakes but English isn't my native tongue. _____ __o ------- -\<, ------ ( )/ ( ) ~~~~~~~~~~~~~~~~~~~~~~~~~~~ "Work to Eat, Eat to Live, Live to Bike, Bike to Work" _______________________________________________ DejaGnu mailing list DejaGnu@gnu.org http://lists.gnu.org/mailman/listinfo/dejagnu