Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kyle McMartin <kmcmarti@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCHv2] aarch64: detect atomic sequences like other ll/sc architectures
Date: Thu, 27 Mar 2014 15:45:00 -0000	[thread overview]
Message-ID: <20140327154546.GJ3075@redacted.bos.redhat.com> (raw)
In-Reply-To: <20140327130714.GB4030@adacore.com>

On Thu, Mar 27, 2014 at 06:07:14AM -0700, Joel Brobecker wrote:
> A few comments on the testcase. I have no further comments on the code
> itself.
> 
> > +#include <stdio.h>
> 
> Do you really need stdio.h, here? You do not seem to be making
> any function call in your function, so I do not see why it would
> be needed. On the other hand, having a dependency on stdio.h means
> that the testcase will not compile on many targets (eg: bare metal).
> 

Not that I'm aware of, I'd re-added it as I added some printfs for
debugging while writing the testcase and forgot to remove it again. (The
PPC64 one has it for some reason as well, likely the same reason.)

> > +
> > +int main()
> 
> Can you use "(void)" instead of "()"?
> 

Absolutely.

> > +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $compile_flags] != "" } {
> > +    unsupported "Testcase compile failed."
> > +    return -1
> > +}
> > +gdb_exit
> > +gdb_start
> > +gdb_reinitialize_dir $srcdir/$subdir
> > +gdb_load ${binfile}
> 
> Can you use standard_testfile and prepare_for_testing? See our testcase
> cookbook page at:
> https://sourceware.org/gdb/wiki/GDBTestcaseCookbook
> 
> It should replace all of the above after the "if istarget"...
> 

OK, testing this out now.

> > +if ![runto_main] then {
> > +    perror "Couldn't run to breakpoint"
> > +    continue
> 
> Also according to the cookbook, use:
> 
>     untested "could not run to main"
>     return -1
> 
> IIRC, with tcl, there isn't a huge distinction in this case between
> continue and return -1, but might as well follow the cookbook.
> 
> > +gdb_test continue "Continuing.*Breakpoint $decimal.*" \
> > +  "Continue until breakpoint"
> > +
> > +gdb_test next ".*__asm __volatile.*" \
> > +  "Step through the ldxr/stxr sequence"
> > +
> > +gdb_test next ".*return dword.*" \
> > +  "Stepped through sequence through conditional branch"
> 
> Can you put the "continue"/"next" inside double-quotes.
> It looks like it's all the same to tcl, but I think it'll make
> things more consistent and also allow editors to (syntax)-highlight
> those as strings...
> 

Will do.

regards, Kyle

> Thanks,
> -- 
> Joel


  reply	other threads:[~2014-03-27 15:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-27  1:51 Kyle McMartin
2014-03-27 13:07 ` Joel Brobecker
2014-03-27 15:45   ` Kyle McMartin [this message]
2014-03-27 14:07 ` Marcus Shawcroft
2014-03-27 15:40   ` Kyle McMartin
2014-03-27 16:13     ` Marcus Shawcroft
2014-03-27 16:37       ` Kyle McMartin

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=20140327154546.GJ3075@redacted.bos.redhat.com \
    --to=kmcmarti@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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