From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80973 invoked by alias); 22 Jun 2018 14:21:50 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 80960 invoked by uid 89); 22 Jun 2018 14:21:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Previously, Apr, apr X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 22 Jun 2018 14:21:48 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 317D011736F; Fri, 22 Jun 2018 10:21:47 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id eyxgnNg3L9NX; Fri, 22 Jun 2018 10:21:47 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 0AA6A1172E4; Fri, 22 Jun 2018 10:21:47 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 7BFF284347; Fri, 22 Jun 2018 10:21:46 -0400 (EDT) Date: Fri, 22 Jun 2018 14:21:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: GDB 8.2 branch 2018-06-11 Update Message-ID: <20180622142146.GA3143@adacore.com> References: <20180611225629.GA31935@adacore.com> <871sd3joml.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <871sd3joml.fsf@tromey.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-SW-Source: 2018-06/txt/msg00542.txt.bz2 Hi Tom, > Also I found out that this code in symfile.c: > > for (auto iter : new_objfiles) > gdb::observers::new_objfile.notify (objfile); > > ... had a bug introduced by > > commit 4c404b8be6b1d8759eed50366207fc0e2e47d2b1 > Author: Tom Tromey > Date: Fri Apr 7 15:58:25 2017 -0600 > > Use std::vector in reread_symbols > > Previously it read: > > - for (ix = 0; VEC_iterate (objfilep, new_objfiles, ix, objfile); ix++) > - observer_notify_new_objfile (objfile); > > ... where "objfile" was used in the iteration -- so now the wrong > objfile is being passed to the observers. > > Fixing this is trivial, but I suppose a test case would be good. Maybe > the simplest way would be a Python test (so it can hook into the > observer) plus a shared library? I am actually not sure. I guess I'm > sort of hoping not to write it. I'm hesitating on that one. Personally, I would accept the patch without a testcase based on it being trivial; but on the other hand, it seems worth giving the testcase a reasonable try, as I am hoping it might not be an unreasonable amount of work to create it, and although the fix is trivial, we did introduce that regression, so it's something that can happen if we continue without a testcase. -- Joel