From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iehhHhMqsGlrviEAWB0awg (envelope-from ) for ; Tue, 10 Mar 2026 10:26:27 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=SJzw7d16; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 7567E1E0DD; Tue, 10 Mar 2026 10:26:27 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id E43601E08D for ; Tue, 10 Mar 2026 10:26:26 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 78A744BA2E1C for ; Tue, 10 Mar 2026 14:26:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 78A744BA2E1C Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=SJzw7d16 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 7888D4BA2E13 for ; Tue, 10 Mar 2026 14:25:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7888D4BA2E13 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7888D4BA2E13 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773152741; cv=none; b=RvRolVwE/51lXcTABjXls4W1LMF4O8Mfd5uiKB6gVSxcRi6EPbEZcEZC02WOyBBgetvP++w6JTvrdIvl5y+LX12tIVUcp7kWU+kF6+GlH6pZw8KP3HBF0VHEJWjhtZlR/wkpf2tEaCwipJQwQ+GyTBATmZ+IpR+cB8+tC7XV4pM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773152741; c=relaxed/simple; bh=yaej4/O5+i2QM0xuKXoaES2IPOyqLfsyqlpTKcBId6s=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jiYIZj/bcuBglsKL7JFUYpLltp6QpShnmg+tAYISmbxWP5s/HKXiZPrELgJCdvmHxb7JokYmmXhrz9M/xIE0ei6XQ2jERkTBnn0S4iThENQpNhRaqKox8Lhfezg0VUb0vPwvAia456U0RmMbevJ+RQ946OFvQ4XaTelM6K6wmDk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7888D4BA2E13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773152740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8pbQqaOwsP0hiHFG65B1NR3+GHSRlh6cLbQUZj7vARw=; b=SJzw7d16nmHzHZ2t9IjdIN/RxvPkI6j+cY8LyxSJIokqALUv4whmm9ZcPcCP1P1j2sKa0e wBOCnw1DWXGtVVSm/VdpIDG/Dw8CQENJCvNP3iEo9x8HmZYYXjot22Ti2wEErlz2t8boaA DyWQY+ZSgL0JRN40eLX699+KxVztNGY= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-401-xp0Mqa9zNmSmNija87Pwag-1; Tue, 10 Mar 2026 10:25:38 -0400 X-MC-Unique: xp0Mqa9zNmSmNija87Pwag-1 X-Mimecast-MFC-AGG-ID: xp0Mqa9zNmSmNija87Pwag_1773152738 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BA0001800590; Tue, 10 Mar 2026 14:25:30 +0000 (UTC) Received: from fedora.tailb97d54.ts.net (unknown [10.96.134.165]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A8DB41956095; Tue, 10 Mar 2026 14:25:28 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen , Ciaran Woodward , Tom Tromey Subject: [PATCH v5 2/2] gdb: Improve warning when no native target is available Date: Tue, 10 Mar 2026 11:23:24 -0300 Message-ID: <20260310142323.2619350-4-guinevere@redhat.com> In-Reply-To: <20260310142323.2619350-2-guinevere@redhat.com> References: <20260310142323.2619350-2-guinevere@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: mYEusrSQW0AFr1kj9Gt_bIvHrc3TM5099RWfLEep8x8_1773152738 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Currently, if a user attempts to debug a program without access to a native debugger, the error message will just be: Don't know how to . try "help target" This message is too generic, and doesn't help a user without internal knowledge of GDB. The present commit changes that message to be more informative for a user who is unfamiliar with GDB and installed it in an unsupported system, such as in a mac with M-series chips. Reviewed-By: Ciaran Woodward Approved-By: Tom Tromey --- gdb/inf-child.c | 7 ++++++- gdb/target.c | 5 ++++- gdb/testsuite/gdb.base/auto-connect-native-target.exp | 6 ++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/gdb/inf-child.c b/gdb/inf-child.c index 7983ecb0d92..ae2cadc5e2b 100644 --- a/gdb/inf-child.c +++ b/gdb/inf-child.c @@ -42,7 +42,12 @@ static const target_info inf_child_target_info = { "native", N_("Native process"), - N_("Native process (started by the \"run\" command).") + N_("Native process.\n\ +\n\ +This gives GDB the ability to control the execution of binaries in the\n\ +current CPU architecture. It is installed automatically when you attempt\n\ +to \"run\" or \"start\" a program, if the CPU architecure is supported by\n\ +GDB.") }; const target_info & diff --git a/gdb/target.c b/gdb/target.c index 77a562aa919..6fc1872685f 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -2899,7 +2899,10 @@ find_default_run_target (const char *do_mesg) return the_native_target; if (do_mesg != NULL) - error (_("Don't know how to %s. Try \"help target\"."), do_mesg); + error (_("\ +No native target available, unable to %s. Try \"help target native\".\n\ +This may be because your CPU architecture is not supported, use\n\ +\"help set architecture\" for a list of supported architectures."), do_mesg); return NULL; } diff --git a/gdb/testsuite/gdb.base/auto-connect-native-target.exp b/gdb/testsuite/gdb.base/auto-connect-native-target.exp index 26434396cc6..65696f0167c 100644 --- a/gdb/testsuite/gdb.base/auto-connect-native-target.exp +++ b/gdb/testsuite/gdb.base/auto-connect-native-target.exp @@ -105,7 +105,8 @@ kill_program "kill" gdb_test_no_output "set auto-connect-native-target off" # Commands that rely on the native target auto-connecting should no longer work. -gdb_test "start" "Don't know how to run.*" "start no longer works" +gdb_test "start" "No native target available, unable to run.*" \ + "start no longer works" # Explicitly connect to the native target. gdb_test "target native" \ @@ -181,7 +182,8 @@ with_test_prefix "disconnect" { fail $test } - gdb_test "start" "Don't know how to run.*" "start no longer works" + gdb_test "start" "No native target available, unable to run.*" \ + "start no longer works" } # Reenable auto-connecting to the native target. Plain "start" should -- 2.53.0