public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Carl Love <cel@us.ibm.com>
To: Bruno Larsen <blarsen@redhat.com>,
	Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: "will_schmidt@vnet.ibm.com" <will_schmidt@vnet.ibm.com>
Subject: RE: [PATCH] PowerPC, fix gdb.reverse/finish-reverse-bkpt.exp and gdb.reverse/next-reverse-bkpt-over-sr.exp
Date: Tue, 29 Nov 2022 08:50:29 -0800	[thread overview]
Message-ID: <f9e93ae4ddbb5e813167aa0d729b19792a51fe27.camel@us.ibm.com> (raw)
In-Reply-To: <682e79ba-0e4b-3209-4fa2-e94ef8e6c978@redhat.com>

Bruno:

On Tue, 2022-11-29 at 09:52 +0100, Bruno Larsen wrote:

<snip> 
> 
> > 
> > This patch fixes two PowerPC test failures in each of the tests
> > gdb.reverse/finish-reverse-bkpt.exp and
> > gdb.reverse/next-reverse-bkpt-over-sr.exp.
> > 
> > Patch tested on PowerPC and Intel X86-64 with no regressions.
> 
> Hi Carl,
> 
> I also tested locally and verify that it adds no new regressions,
> and 
> your explanations make sense. I have some style nits inlined, but
> with 
> those fixed you can add my R-b tag:
> 
> Reviewed-By: Bruno Larsen <blarsen@redhat.com>
> 
> > ---
> > 
<snip>

> > +   platforms.  See comments in finish-reverse-bkpt.exp.  */
> > +
> > +int void_test = 0;
> > +
> > +void void_func ()
> 
> GDB's coding style would say this should be:
> 
> void
> void_func ()
> {
Fixed
> 
> I know that a lot of .c files in the test suite aren't completely 
> following the coding standards, but we should avoid introducing new
> ones 
> if not necessary.

Yup, I know better.  Because I am used to doing it in line, it doesn't
jump out at me a wrong.  I have to actually stop and think about it to
see it.  Sigh hard to teach an "old dog" new tricks.  :-).  I fixed up
the four occurrences of the mistake.


> > +{
> > +  void_test = 1;		/* VOID FUNC */
> > +}
> > +
> > +int main (int argc, char **argv)
> same here.

Fixed. 
> > +{
> > +  int i;
> > +  void (*funp) (void) = void_func;
> > +
> > 
<snip>
> > set breakpoint on funp"
> > +gdb_continue_to_breakpoint "funp call" ".*$srcfile:$breakloc.*"
> > +
> > +# Start the test
> missing period at the end of the comment.

Yup, fixed.

> >   set breakloc [gdb_get_line_number "VOID FUNC" "$srcfile"]
> >   gdb_test "tbreak void_func" \
> > 
<snip>

> > t myglob = 0;
> > +
> > +int callee() {		/* ENTER CALLEE */
> Same comment about C coding style.

Fixed.

> > +  return myglob++;	/* ARRIVED IN CALLEE */
> > +}			/* RETURN FROM CALLEE */
> > +
> > +int main () {

Fixed

> > +   int (*funp) (void) = callee;
> > +
> > +   /* Test next-reverse-bkpt-over-sr.exp needs to call function
> > callee using
> > +      a function pointer to work correctly on PowerPC.  See
> > comments in
> > +      next-reverse-bkpt-over-sr.exp.  */
> > +   funp ();       /* FUNCTION PTR CALL TO CALLEE */
> > +
> > +   /* Test that "step" doesn't */
> > +   callee ();	/* STEP INTO CALL AFTER FUNP CALL */
> 
> I don't see the need for a callee call here. The test doesn't use
> the 
> second call at any point.

True, it is only used as a reference point to break on.  The exit (0)
statement could be used instead.  My first thought was to let leave it
as it was.  But after thinking about it for awhile, I decided it was
best to remove it since the comment "STEP INTO CALL AFTER FUNP CALL" is
technically misleading as the test doesn't actually step into callee().
So, in the end I decided to remove the callee (); line and fix the
expect file to break on the following exit (0) call.

Retested both test cases on Power to make sure I didn't have any typos.

> As I said before, these are all minor style comments, so I don't
> think a 
> new version is needed for these comments :)

Given the above functional change, I need to post the updated version. 
I did go ahead and add the reviewed by tag.

                        Carl 


  reply	other threads:[~2022-11-29 16:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27 16:14 [PATCH] Fix test next-reverse-bkpt-over-sr.exp Carl Love
2022-09-28  7:35 ` Bruno Larsen
2022-11-14 21:05   ` [PATCH] PowerPC, fix gdb.reverse/finish-reverse-bkpt.exp and gdb.reverse/next-reverse-bkpt-over-sr.exp Carl Love
2022-11-21 16:36     ` [PING] " Carl Love
2022-11-22  9:42     ` Bruno Larsen
2022-11-22 16:53       ` Carl Love
2022-11-23  8:44         ` Bruno Larsen
2022-11-23 17:56         ` Ulrich Weigand
2022-11-23 23:33           ` Carl Love
2022-11-28 18:52           ` Carl Love
2022-11-29  8:52             ` Bruno Larsen
2022-11-29 16:50               ` Carl Love [this message]
2022-11-29 16:57               ` [PATCH V4] " Carl Love
2022-11-30 11:30                 ` Ulrich Weigand
2022-12-01  1:33                   ` Carl Love
2022-12-01 15:50                     ` [PATCH V5] " Carl Love
2022-12-01 16:02                       ` Ulrich Weigand

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=f9e93ae4ddbb5e813167aa0d729b19792a51fe27.camel@us.ibm.com \
    --to=cel@us.ibm.com \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=will_schmidt@vnet.ibm.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).