public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] sim/ppc: don't try to print an uninitialized variable
Date: Mon, 24 Oct 2022 16:05:07 +0000 (GMT)	[thread overview]
Message-ID: <20221024160507.2308B3858022@sourceware.org> (raw)

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

commit 368b8c325922ca329ae0edb1a9ce6bc16c9f927f
Author: Andrew Burgess <aburgess@redhat.com>
Date:   Wed Oct 19 15:06:10 2022 +0100

    sim/ppc: don't try to print an uninitialized variable
    
    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.

Diff:
---
 sim/ppc/sim_calls.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sim/ppc/sim_calls.c b/sim/ppc/sim_calls.c
index 729f6dcb6f3..3dcce19f628 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");
@@ -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);

                 reply	other threads:[~2022-10-24 16:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221024160507.2308B3858022@sourceware.org \
    --to=aburgess@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).