From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iKVFKPQB1GNO6iIAWB0awg (envelope-from ) for ; Fri, 27 Jan 2023 11:55:16 -0500 Received: by simark.ca (Postfix, from userid 112) id A0B2B1E128; Fri, 27 Jan 2023 11:55:16 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=YbGVZBCb; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 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 E613E1E124 for ; Fri, 27 Jan 2023 11:55:15 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6EAA0385AC29 for ; Fri, 27 Jan 2023 16:55:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6EAA0385AC29 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674838515; bh=mh/Y3eCpkER3GCmSpq1LHbR1ep5CrppHTgyUPsq9wBQ=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=YbGVZBCbvI135ftoD8QpRCSLM9dHqkG2W4PvaNjUz3LC/bSX/PzRjBpwOsirEub7L ODyVWuOy/JxInTmAWFDAE0yYZvtcXM3LK80izrJRkoapdB1x25eRJ1bwXwumRmZUH1 +hllseTSxb4k6Mxu/nXKSiMfsm3IVVBetNPL4Yfo= Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id E51E93858C2F for ; Fri, 27 Jan 2023 16:54:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E51E93858C2F Received: by mail-wr1-x42c.google.com with SMTP id t18so5547255wro.1 for ; Fri, 27 Jan 2023 08:54:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mh/Y3eCpkER3GCmSpq1LHbR1ep5CrppHTgyUPsq9wBQ=; b=RwLU1+9mcLdGpi/6OPT4tB0tZvUvwIPF3V8dHUVHs3ekoUqk34Bp+wAF1ZbsUxGtvT 5cpY/j6dKsh4MefNDmSRF3vfTJLe2lNlwI0Fd/SjlnwrI/42nb2kVOw0wnYzsiX8OI1h 9M+a2VVyoY712OXvzopWkqv0e8jCd+GoR/e3TvGu2ov51/NjIoBPziCdbGncPYkPO5ld MUs11fMMHWapdFQv5U5u23uv2FRq0BYzSuMvnsxCjkaGj+6bgmMnSLn9sLLjQkDOySbx n3rTEowKaltlmPrvGgCXY3udiS+ylDdAWIuxS8rjWt4zdCVs0tCe7laTxwCHfRe/t2dD IieA== X-Gm-Message-State: AO0yUKUAM5MvPzTgkFJqOFsEVxnUkz+Qd97OwJkpO+eJVJpTzQakMR/S 8coIrQcglpY5Jxc6hEj0tmTmr6eM/strk5w2 X-Google-Smtp-Source: AK7set9la1ZvS+KF4lw6DchOSjfjdjdojdHMDRPUdmhAU6BGwLD45AePHQVkmO9C6UzfQkF6tlCWqQ== X-Received: by 2002:adf:f14a:0:b0:2bf:cd9f:37f9 with SMTP id y10-20020adff14a000000b002bfcd9f37f9mr3804104wro.4.1674838483499; Fri, 27 Jan 2023 08:54:43 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:253:fe0:b0cf:cb2e:f4d5:6223]) by smtp.gmail.com with ESMTPSA id g9-20020a05600c308900b003db0dbbea53sm4590502wmn.30.2023.01.27.08.54.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 08:54:42 -0800 (PST) To: gdb-patches@sourceware.org Cc: simark@simark.ca, =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= Subject: [PATCH v2 0/3] Fix Ada tasking for baremetal targets using Ravenscar threads Date: Fri, 27 Jan 2023 17:53:34 +0100 Message-Id: <20230127165337.1832937-1-legouguec@adacore.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <87tu0ugxt7.fsf@adacore.com> References: <87tu0ugxt7.fsf@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: =?utf-8?q?K=C3=A9vin_Le_Gouguec_via_Gdb-patches?= Reply-To: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Changes since v1: * New patch to add a header for functions defined in ada-tasks.c. * New patch to expose a getter for ada_tasks_pspace_data. * Tweak original patch to use that getter from ravenscar-thread.c. This ensures we do not introduce a function that refers to global state; instead, we let ada_get_runtime_cpu_index's caller get its hands "dirty". I considered exposing ada_tasks_pspace_data entirely and making ada_get_runtime_cpu_index a method as discussed, but AFAIU this would have required either (a) keeping all members of that struct public so that existing functions can keep accessing them, (b) ponder which members ought to remain public, which should not, and which portions of ada-tasks.c should be turned into methods for ada_tasks_pspace_data. (a) does not sound like progress in terms of encapsulation; I am not confident I can get (b) done soon. Hence the opaque pointer as a first step toward (b). Will stay on the lookout for opportunities to refactor uses of that struct into "method-like" functions, make members private when it makes sense, and finally, expose the struct definition, turning the "method-like" functions into methods. Tried to follow the coding conventions re. #include strategies; apologies if I've missed something there, or anywhere else. Kévin Le Gouguec (3): gdb: Introduce ada-tasks.h for functions defined in ada-tasks.c gdb/ada-tasks: Make the ada_tasks_pspace_data getter public gdb: Fix Ada tasking for baremetal targets using Ravenscar threads gdb/ada-lang.h | 25 +++-------- gdb/ada-tasks.c | 44 +++++++++--------- gdb/ada-tasks.h | 91 ++++++++++++++++++++++++++++++++++++++ gdb/breakpoint.c | 1 + gdb/guile/scm-breakpoint.c | 2 +- gdb/mi/mi-main.c | 2 +- gdb/python/py-breakpoint.c | 2 +- gdb/ravenscar-thread.c | 17 +++++-- 8 files changed, 134 insertions(+), 50 deletions(-) create mode 100644 gdb/ada-tasks.h -- 2.25.1