This is the mail archive of the gdb-patches@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: [PATCH] Skip argv0-symlink.exp on target argv[0] isn't available


On 10/17/2014 02:16 PM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
> 
>> So how about instead of silently skipping the tests, call
>> unsupported, like:
>>
>>   global has_argv0
>>   set test "verify dereferenced value"
>>   if { $has_argv0 } {
>>      gdb_test "python print (arg0)" "0x.*$testfile\"" $test
>>   } else {
>>      unsupported $test
>>   }
>>
> 
> OK, fixed in the updated patch.
> 
>> etc.
>>
>>> +gdb_caching_proc gdb_has_argv0 {
>>> +    set result 0
>> ...
>>> +    # Helper proc.
>>> +    proc gdb_has_argv0_1 { exe } {
>> ...
>>> +    set result [gdb_has_argv0_1 $exe]
>>
>> And then in addition, add an assert here for the main OSs
>> we support, like so:
>>
>>  if { !$result
>>       && ([istarget *-*-linux*]
>>          || [istarget *-*-gnu*]
>>          || [istarget *-*-cygwin*]
>>          || [istarget *-*-mingw*]
>>          || [istarget *-*-darwin*]
>>          || [istarget *-*-bsd*]
>>          || [istarget *-*-solaris*]
>>          || [istarget *-*-msdosdjgpp*]
>>          || [istarget *-*-go32*]
>> 	 || [istarget *-*-aix*]
>>          || [istarget *-*-hpux*]) } {
>>     fail "argv[0] should be available on this target"
>>  }
>>
> 
> OK, I list all OSes GDB supports (extracted from configure.tgt and configure.ac).
> 
>>> +    # Helper proc.
>>> +    proc gdb_has_argv0_1 { exe } {
>>> +	global srcdir subdir
>>> +	global gdb_prompt hex decimal
>>> +
>>> +	gdb_exit
>>> +	gdb_start
>>> +	gdb_reinitialize_dir $srcdir/$subdir
>>> +	gdb_load "$exe"
>>
>> BTW, use clean_restart here?  (if so, I think 'global srcdir subdir'
>> becomes unnecessary too)
> 
> Unfortunately we can't.  clean_restart loads file from $objdir/$subdir,
> but $exe is in $objdir or $objdir/temp.
> 

OK.  This version looks good to me.

Thanks,
Pedro Alves


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