From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53503 invoked by alias); 20 Jan 2020 00:48:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 53495 invoked by uid 89); 20 Jan 2020 00:48:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 20 Jan 2020 00:48:57 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 00K0mnwT021302 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 19 Jan 2020 19:48:53 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 00K0mnwT021302 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1579481334; bh=kfXEwTB6pEB5jZxHEhNtoNsDKB7DEwoumR0c7HCWzro=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=ClrZjsziZu8ftJGGlcHmftIBGlq/SzEbl1ZxbT/sUP7b6dVMln6FrxBDPvjZOaL1U p7ClZbdIvtrepXrPyeIBdnSTLDydlp4kwYAehCg/DEBKzP6jMhLgLbaSIT1HEWF8zk 9zFe+q+5qzqq599Pw7ytVLwJs7LaLvfsDz9SSfrQ= Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id E10981E5F3; Sun, 19 Jan 2020 19:48:48 -0500 (EST) Subject: Re: [PATCH] sim: don't rely on inferior_ptid in gdbsim_target::wait To: Andrew Burgess Cc: gdb-patches@sourceware.org References: <20200119035557.5975-1-simon.marchi@polymtl.ca> <20200119211217.GE3865@embecosm.com> From: Simon Marchi Message-ID: Date: Mon, 20 Jan 2020 00:49:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20200119211217.GE3865@embecosm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00600.txt.bz2 On 2020-01-19 4:12 p.m., Andrew Burgess wrote: > * Simon Marchi [2020-01-18 22:55:57 -0500]: > >> When running a program with the simulator target, I get: >> >> /home/simark/src/binutils-gdb/gdb/inferior.c:279: internal-error: inferior* find_inferior_pid(process_stratum_target*, int): Assertion `pid != 0' failed. >> >> This can be reproduced by building a GDB for --target=arm-none-gnueabi, >> and running with >> >> $ ./gdb -nx --data-directory=data-directory a.out -ex "target sim" -ex load -ex "b main" -ex r >> >> Where a.out is any program with a main. >> >> The problem is that gdbsim_target::wait assumes that inferior_ptid has >> the value of the thread it wants to report an event for. >> >> Actually, it's the target's responsibility to come up with the ptid of >> the thread the event is for. In the sim target, that ptid is stored in >> sim_inferior_data::remote_sim_ptid, so return that instead of >> inferior_ptid. >> >> ChangeLog: >> >> * remote-sim.c (gdbsim_target::wait): Return >> sim_data->remote_sim_ptid instead of inferior_ptid. > > This makes sense. LGTM. > > Thanks, > Andrew Thanks, I pushed it. Simon