public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] frame.c: Fix the check for FID_STACK_INVALID in frame_id_eq().
@ 2014-11-25 19:34 Martin Galvan
  2014-11-25 20:33 ` Sergio Durigan Junior
  2014-11-30 15:41 ` Joel Brobecker
  0 siblings, 2 replies; 4+ messages in thread
From: Martin Galvan @ 2014-11-25 19:34 UTC (permalink / raw)
  To: gdb-patches; +Cc: daniel.gutson

I noticed in frame_id_eq() we were checking for the "l" frame_id being invalid twice instead of checking both "l" and "r", so I corrected it.

gdb/ChangeLog:

2014-11-25  Martin Galvan  <martin.galvan@tallertechnologies.com>

    * frame.c (frame_id_eq): Fix the check for FID_STACK_INVALID.

---

diff --git a/gdb/frame.c b/gdb/frame.c
index 0663af9..135b820 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -614,7 +614,7 @@ frame_id_eq (struct frame_id l, struct frame_id r)
        outer_frame_id.  */
     eq = 1;
   else if (l.stack_status == FID_STACK_INVALID
-          || l.stack_status == FID_STACK_INVALID)
+          || r.stack_status == FID_STACK_INVALID)
     /* Like a NaN, if either ID is invalid, the result is false.
        Note that a frame ID is invalid iff it is the null frame ID.  */
     eq = 0;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] frame.c: Fix the check for FID_STACK_INVALID in frame_id_eq().
  2014-11-25 19:34 [PATCH] frame.c: Fix the check for FID_STACK_INVALID in frame_id_eq() Martin Galvan
@ 2014-11-25 20:33 ` Sergio Durigan Junior
  2014-11-26  1:19   ` Martin Galvan
  2014-11-30 15:41 ` Joel Brobecker
  1 sibling, 1 reply; 4+ messages in thread
From: Sergio Durigan Junior @ 2014-11-25 20:33 UTC (permalink / raw)
  To: Martin Galvan; +Cc: gdb-patches, daniel.gutson

On Tuesday, November 25 2014, Martin Galvan wrote:

> I noticed in frame_id_eq() we were checking for the "l" frame_id being invalid twice instead of checking both "l" and "r", so I corrected it.

Hi Martin,

Thanks for the patch.  I guess it is obvious enough that it could be
checked in without approval, but just to be safe, let's wait until a
maintainer approves it.  Meanwhile...

> gdb/ChangeLog:
>
> 2014-11-25  Martin Galvan  <martin.galvan@tallertechnologies.com>
>
>     * frame.c (frame_id_eq): Fix the check for FID_STACK_INVALID.

The indentation of this ChangeLog entry is wrong.  You must use TAB
instead of whitespaces to indent the "*" part.

> ---
>
> diff --git a/gdb/frame.c b/gdb/frame.c
> index 0663af9..135b820 100644
> --- a/gdb/frame.c
> +++ b/gdb/frame.c
> @@ -614,7 +614,7 @@ frame_id_eq (struct frame_id l, struct frame_id r)
>         outer_frame_id.  */
>      eq = 1;
>    else if (l.stack_status == FID_STACK_INVALID
> -          || l.stack_status == FID_STACK_INVALID)
> +          || r.stack_status == FID_STACK_INVALID)

Here, the use of whitespaces is wrong too.  And it seems your e-mail
client has mangled the TAB of the old code as well.

>      /* Like a NaN, if either ID is invalid, the result is false.
>         Note that a frame ID is invalid iff it is the null frame ID.  */
>      eq = 0;

-- 
Sergio
GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] frame.c: Fix the check for FID_STACK_INVALID in frame_id_eq().
  2014-11-25 20:33 ` Sergio Durigan Junior
