GDB: S12Z: Add assertion

Message ID 20181119164734.31022-1-john@darrington.wattle.id.au
State New, archived
Headers

Commit Message

John Darrington Nov. 19, 2018, 4:47 p.m. UTC
  gdb/ChangeLog:

	* s12z-tdep.c (s12z_frame_cache): Add an assertion.
---
 gdb/ChangeLog   | 8 ++++++++
 gdb/s12z-tdep.c | 1 +
 2 files changed, 9 insertions(+)
  

Comments

Kevin Buettner Nov. 20, 2018, 5:16 a.m. UTC | #1
Hi John,

This is okay.  Go ahead and push it.

You leave the diff for ChangeLog out of your patches.  Just make
sure that the ChangeLog entries are placed at the top of the ChangeLog
file with  suitable header (date, name, and email) at the time that the
change is pushed.

Kevin

On Mon, 19 Nov 2018 17:47:34 +0100
John Darrington <john@darrington.wattle.id.au> wrote:

> gdb/ChangeLog:
> 
> 	* s12z-tdep.c (s12z_frame_cache): Add an assertion.
> ---
>  gdb/ChangeLog   | 8 ++++++++
>  gdb/s12z-tdep.c | 1 +
>  2 files changed, 9 insertions(+)
> 
> diff --git a/gdb/ChangeLog b/gdb/ChangeLog
> index 4fa0b42657..990cfc3f9d 100644
> --- a/gdb/ChangeLog
> +++ b/gdb/ChangeLog
> @@ -1,3 +1,7 @@
> +2018-11-19  John Darrington <john@darrington.wattle.id.au>
> +
> +	*s12z-tdep.c (s12z_frame_cache): Add an assertion.
> +
>  2018-11-18  Tom Tromey  <tom@tromey.com>
>  
>  	PR build/23814:
> @@ -216,6 +220,10 @@
>  	frame cache, leave the frame id as the default, which is the outer
>  	frame id.
>  
> +2018-11-14  John Darrington <john@darrington.wattle.id.au>
> +
> +	* s12z-tdep.c (s12z_frame_cache): Add an assertion.
> +
>  2018-11-07  Joel Brobecker  <brobecker@adacore.com>
>  
>  	* ada-lang.c (read_atcb): Only set task_info->called_task if
> diff --git a/gdb/s12z-tdep.c b/gdb/s12z-tdep.c
> index 79f5772035..bd0bd7c001 100644
> --- a/gdb/s12z-tdep.c
> +++ b/gdb/s12z-tdep.c
> @@ -320,6 +320,7 @@ s12z_frame_cache (struct frame_info *this_frame, void **prologue_cache)
>      }
>    else
>      {
> +      gdb_assert (this_sp == this_sp_for_id);
>        /* The stack pointer of the prev frame is frame_size greater
>           than the stack pointer of this frame plus one address
>           size (caused by the JSR or BSR).  */
> -- 
> 2.11.0
>
  

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4fa0b42657..990cfc3f9d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@ 
+2018-11-19  John Darrington <john@darrington.wattle.id.au>
+
+	*s12z-tdep.c (s12z_frame_cache): Add an assertion.
+
 2018-11-18  Tom Tromey  <tom@tromey.com>
 
 	PR build/23814:
@@ -216,6 +220,10 @@ 
 	frame cache, leave the frame id as the default, which is the outer
 	frame id.
 
+2018-11-14  John Darrington <john@darrington.wattle.id.au>
+
+	* s12z-tdep.c (s12z_frame_cache): Add an assertion.
+
 2018-11-07  Joel Brobecker  <brobecker@adacore.com>
 
 	* ada-lang.c (read_atcb): Only set task_info->called_task if
diff --git a/gdb/s12z-tdep.c b/gdb/s12z-tdep.c
index 79f5772035..bd0bd7c001 100644
--- a/gdb/s12z-tdep.c
+++ b/gdb/s12z-tdep.c
@@ -320,6 +320,7 @@  s12z_frame_cache (struct frame_info *this_frame, void **prologue_cache)
     }
   else
     {
+      gdb_assert (this_sp == this_sp_for_id);
       /* The stack pointer of the prev frame is frame_size greater
          than the stack pointer of this frame plus one address
          size (caused by the JSR or BSR).  */