[binutils-gdb] sim: frv: fix uninitialized variable warning

Michael Frysinger vapier@sourceware.org
Mon Jun 28 03:32:03 GMT 2021


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=247867ebd359f46d0b67822f175f4721a52402ba

commit 247867ebd359f46d0b67822f175f4721a52402ba
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sun Jun 27 00:01:39 2021 -0400

    sim: frv: fix uninitialized variable warning
    
    This variable isn't set anywhere, so pass down NULL_CIA to indicate
    we don't have a pc to pass.

Diff:
---
 sim/frv/ChangeLog | 4 ++++
 sim/frv/traps.c   | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/sim/frv/ChangeLog b/sim/frv/ChangeLog
index 51c9e172713..0877169b7f0 100644
--- a/sim/frv/ChangeLog
+++ b/sim/frv/ChangeLog
@@ -1,3 +1,7 @@
+2021-06-27  Mike Frysinger  <vapier@gentoo.org>
+
+	* traps.c (frv_break): Delete pc and pass down NULL_CIA.
+
 2021-06-27  Mike Frysinger  <vapier@gentoo.org>
 
 	* profile.c (frvbf_model_insn_after): Change return to void.
diff --git a/sim/frv/traps.c b/sim/frv/traps.c
index 46cb8d92f29..59f1a25f5f1 100644
--- a/sim/frv/traps.c
+++ b/sim/frv/traps.c
@@ -286,14 +286,14 @@ frv_mtrap (SIM_CPU *current_cpu)
 void
 frv_break (SIM_CPU *current_cpu)
 {
-  IADDR pc;
   SIM_DESC sd = CPU_STATE (current_cpu);
 
   if (STATE_ENVIRONMENT (sd) != OPERATING_ENVIRONMENT)
     {
       /* Invalidate the insn cache because the debugger will presumably
 	 replace the breakpoint insn with the real one.  */
-      sim_engine_halt (sd, current_cpu, NULL, pc, sim_stopped, SIM_SIGTRAP);
+      sim_engine_halt (sd, current_cpu, NULL, NULL_CIA, sim_stopped,
+		       SIM_SIGTRAP);
     }
 
   frv_queue_break_interrupt (current_cpu);


More information about the Gdb-cvs mailing list