Message ID | 20230127165337.1832937-1-legouguec@adacore.com |
---|---|
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 35C50385B529 for <patchwork@sourceware.org>; Fri, 27 Jan 2023 16:55:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 35C50385B529 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674838519; 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=GL1rl8O7FyWZF+WmEVfYiWhuVAGArbukktXChLnq4OcUIp8Hao2dZelfJadqAuahZ bcQeFa9772cDTOvrtsBpH9p5Brlj8aHauaNhW4DAfV9PfcObW1pHLfwHcUQHMFwesD jdzsIRe//o4bwb8RB3MLk07+0IX47xJsueY8kAkM= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 <gdb-patches@sourceware.org>; 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 <gdb-patches@sourceware.org>; 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_Le_Gouguec?= <legouguec@adacore.com> 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-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: =?utf-8?q?K=C3=A9vin_Le_Gouguec_via_Gdb-patches?= <gdb-patches@sourceware.org> Reply-To: =?utf-8?q?K=C3=A9vin_Le_Gouguec?= <legouguec@adacore.com> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Fix Ada tasking for baremetal targets using Ravenscar threads
|
|
Message
Kévin Le Gouguec
Jan. 27, 2023, 4:53 p.m. UTC
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