From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id eO7UFM0N0GDLLwAAWB0awg (envelope-from ) for ; Sun, 20 Jun 2021 23:55:57 -0400 Received: by simark.ca (Postfix, from userid 112) id 51FF51F1F2; Sun, 20 Jun 2021 23:55:57 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C4C511E01F for ; Sun, 20 Jun 2021 23:55:56 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 87935384783C for ; Mon, 21 Jun 2021 03:55:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 87935384783C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1624247756; bh=OU0K7o5T8abiWtb4tvluqAOs0X6irYc4H9XNmkvoSRY=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=GeemVKz+8cNhlC0yn4swDmTxwGWD8AmMpyq1ahlFNUg7JCTdGpXjWhaQ7JQWuzp6y wzOIBaeI258YD+GQKKFqQ1piKa2w2ag9/HoMZTA1m3Y7OiiGr7gHbXX/1A+FLG5WJD xuPyycZkbO2vXXWk4KIjXdZC69NLAR0dbNszzG9w= Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id EA8993848007 for ; Mon, 21 Jun 2021 03:55:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EA8993848007 Received: from vapier.lan (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 419CF33BE23 for ; Mon, 21 Jun 2021 03:55:09 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 3/3] sim: callback: add missing cb_target_to_host_signal Date: Sun, 20 Jun 2021 23:55:05 -0400 Message-Id: <20210621035505.29431-3-vapier@gentoo.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210621035505.29431-1-vapier@gentoo.org> References: <20210621035505.29431-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" There's been a prototype for this forever, but the implementation was missing. Probably because there weren't any callers, but we'll start using it to implement the kill function. --- sim/common/callback.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sim/common/callback.c b/sim/common/callback.c index aca0112853c4..06d76b477245 100644 --- a/sim/common/callback.c +++ b/sim/common/callback.c @@ -927,6 +927,19 @@ cb_target_to_host_open (host_callback *cb, int target_val) return host_val; } +/* Translate the target's version of a signal number to the host's. + This isn't actually the host's version, rather a canonical form. + ??? Perhaps this should be renamed to ..._canon_signal. */ + +int +cb_target_to_host_signal (host_callback *cb, int target_val) +{ + const CB_TARGET_DEFS_MAP *m = + cb_target_map_entry (cb->signal_map, target_val); + + return m ? m->host_val : -1; +} + /* Utility for e.g. cb_host_to_target_stat to store values in the target's stat struct. -- 2.31.1