Message ID | 52703CDF.3070009@linaro.org |
---|---|
State | Accepted |
Headers | show |
>>>>> "Will" == Will Newton <will.newton@linaro.org> writes:
Will> 2013-10-30 Will Newton <will.newton@linaro.org>
Will> PR gdb/9195
Will> * arm/wrapper.c (sim_create_inferior): Avoid calling
Will> bfd_get_mach with a NULL bfd.
Ok.
Tom
diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c index a4b7683..cf10e78 100644 --- a/sim/arm/wrapper.c +++ b/sim/arm/wrapper.c @@ -244,11 +244,15 @@ sim_create_inferior (sd, abfd, argv, env) char **arg; if (abfd != NULL) - ARMul_SetPC (state, bfd_get_start_address (abfd)); + { + ARMul_SetPC (state, bfd_get_start_address (abfd)); + mach = bfd_get_mach (abfd); + } else - ARMul_SetPC (state, 0); /* ??? */ - - mach = bfd_get_mach (abfd); + { + ARMul_SetPC (state, 0); /* ??? */ + mach = 0; + } switch (mach) {