From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id CN6GKwmql2csUhwAWB0awg (envelope-from ) for ; Mon, 27 Jan 2025 10:45:13 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=AYCfflVv; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id A31901E105; Mon, 27 Jan 2025 10:45:13 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.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 autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 7BEBC1E08E for ; Mon, 27 Jan 2025 10:45:12 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0BDA43857C6C for ; Mon, 27 Jan 2025 15:45:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0BDA43857C6C Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=AYCfflVv Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) by sourceware.org (Postfix) with ESMTPS id 5B6083858031 for ; Mon, 27 Jan 2025 15:42:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5B6083858031 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5B6083858031 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.198.163.10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1737992541; cv=none; b=YT4M8wEsPiAvQIAtiPmCKGSzC0qhi65i6S0ywotEUkGw8NDX1AcazgVEwowlvChmI9J9W33K7HCCcvK/vhKuGKYF5oX/jowJJhnUuUqXf+o3AwY8R/QlwlTuLNiVYfhkoWrC4Jul2hkoEfhuLz1zm7TxZkdzxBPH1cWF90RY8KA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1737992541; c=relaxed/simple; bh=SzMjXsOegzhMz9UHXnk14PSLKiiKSGA7TS2JWy6RIgg=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=RzV3VPfWA1EhfZNT8epYBm9tNAX+YXo/x0BRyr/6OAJfic2RfJWXJAAZ3P26dLDOZwNDEZB6WJMk5q/LXtnCp5vmabj1q/DSQDIhQno8qjw224pg9pvr/LhSQRwSmIOoBT8FqS2Hd+G+NwvZe2YEmp86Lk04jRn8lAD5v+yl2dM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5B6083858031 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1737992541; x=1769528541; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SzMjXsOegzhMz9UHXnk14PSLKiiKSGA7TS2JWy6RIgg=; b=AYCfflVvJ+8M7lUJ0xaSnOzujlyC18KhqeAGvqAAsHaxSJsc+5Zosnxz 2+/GWkM2o+tX8Z3euAsCo/HzRPzcS7KY7fyZaYNzdC9CSfN/zdYVk9SE+ THd1O/HZWvb9QSYtR5lXdGr/0yjhBiJqtWmWbMcA8n8zUzBFCmWtIzAPL ds0/lJtNP+8a7qF6nKvn4ixym5RhCS9MnI47bkRy4upqIywtRJfoF81MZ AsfGNRXnXsow53376qpjqsAWOAomCm4p8HEBXdS+bpSjkAyaPWmYVjS/5 JYKJEMPf7k+QEreQdO034K/XiDihF61ZqbBOsgz+1Sv7bU0n1u1QuDxrX Q==; X-CSE-ConnectionGUID: RnSdWwFCQQyywIKgQyNzxA== X-CSE-MsgGUID: neJKFKgCQ6OlThF9nmtVbA== X-IronPort-AV: E=McAfee;i="6700,10204,11314"; a="49874184" X-IronPort-AV: E=Sophos;i="6.12,310,1728975600"; d="scan'208";a="49874184" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2025 07:42:20 -0800 X-CSE-ConnectionGUID: 9EtPzrPvT56Fezb8dj39ew== X-CSE-MsgGUID: EjSrgz+zRqCbmaPoIH+RJg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="113607006" Received: from 984fee0031af.jf.intel.com (HELO localhost) ([10.165.54.65]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2025 07:42:20 -0800 From: Stephan Rohr To: gdb-patches@sourceware.org Cc: eliz@gnu.org, guinevere@redhat.com, tom@tromey.com Subject: [PATCH v4 1/1] gdb: remove check for minimal symbols in 'start_command' Date: Mon, 27 Jan 2025 07:42:11 -0800 Message-Id: <20250127154211.2509613-2-stephan.rohr@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250127154211.2509613-1-stephan.rohr@intel.com> References: <20250127154211.2509613-1-stephan.rohr@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 From: "Rohr, Stephan" GDB aborts the 'start' command if the minimal symbols cannot be resolved. On Windows, GDB reads the minimal symbols from the COFF header of the PE file. The symbol table is deprecated and the number of symbols in the COFF header may be zero: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format This is reproducible with clang version 18.1.8 on Windows: clang++ -g -O0 -gdwarf -fuse-ld=lld test.cpp -o test_clang The COFF file header shows: FILE HEADER VALUES 8664 machine (x64) E number of sections 66E889EC time date stamp Mon Sep 16 21:41:32 2024 FB400 file pointer to symbol table 0 number of symbols F0 size of optional header 22 characteristics GDB is not able to read the minimal symbols; the `start' command fails with an error: (gdb) start No symbol table loaded. Use the "file" command. Manually inserting a breakpoint in main works fine: (gdb) tbreak main Temporary breakpoint 1 at 0x14000100c: file test.cpp, line 6. (gdb) run Starting program: C:\test-clang Temporary breakpoint 1, main () at test.cpp:6 6 std::cout << "Hello World.\n"; Remove the check entirely; a 'NOT_FOUND_ERROR' is thrown if 'main' cannot be resolved. The error is consumed in 'create_breakpoint ()' and an error message is displayed to the user. --- gdb/infcmd.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/gdb/infcmd.c b/gdb/infcmd.c index b6b21a46b3d..00703e44b7b 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -517,12 +517,6 @@ run_command (const char *args, int from_tty) static void start_command (const char *args, int from_tty) { - /* Some languages such as Ada need to search inside the program - minimal symbols for the location where to put the temporary - breakpoint before starting. */ - if (!have_minimal_symbols (current_program_space)) - error (_("No symbol table loaded. Use the \"file\" command.")); - /* Run the program until reaching the main procedure... */ run_command_1 (args, from_tty, RUN_STOP_AT_MAIN); } -- 2.34.1 Intel Deutschland GmbH Registered Address: Am Campeon 10, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Sean Fennelly, Jeffrey Schneiderman, Tiffany Doon Silva Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928