From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 2308B3858022; Mon, 24 Oct 2022 16:05:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2308B3858022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666627507; bh=9MayxOTqnrYpxNllrytyYnKNNNyFkvdXCHCMhrItVZ8=; h=From:To:Subject:Date:From; b=LMY9BDapoTr47UCkaAdpcmZ5NT5oVG4QPKV+RlDfp31xoGpKDv0J2sciwydC8LgVj 4cdknyckJy+CSJewqyP6kKUbnbxPtQVsjSVafdwmvUdvn6+QsLyiAFrWoToUuGPzoy euvONVB+FBfxt4qmMatX7W1ngbVa1U1efqZG/udU= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] sim/ppc: don't try to print an uninitialized variable X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: ffa2d048221147bad30dde3cfbcb535a824b203d X-Git-Newrev: 368b8c325922ca329ae0edb1a9ce6bc16c9f927f Message-Id: <20221024160507.2308B3858022@sourceware.org> Date: Mon, 24 Oct 2022 16:05:07 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D368b8c325922= ca329ae0edb1a9ce6bc16c9f927f commit 368b8c325922ca329ae0edb1a9ce6bc16c9f927f Author: Andrew Burgess Date: Wed Oct 19 15:06:10 2022 +0100 sim/ppc: don't try to print an uninitialized variable =20 The ppc simulator, in sim_create_inferior, tries to print the function local entry_point variable before the variable is initialized. =20 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=3D0x%x, ...)\n", - entry_point)); =20 if (simulator =3D=3D NULL) error ("No program loaded"); @@ -172,6 +170,9 @@ sim_create_inferior (SIM_DESC sd, else entry_point =3D 0xfff00000; /* ??? */ =20 + TRACE(trace_gdb, ("sim_create_inferior(start_address=3D0x%x, ...)\n", + entry_point)); + psim_init(simulator); psim_stack(simulator, argv, envp);