Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Skip argv0-symlink.exp on target argv[0] isn't available
Date: Fri, 17 Oct 2014 13:27:00 -0000	[thread overview]
Message-ID: <54411933.702@redhat.com> (raw)
In-Reply-To: <874mv2ltut.fsf@codesourcery.com>

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


  reply	other threads:[~2014-10-17 13:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-16  6:29 Yao Qi
2014-10-16 17:48 ` Pedro Alves
2014-10-17  7:24   ` Yao Qi
2014-10-17 11:15     ` Pedro Alves
2014-10-17 13:20       ` Yao Qi
2014-10-17 13:27         ` Pedro Alves [this message]
2014-10-18 13:03           ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54411933.702@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox