From 1ed6c797ef8814d7f273a0ccc5cf7ebbce497933 Mon Sep 17 00:00:00 2001 From: Will Newton Date: Tue, 29 Oct 2013 09:43:07 -0700 Subject: [PATCH] sim/arm: Prevent crash when running sim with no binary. 2013-11-07 Will Newton PR gdb/15508 * arm/wrapper.c (sim_create_inferior): Call init before accessing STATE. --- sim/ChangeLog | 6 ++++++ sim/arm/wrapper.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/sim/ChangeLog b/sim/ChangeLog index bad626f99c9..b7ebb053b71 100644 --- a/sim/ChangeLog +++ b/sim/ChangeLog @@ -1,3 +1,9 @@ +2013-11-07 Will Newton + + PR gdb/15508 + * arm/wrapper.c (sim_create_inferior): Call init before + accessing STATE. + 2013-11-07 Will Newton PR gdb/9195 diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c index cf10e782a1f..b7bf400c606 100644 --- a/sim/arm/wrapper.c +++ b/sim/arm/wrapper.c @@ -243,6 +243,8 @@ sim_create_inferior (sd, abfd, argv, env) int mach; char **arg; + init (); + if (abfd != NULL) { ARMul_SetPC (state, bfd_get_start_address (abfd)); -- 2.30.2