From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wr1-x42c.google.com with SMTP id t18so5547255wro.1 for ; Fri, 27 Jan 2023 08:54:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mh/Y3eCpkER3GCmSpq1LHbR1ep5CrppHTgyUPsq9wBQ=; b=QKe72QURtZ9JV7oTE1nvV1HjtaxU+z8eVdUQjsSiIgaV7K9ceYyz/LmQMdffVVx2ml rafLqE2pLSjqVn10C5Pc5iZGyXQj36r2qZCwU4RS0/7D76WVMaV8MLTJwNp4PdQqr5nF 0tkaQKt0xQ20KzcR2zcy1j44v5bMd8ocXfaXEb63IUL34vtSGL63i/DGCzviEakpICq9 Meh0IB38NVBKgXAvzdkkHpqlui0CecC8DK1O0WHK+cSPF/3ynKh+S0vkEcm5eKeZOSdy u1aAE0MLG+UidTaUNVZqFkc4n+SUZs/5/4QalMo5mO0/ZHbzQo7rYKcxw4hbzlivGmJS meuA== 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) From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= 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-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 List-Id: 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