From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 10364385840B for ; Fri, 29 Sep 2023 10:20:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 10364385840B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695982818; 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=rVZJTdWyM/HQlu6G1flAO8Opy1+G7Z0UtQwgNHv5Pmo=; b=J27uwww8QciXDtsFphf6FXcL9DH0coyfRXFZVLOEeQPUBbwtBZEdqHDM7/d3CBCaqUS7xO b0O4R+D6yaOG4QyXrdQLzuPwqLwJ8BPH99jU3EQvNdB68ocyJp9ZEOQWK27XdR3BJfDqxR Eb+AW0zn6QQQJxoJgGT5o4ysHxpKFUQ= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-88-UXCDU6FvM9Km0GWiCp_hbg-1; Fri, 29 Sep 2023 06:20:17 -0400 X-MC-Unique: UXCDU6FvM9Km0GWiCp_hbg-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-9a9d7a801a3so1217556266b.2 for ; Fri, 29 Sep 2023 03:20:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695982816; x=1696587616; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rVZJTdWyM/HQlu6G1flAO8Opy1+G7Z0UtQwgNHv5Pmo=; b=OWkNPTYG5JVvs0yPD97G6EqGHmRwwPTAEde+Zz0FsodfF15wj4usljAzkCXwbjEcTN eFjmLe9t7tDl7Sp3AfbttwQApl0JUpA8A8Og7Tbn9WWIRqAXUMq/ozkfmx6aE9kT04ZH GqnnMqfJgH1LNv/MaCSPIE3QkllDur2YTPKBttMcAbxRwYiSBvAnYX4jzRdsxVwPR6vs jUX/cIO1v/KsU5D32OjwRXcDC2h758Ta5f3XdMuvOKN+MiCN2oiPBXbIIZVP1p5uCyGg l1+evoxJ7dKsKM4xxS24iYSCw+uBNLXXiZ/50bkFdaZA4cxjGH1S0NhH/PtLnnD9+v3O v/Yw== X-Gm-Message-State: AOJu0YxuyqcFJFgmq8pr/UNsHt9Poj857L7Tos4e/Mr4qsXKfts6Xb6r G4NWclGrAxNkFK3oH23mBPYbp5mwOqtbanaN0IOPLcYRpyQsyI/vFCGHu02gCkxbTB19xN7LVz5 bBg84uG/m3xCai/DY0WFAmgx8RfZ7Pg== X-Received: by 2002:a17:906:1d2:b0:9ad:ad5a:939b with SMTP id 18-20020a17090601d200b009adad5a939bmr3205532ejj.7.1695982816175; Fri, 29 Sep 2023 03:20:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/m3Gn59K/HcG16hdaoelwlsW22XV8vv18NBozZ0NrVQYoJHSB6twmo6Mw4T2oCMdaiiFdOg== X-Received: by 2002:a17:906:1d2:b0:9ad:ad5a:939b with SMTP id 18-20020a17090601d200b009adad5a939bmr3205520ejj.7.1695982815858; Fri, 29 Sep 2023 03:20:15 -0700 (PDT) Received: from localhost ([31.111.84.209]) by smtp.gmail.com with ESMTPSA id l25-20020a1709066b9900b0099cc36c4681sm12127332ejr.157.2023.09.29.03.20.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 03:20:15 -0700 (PDT) From: Andrew Burgess To: Tom Tromey Cc: gdb-patches@sourceware.org, Tom Tromey Subject: Re: [PATCHv2 5/5] gdb: fix reread_symbols when an objfile has target: prefix In-Reply-To: <87il7u2mdo.fsf@tromey.com> References: <87il7u2mdo.fsf@tromey.com> Date: Fri, 29 Sep 2023 11:20:14 +0100 Message-ID: <87pm21uvq9.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: Tom Tromey writes: > Andrew> I didn't 100% understand the issues discussed in that thread, however, > Andrew> I think the problem with the previous thread related to the changes in > Andrew> gdb_bfd.c, rather than to the change in symfile.c. As such, I think > Andrew> this change might be acceptable, my reasoning is: > > Andrew> - the objfile::mtime field is set by a call to bfd_get_mtime (see > Andrew> objfiles.c), which calls bfd_stat under the hood. This will end > Andrew> up using the system stat, > > Andrew> - In symfile.c we currently call stat directly, which will call the > Andrew> gnulib stat, which, if I understand the above thread correctly, > Andrew> might give a different result to the system stat in some cases, > > Andrew> - By switching to using bfd_stat in symfile.c we should now be > Andrew> consistently calling the system stat, > > The BFD cache (in gdb_bfd.c) uses fstat, so I think there would still be > a problem here. OK, but the original mtime is captured via a call to bfd_stat. Isn't the problem when we have two mismatched calls. Using bfd_stat in one place (a.k.a. system stat/fstat) vs a direct call to stat/fstat from GDB in another place (a.k.a. gnulib stat/fstat). In this patch I'm proposing that we _consistently_ call bfd_stat. Sure that might disagree with system stat/fstat -- but who cares? So long as the time being calculated and compared to is a BFD time_t result then we should be fine .... or am I really not understanding the problem? Thanks, Andrew