[30/40] sim/ppc: Use TRACE with initialized entry_point

Message ID 0093fc2d9dbff0f912ef48fd61a412b3a6378c3c.1666258361.git.research_trasio@irq.a4lg.com
State Committed
Headers
Series sim+gdb: Suppress warnings if built with Clang (big batch 1) |

Commit Message

Tsukasa OI Oct. 20, 2022, 9:32 a.m. UTC
  On a TRACE call on sim_create_inferior, a variable entry_point is not
initialized. This commit moves the TRACE call to where the entry_point
is initialized.
---
 sim/ppc/sim_calls.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Mike Frysinger Oct. 23, 2022, 3:08 p.m. UTC | #1
lgtm, but i think Andrew posted the same fix
-mike
  
Tsukasa OI Oct. 24, 2022, 11:02 a.m. UTC | #2
On 2022/10/24 0:08, Mike Frysinger wrote:
> lgtm, but i think Andrew posted the same fix
> -mike

I'll leave it for Andrew (PATCH 02/10) and I will withdraw following
patches from my patchset:

-   PATCH 03/40
-   PATCH 15/40
-   PATCH 16/40 (wrote by Andrew)
-   PATCH 28/40
-   PATCH 30/40
-   PATCH 36/40

Because this patchset (intended to be a RFC PATCH) is a mere copy of my
working branch, I need to sync with Andrew's work.

Thanks,
Tsukasa
  

Patch

diff --git a/sim/ppc/sim_calls.c b/sim/ppc/sim_calls.c
index 729f6dcb6f3..eddce4ac00a 100644
--- a/sim/ppc/sim_calls.c
+++ b/sim/ppc/sim_calls.c
@@ -161,8 +161,6 @@  sim_create_inferior (SIM_DESC sd,
 		     char * const *envp)
 {
   unsigned_word entry_point;
-  TRACE(trace_gdb, ("sim_create_inferior(start_address=0x%x, ...)\n",
-		    entry_point));
 
   if (simulator == NULL)
     error ("No program loaded");
@@ -171,6 +169,8 @@  sim_create_inferior (SIM_DESC sd,
     entry_point = bfd_get_start_address (abfd);
   else
     entry_point = 0xfff00000; /* ??? */
+  TRACE(trace_gdb, ("sim_create_inferior(start_address=0x%x, ...)\n",
+		    entry_point));
 
   psim_init(simulator);
   psim_stack(simulator, argv, envp);