From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id PbL8D2LODWk/ICkAWB0awg (envelope-from ) for ; Fri, 07 Nov 2025 05:48:02 -0500 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=DYEIWFBN; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 30FB81E0BC; Fri, 07 Nov 2025 05:48:02 -0500 (EST) 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 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 19B811E057 for ; Fri, 07 Nov 2025 05:48:01 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A86CC3858D3C for ; Fri, 7 Nov 2025 10:48:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A86CC3858D3C 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=DYEIWFBN 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 793B13858C55 for ; Fri, 7 Nov 2025 10:47:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 793B13858C55 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 793B13858C55 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=1762512445; cv=none; b=hN/CxmRwIPi0VzfCNgyonJqTpa+uefeF4a/IUKFd8T8+kj3+6xNRILs53u7h+RK2b9GbhWov97S+4OrtzerHREZmMK0ADzWZGZ7fldf5raLk6ogA0igxJNw6mS+nwqPvaDFl1VrJuxkSKny1KvFTYPi/gspOeXyZZP+4JyPG53k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762512445; c=relaxed/simple; bh=1/pOXvcs48YWDD+8T/OuS7v272LanLWUA6fLcQ1cfiU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=sLq4HrtKb/n3A7cLfVnNB1Si5gdLWJOd43fdxLX7m5nqQpKrcJ2FGTd+8+zqUjWHQhr/yXPqqVUgmR8gKX6+eJq4UmJvvMNxoxeevXM3SjsehvohFUTQ3nWnB0y2eyXXLCfwBYKvdQ42aOPnlCITifx+9LyeOU9YY/i6yCHVFzk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 793B13858C55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762512422; 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: in-reply-to:in-reply-to:references:references; bh=JmeDocyJjRMJZLv2atEl70yapLa2wxCtw/0cWBkrrW4=; b=DYEIWFBND3wqRkGT0eIAlX46UD0fBQRr1oFnPTcF8XEBCWN+9+QZbofigoeX7I1PsBPCMC koiTKMJEbrZ4YGfNODGMW7YHE+UY+qvHmJ8mRabM8r8g6gIyYSOcjgcHGuAUvlHtLVnUGT 9pDZ+Au3+gFS7UHjzrncWs5lX9AxE94= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-623-WL5JN3YwOi2VNJFHdQO2Hw-1; Fri, 07 Nov 2025 05:47:01 -0500 X-MC-Unique: WL5JN3YwOi2VNJFHdQO2Hw-1 X-Mimecast-MFC-AGG-ID: WL5JN3YwOi2VNJFHdQO2Hw_1762512420 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-429be5aeea2so284466f8f.2 for ; Fri, 07 Nov 2025 02:47:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762512420; x=1763117220; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JmeDocyJjRMJZLv2atEl70yapLa2wxCtw/0cWBkrrW4=; b=gstyDOoRAoStvEXPvScjGdJc7tGDug8ZHMrbSR8gr+rulf93uX6gsMzrjATB5MAVsB PurxStH8KI6vOTtLGO6EnJUyQ+xIq1gWMu/M3GKN4b294Fg+mnQygIxViKb42Aj8krFL dz2slJfTwdWQr1Dso9YMdt02Qu6qLsH2RdnnASGiocLVKgPHXguoASNcnO1JE2KGp03i 8OouUOq5co/jEwuMWsRFwJJi9uvR38EuZj5gC+HFr1gMGF9Fcx0/JZK63tknLw0+ItUS DzNFI3YJyW5bcIlL1V6UAml97sGouhKE6FqAS4pKCEk+uBwzwcnNOTb88CUop4w9Xsj+ Ia+g== X-Forwarded-Encrypted: i=1; AJvYcCVGkTHv53g1SKCAFPxzjtbCcgSmZ3PFTrDV+N1LvruirakgXx3EkNwUJrJRJHTSgZYcqawRTjkBMNoR2A==@sourceware.org X-Gm-Message-State: AOJu0Yy6FQ3fY4kP/6AD8p6ulA/Uu7mF0EflwFwQqYL0owpO0/Su8c5F HQoHQhUyrVV6aawIkzYrfBGXnVTKeHuM/+SShJBpJJSpQSJx5GdQjE9HwjD//GWfAnxI1kGvdLz jg4gtYpddpj4XlcXEngJkMQmY3UVateO1NN6tpH0dJyuNlCXxExOpRFQvZXNe3mchQhSdjOY= X-Gm-Gg: ASbGncu6c+FBcD4xwbsIf4pRo/R8EbNDz7GNB5HKljDdMV5rMWywexF3I+9gjoKNvag PZ9YFxE1NwUgifDjFVeqe0yhNP21MQh/LCwiHh8tE3EOoEoCbHFvtmf7psMssEBCEACH1SwHmeg JRgFqD5nf73HD9gmFDDdaEsZidvwxfM1D234m1dKa4NXyf657qzmn8yNGUtg0+TLQYibiXSpR3U R+DIvpYz6fwBgR/4gk32bJuPaWaHjgq1++dK5QXqD1l1nPZDSgR7sN18J2o+v+jgaw1lCxipL66 FDkRJ/xw5RUAtwBGe9rSTj87rI/3gdQz3xexzi2uEJHjzocpqrFmG13qzWCgcFX3KTPSlg== X-Received: by 2002:a05:6000:1ac9:b0:429:ca7f:8d65 with SMTP id ffacd0b85a97d-42ae5ac420dmr2007391f8f.37.1762512420007; Fri, 07 Nov 2025 02:47:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpjtQYQwbWY/O7/i4nwxwLDybxBRwpqxSDcLVUjlT9WfPge0BgkNa6aI0S1GNipl4a+6FgKg== X-Received: by 2002:a05:6000:1ac9:b0:429:ca7f:8d65 with SMTP id ffacd0b85a97d-42ae5ac420dmr2007355f8f.37.1762512419489; Fri, 07 Nov 2025 02:46:59 -0800 (PST) Received: from localhost ([31.111.84.207]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42ac677ab75sm4237855f8f.35.2025.11.07.02.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Nov 2025 02:46:58 -0800 (PST) From: Andrew Burgess To: Guinevere Larsen , gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: Re: [PATCH v2 6/8] gdb: Remove stabs support from XCOFF inferiors In-Reply-To: <20251020152853.28195-7-guinevere@redhat.com> References: <20251020152853.28195-1-guinevere@redhat.com> <20251020152853.28195-7-guinevere@redhat.com> Date: Fri, 07 Nov 2025 10:46:58 +0000 Message-ID: <874ir65dct.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: M4HQDMBTvYgX8ip7WoYb8kzjpbT11FTxprAinPVUSJs_1762512420 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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 Guinevere Larsen writes: > This commit is the second to last in the series fully removing support > for stabs in GDB, removing it from XCOFF inferiors. According to IBM's > AIX documentation[1], xcoff binaries can only have stabs or DWARF debug > info, meaning removing stabs seems pretty trivial, as anything that > isn't related to setting base information on the objfile or reading > dwarf can be removed. > > The unfortunate part of this removal is that XCOFF minimal symbols are > encoded in stabs, so if an inferior has not been compiled with dwarf > debuginfo, GDB will only be able to do assembly-level debugging. Due to > this, the xcoff reader now emits a warning if no dwarf is read, saying: > "No usable debug information found". This change would also add a lot of > regressions to to AIX, so the gdb_compile proc has been changed to not > work when a test tries to compile a test with nodebug. > > As a sidenote, gdb-stabs.h can just be removed from rs6000-aix-nat, as > none of the structs or macros defined in the header are used in the nat > file, so that is an unnecessary include. > > This commit introduces some known regressions when testing GDB in AIX > systems. The main ones are: > * inferior function calls now crash with a corrupted stack. This seems > to be some fault of dwarf in explaining how to correctly set the frame > for a function. > * fortran tests can't runto_main: the fortran compiler does not add any > symbol for MAIN__ in the dwarf information, only in stabs, so the > fortran_runto_main proc can't set the breakpoint correctly. > * When dealing with c++ class methods, there are cases when we fail to > properly recognize a method call as a new function. > * When dealing with c++ virtual inheritance, GDB has issues finding a > derived class's members when it has been downcast to a base class. A colleague reported this build failure after this commit: CXX gdb.o ../../../binutils-gdb/gdb/xcoffread.c: In function 'void enter_line_range(subfile*, unsigned int, unsigned int, CORE_ADDR, CORE_ADDR, unsigned int*)': ../../../binutils-gdb/gdb/xcoffread.c:573:44: error: 'this' pointer is null [-Werror=nonnull] 573 | addr += objfile->text_section_offset (); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ In file included from ../../../binutils-gdb/gdb/xcoffread.c:43: ../../../binutils-gdb/gdb/objfiles.h:512:13: note: in a call to non-static member function 'CORE_ADDR objfile::text_section_offset() const' 512 | CORE_ADDR text_section_offset () const | ^~~~~~~~~~~~~~~~~~~ ../../../binutils-gdb/gdb/xcoffread.c:579:63: error: 'this' pointer is null [-Werror=nonnull] 579 | - objfile->text_section_offset ()); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ ../../../binutils-gdb/gdb/objfiles.h:512:13: note: in a call to non-static member function 'CORE_ADDR objfile::text_section_offset() const' 512 | CORE_ADDR text_section_offset () const | ^~~~~~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors This was building GDB on current Fedora rawhide, with gcc-15.2.1-2.fc44.x86_64. The compiler is being pretty insightful here. OBJFILE is initialised within the function like this: struct objfile *objfile = this_symtab_objfile; And THIS_SYMTAB_OBJFILE is a static variable within this file that is initialised to NULL. After this commit, there is now no longer any way that THIS_SYMTAB_OBJFILE can be set to a non-null value, so the above warning/error seems legit. This opens a bigger question (in my mind). Either the code in xcoffread.c that depends on THIS_SYMTAB_OBJFILE needs deleting, or some parts of this commit need restoring. I've not had a chance to look into this yet, so don't currently have an opinion either way. Thanks, Andrew