sim/ppc: don't try to print an uninitialized variable
authorAndrew Burgess <aburgess@redhat.com>
Wed, 19 Oct 2022 14:06:10 +0000 (15:06 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Mon, 24 Oct 2022 16:01:04 +0000 (17:01 +0100)
The ppc simulator, in sim_create_inferior, tries to print the function
local entry_point variable before the variable is initialized.

In this commit, I defer the debug print line until the variable has
been initialized.

sim/ppc/sim_calls.c

index 729f6dcb6f36968ab6eee66b68acf281a22fd911..3dcce19f6283d05065a48f46fab207b0bf6046e0 100644 (file)
@@ -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");
@@ -172,6 +170,9 @@ sim_create_inferior (SIM_DESC sd,
   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);