From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id zCcuEuLhDWnkUCkAWB0awg (envelope-from ) for ; Fri, 07 Nov 2025 07:11:14 -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=fpEq+YhZ; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 398831E0BC; Fri, 07 Nov 2025 07:11:14 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, 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 49F131E057 for ; Fri, 07 Nov 2025 07:11:10 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CD0463858D37 for ; Fri, 7 Nov 2025 12:11:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD0463858D37 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=fpEq+YhZ 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 D3E533858CDB for ; Fri, 7 Nov 2025 12:09:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D3E533858CDB 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 D3E533858CDB 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=1762517390; cv=none; b=J+iN/WXdeJCXcmoJc8mDyWVUpl3xZfJfEChYI1OSNw5W3PyRgOB6RpOcI4eN51LT/El/xTjdPMWuacX5XX2Hxpr4HpdVMN2Rae2gHBYLpxTqOvzKtrKSi6IyxKdmBbGxr27tgyjmPSRTJoCduVAJYmKTGLA1DcRR+ot22r0TBAE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762517390; c=relaxed/simple; bh=guixvi5z8YTC326p/7dMcfXou8MTiSgEdsD2NlUg7ek=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=Kv0y3TsvCkL4WgSCZXnGmucHRdYvYaN8Wq/s3yfqGgMm3IwtV6ckb1A/+YDI2/Lvm/Ab0X8/yJuAjbsSjJkjs12gsS3z/qzsPLoL1tNaLXFO1GQLmhLDYCdaRf4TE7kYsxu1gkBtRx4UsTh25M8MEUKxFEnfjHB6MdqQW8l2VM8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D3E533858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762517390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=53d909SSzIdj+yr5u0gBeiy1ZTqu+21Mtv5BWDy8PfM=; b=fpEq+YhZTIroxsRSsAMmnjJsJ9xygO9eaWh3YEs3r80GWveqrbUhcO7kL7IjDVxB/EF5dB lbfDNabSRr9kF0VUbt6ffnD4ZioAFHXpkaqdyFO7WGr5pCGnP4P8rNDp3XCmJooGmOuf47 LoSjsdLTr5erWdWGThEfm+gk9uhr3nw= Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-477-Y612kWRtNpic7fmkyrlHXQ-1; Fri, 07 Nov 2025 07:09:49 -0500 X-MC-Unique: Y612kWRtNpic7fmkyrlHXQ-1 X-Mimecast-MFC-AGG-ID: Y612kWRtNpic7fmkyrlHXQ_1762517389 Received: by mail-ua1-f72.google.com with SMTP id a1e0cc1a2514c-930dc545b31so302778241.1 for ; Fri, 07 Nov 2025 04:09:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762517389; x=1763122189; h=content-transfer-encoding:in-reply-to:content-language:from :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=53d909SSzIdj+yr5u0gBeiy1ZTqu+21Mtv5BWDy8PfM=; b=wETgOeyTFgF+nA3qM4GF+SrtScYCF41OhZZeQUKDcr05IDyEEeGrUCLI5UJyMEAYEV wmvxEKb2plHJFwc//pgUsqL/r7yxwNMLtjX+fICAivQPXe+vdyJfhE7dkQF/p0Q3JmiN HFdwT9ibOsOQ8jd14FXRL8blFW8Q6yFIRRFqoHGPvHohFnn/DRCh1Itq5LmdOC/KIeQN TCi6Dze6P5j19rAjgrTT0B3plH4qWF341suzxpTVBFvZ01/G5q5yG82C8cwKQO3YbzET 3rq6V6or3FViGjsuUXYc7lsN/h4kKmzHggd3OxnwEq+6D5fpSvGwtk0EMBLMk7yHxw4d 7VdQ== X-Forwarded-Encrypted: i=1; AJvYcCVmzX2vHCavATwxOz6I1882g6TPFoJRu2QrzAqJ61KFQCAN1F8zTrUmX36Pc0GKGPwiiCnixVlmNJpN7w==@sourceware.org X-Gm-Message-State: AOJu0YxkhuWnu1zDHhzPQoT4x6NyDXIQo7NLd0DrxTkSeTj2SV/1MXx+ QGG6r/Z566N9hpQtvmivQINm+43u9HFFwq8GPp5lyk8lZWTm7A7ZPMnIvaeHlkn4TdkzGzj7cEz OXySz4XAhUmRbcGoOjmxIJsry8ei27lwB4y0a7sFkVcaqB9/n0ktop2h+Uxv3vZg= X-Gm-Gg: ASbGncstViRv9ndCIoaZzSCibG57s3XHQdh3pKsv88IwOVaAMG+W4p6utNu4Sa5n+f7 MnEzN3HTL9BGZW1jT7e7sR7RwwQ9SnrZeyPZrN4Xu1QI84lNn4kjXBefgPIFA7sWMK1TDsFdnMw PIIaQ7/uuFiha/sWR/AlgM4ZXx6fuiFd3qCwDPAVYpjs4tjtkpV7iY/blCrI0vYc4MAaVzc65su ob1TPGSNuKLHyxWr4y0+vwLmbZeOmz1fnbZf51q3kqUF1XNsiqFZBrVIy/ggrjUnV8ZB5Nd/9/4 M6b/jKFe0KXjOGnnROB1LxutDwJo1jQLxiGpq9n+K2GE8BdepRdv1KSVhqUqdEYgK7l01UdRliN m1KMYNuantoI= X-Received: by 2002:a05:6122:2a02:b0:54b:c83b:9299 with SMTP id 71dfb90a1353d-559a3b037e0mr942003e0c.10.1762517388811; Fri, 07 Nov 2025 04:09:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IFbCH8LV0qNnEIjvPhbccsEb0ZYUPPolhdmGALgoldpOhHo2Ow+0G777U0uUXTnNRNFW5XeNw== X-Received: by 2002:a05:6122:2a02:b0:54b:c83b:9299 with SMTP id 71dfb90a1353d-559a3b037e0mr941993e0c.10.1762517388415; Fri, 07 Nov 2025 04:09:48 -0800 (PST) Received: from ?IPV6:2804:14d:8084:9a69::1000? ([2804:14d:8084:9a69::1000]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-559958286c8sm2823252e0c.17.2025.11.07.04.09.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Nov 2025 04:09:46 -0800 (PST) Message-ID: <9e4a2df5-90a7-40a7-a748-bc26ea5b58dd@redhat.com> Date: Fri, 7 Nov 2025 09:09:42 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 6/8] gdb: Remove stabs support from XCOFF inferiors To: Andrew Burgess , gdb-patches@sourceware.org References: <20251020152853.28195-1-guinevere@redhat.com> <20251020152853.28195-7-guinevere@redhat.com> <874ir65dct.fsf@redhat.com> From: Guinevere Larsen In-Reply-To: <874ir65dct.fsf@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: He19Cw6fK63iFgorCtKY1ZxRiJvjqSCfhqRgXGBADvE_1762517389 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed 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 On 11/7/25 7:46 AM, Andrew Burgess wrote: > 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 > Simon also raised this with me yesterday on IRC and sent this email to the AIX folks: https://inbox.sourceware.org/gdb-patches/b3afe6c6-8dc3-49be-8fca-43d0b3bddd56@polymtl.ca/T/#u I'd prefer to keep discussion to this on that thread, as it is more likely to be caught by the folk who are most likely to know what's going on. I'll take a look at this failure today either way and see if there is an easy out that doesn't require much AIX knowledge -- Cheers, Guinevere Larsen It/she