From patchwork Tue Oct 29 22:56:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 21271 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 88E7025E1B for ; Tue, 29 Oct 2013 22:56:19 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id rd3sf83470pab.3 for ; Tue, 29 Oct 2013 15:56:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=UOKUFOhP2mc39QtTskagS1VyFKvza000dz2fMXqzTps=; b=SqBVz6h8jl2/1Vn2SfUhRwpzKC05M56JoS9OI07j2ZmEwvgoIm8oPTJUweI/M4NzP7 jkl+oo7Ncwsw6UesIAe5wdxzyAJmARQTzHY77nc6E7EKToviQUkvPyYryXd0tqL1GV2M D3eESOdkgvxByguR3o7ZzM2p70oQkZkj2rGFybn1V6DspBV8pZs4yCb7nsmZzMPbKv53 e91Or4aPJWyDMt79nlbshe7QuZ2daEl6TXusBuobEByC5OboN8imQchmIg1IUYibne8F pCRWC97kblXC8AFna3EtLKsjAOKsOMHNXfeKlMLDMocgRwyOZ1N+I/lE2fMSzOZxDHPL ueCQ== X-Gm-Message-State: ALoCoQlMdbQFZIPlTDwZ2ycFwsve08IF8OWgJV/WzvCo0TEOgrT7pibVcHGr+R7PUZrrJp4ucPEZ X-Received: by 10.68.176.195 with SMTP id ck3mr874226pbc.7.1383087378517; Tue, 29 Oct 2013 15:56:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.59.82 with SMTP id x18ls233477qeq.88.gmail; Tue, 29 Oct 2013 15:56:18 -0700 (PDT) X-Received: by 10.52.119.198 with SMTP id kw6mr787432vdb.47.1383087378384; Tue, 29 Oct 2013 15:56:18 -0700 (PDT) Received: from mail-vb0-f52.google.com (mail-vb0-f52.google.com [209.85.212.52]) by mx.google.com with ESMTPS id st7si7272370vdc.29.2013.10.29.15.56.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Oct 2013 15:56:18 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.52 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.52; Received: by mail-vb0-f52.google.com with SMTP id f13so427329vbg.11 for ; Tue, 29 Oct 2013 15:56:18 -0700 (PDT) X-Received: by 10.52.108.161 with SMTP id hl1mr8497vdb.62.1383087378290; Tue, 29 Oct 2013 15:56:18 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp239350vcz; Tue, 29 Oct 2013 15:56:18 -0700 (PDT) X-Received: by 10.182.24.105 with SMTP id t9mr1609479obf.86.1383087377791; Tue, 29 Oct 2013 15:56:17 -0700 (PDT) Received: from mail-ob0-f170.google.com (mail-ob0-f170.google.com [209.85.214.170]) by mx.google.com with ESMTPS id ju5si9556433oeb.137.2013.10.29.15.56.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Oct 2013 15:56:17 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.214.170 is neither permitted nor denied by best guess record for domain of will.newton@linaro.org) client-ip=209.85.214.170; Received: by mail-ob0-f170.google.com with SMTP id wp18so666071obc.15 for ; Tue, 29 Oct 2013 15:56:17 -0700 (PDT) X-Received: by 10.182.81.41 with SMTP id w9mr1673925obx.18.1383087377386; Tue, 29 Oct 2013 15:56:17 -0700 (PDT) Received: from localhost.localdomain (sccc-66-78-236-243.smartcity.com. [66.78.236.243]) by mx.google.com with ESMTPSA id r3sm48097440oep.2.2013.10.29.15.56.14 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 29 Oct 2013 15:56:17 -0700 (PDT) Message-ID: <52703D0D.7060304@linaro.org> Date: Tue, 29 Oct 2013 15:56:13 -0700 From: Will Newton User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 MIME-Version: 1.0 To: gdb-patches@sourceware.org CC: Patch Tracking Subject: [PATCH] sim/arm: Prevent crash when running sim with no binary. X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.52 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 2013-10-30 Will Newton PR gdb/15508 * arm/wrapper.c (sim_create_inferior): Call init before accessing STATE. --- sim/arm/wrapper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c index cf10e78..b7bf400 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));