@ 2014-11-26  1:19   ` Martin Galvan
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Galvan @ 2014-11-26  1:19 UTC (permalink / raw)
  To: Sergio Durigan Junior; +Cc: gdb-patches, Daniel Gutson

On Tue, Nov 25, 2014 at 5:32 PM, Sergio Durigan Junior
<sergiodj@redhat.com> wrote:
>
> On Tuesday, November 25 2014, Martin Galvan wrote:
>
> > I noticed in frame_id_eq() we were checking for the "l" frame_id being invalid twice instead of checking both "l" and "r", so I corrected it.
>
> Hi Martin,
>
> Thanks for the patch.  I guess it is obvious enough that it could be
> checked in without approval, but just to be safe, let's wait until a
> maintainer approves it.  Meanwhile...
>
> > gdb/ChangeLog:
> >
> > 2014-11-25  Martin Galvan  <martin.galvan@tallertechnologies.com>
> >
> >     * frame.c (frame_id_eq): Fix the check for FID_STACK_INVALID.
>
> The indentation of this ChangeLog entry is wrong.  You must use TAB
> instead of whitespaces to indent the "*" part.

My mistake. Will remember that for any new patches I send :)

-- 

Martín Galván

Software Engineer

Taller Technologies Argentina

San Lorenzo 47, 3rd Floor, Office 5

Córdoba, Argentina

Phone: 54 351 4217888 / +54 351 4218211

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] frame.c: Fix the check for FID_STACK_INVALID in frame_id_eq().
  2014-11-25 19:34 [PATCH] frame.c: Fix the check for FID_STACK_INVALID in frame_id_eq() Martin Galvan
  2014-11-25 20:33 ` Sergio Durigan Junior
@ 2014-11-30 15:41 ` Joel Brobecker
  1 sibling, 0 replies; 4+ messages in thread
From: Joel Brobecker @ 2014-11-30 15:41 UTC (permalink / raw)
  To: Martin Galvan; +Cc: gdb-patches, daniel.gutson

[-- Attachment #1: Type: text/plain, Size: 1001 bytes --]

On Tue, Nov 25, 2014 at 04:34:48PM -0300, Martin Galvan wrote:
> I noticed in frame_id_eq() we were checking for the "l" frame_id being invalid twice instead of checking both "l" and "r", so I corrected it.
> 
> gdb/ChangeLog:
> 
> 2014-11-25  Martin Galvan  <martin.galvan@tallertechnologies.com>
> 
>     * frame.c (frame_id_eq): Fix the check for FID_STACK_INVALID.

Thank you for the patch. It does indeed look pretty obvious.

You're patch did not apply for some reason, but since it was so
simple, I just redid it, bearing in mind Sergio's comments.
I then re-ran the testsuite on x86_64-linux to make sure it doesn't
cause any regression.

Attached is what I ended pushing (as both obvious and under 'tiny
patch' rule, meaning that you don't need a copyright assignment
for this change). If you are interested in contributing more patches
to GDB, you'll need a copyright assignement in place with the FSF.
Let us know and we will get you started; the process can be somewhat
lengthy.

-- 
Joel

[-- Attachment #2: 0001-frame.c-Fix-the-check-for-FID_STACK_INVALID-in-frame.patch --]
[-- Type: text/x-diff, Size: 1567 bytes --]

From 0bba2ddfa79b718e4bab94f2827165bd5b55c92c Mon Sep 17 00:00:00 2001
From: Martin Galvan <martin.galvan@tallertechnologies.com>
Date: Sun, 30 Nov 2014 19:34:15 +0400
Subject: [PATCH] frame.c: Fix the check for FID_STACK_INVALID in frame_id_eq()

I noticed in frame_id_eq() we were checking for the "l" frame_id being
invalid twice instead of checking both "l" and "r", so this patch
corrects it.

gdb/ChangeLog:

	* frame.c (frame_id_eq): Fix the check for FID_STACK_INVALID.
---
 gdb/ChangeLog | 5 +++++
 gdb/frame.c   | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4112438..f706f29 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-30  Martin Galvan  <martin.galvan@tallertechnologies.com>  (tiny patch, obvious)
+
+	Pushed by Joel Brobecker  <brobecker@adacore.com>.
+	* frame.c (frame_id_eq): Fix the check for FID_STACK_INVALID.
+
 2014-11-29  Siva Chandra Reddy  <sivachandra@google.com>
 
 	* eval.c (evaluate_subexp): Check that the thread stack	temporaries
diff --git a/gdb/frame.c b/gdb/frame.c
index 0663af9..75ad341 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -614,7 +614,7 @@ frame_id_eq (struct frame_id l, struct frame_id r)
        outer_frame_id.  */
     eq = 1;
   else if (l.stack_status == FID_STACK_INVALID
-	   || l.stack_status == FID_STACK_INVALID)
+	   || r.stack_status == FID_STACK_INVALID)
     /* Like a NaN, if either ID is invalid, the result is false.
        Note that a frame ID is invalid iff it is the null frame ID.  */
     eq = 0;
-- 
1.9.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-30 15:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-25 19:34 [PATCH] frame.c: Fix the check for FID_STACK_INVALID in frame_id_eq() Martin Galvan
2014-11-25 20:33 ` Sergio Durigan Junior
2014-11-26  1:19   ` Martin Galvan
2014-11-30 15:41 ` Joel Brobecker

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).