From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by sourceware.org (Postfix) with ESMTPS id 5227E3858D32 for ; Tue, 26 Dec 2023 17:09:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5227E3858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5227E3858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::535 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703610584; cv=none; b=FEmraBmqW4znAavQIGDMpJsCyX04WtD4bAEUdQLOEZsQHDuGsjBzK5AaioPIksHoyA/20aBFnNl150mjCBMAkmT7sY7cR1UKTqb0XHQVYCXcQJTVoXrXgiq9ckBDP4cFtrGZlyseIYkkvQV90QoRh9wL6t7jJWrOTwltGq54X28= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703610584; c=relaxed/simple; bh=NWLR/qnDbqy4MijoJCqUSaGVq8tluWXwDny185X1FIA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=j0zs3ktNRFvSqNz2ed9pCv6NwHSQNIlTlLbBc2ekydIIZiS/6RfyM9n6JRPudNQ/Ect2yGnhcjphf5cUkTsCSKPY5hfzu0BkVMl2evjcw6QhcsnVCKjLOgIrA0UJm8j2YYc4Jj0AbhqRdBllWoEZ2jJ9FwK7ZLjpSlgdeJZEKVU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-5cd51c0e8ebso1531852a12.3 for ; Tue, 26 Dec 2023 09:09:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703610578; x=1704215378; darn=sourceware.org; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=BEoksxoew8Jr6j3X91lcWO372Kpvo/lb9hbSIyzPpg8=; b=VBiw3T9bC+TD0Z+lnuzOAcWF3cDyF0GdzsJGHRhtlhT18jFFgYnhcAXaGgL/bPaXsL KnXO9TTh6a0kcaFRVL3nMIeDlz0FI2TNEB9Dxt71XNT3lY+KStmOGVfnkkT82Pg/KzAE 1dmHcVOgeZX+Tx3Vl41rQDSpqIm7JnZuUJKObtfQFpYvJ/70xvbzc9eD6RCx2vWfKVpX N2EUe041ocObVKcrmWe2rUzekK80rcz9SrWE/hSVm95K695jzTCf440iEsaS1kcFfRM2 BmKjs7BOVfiawpgDLD7MRVGHzlTHs8uE3msMGRqnXb816byJuUqhbRIYw0g31vtRLCp5 Yc7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703610578; x=1704215378; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BEoksxoew8Jr6j3X91lcWO372Kpvo/lb9hbSIyzPpg8=; b=jNlxSFo3vLl0/4qZscMuvOhNSxZiK64EHRgN5XI3mXxHqSsqw4R06h0j7yoohUk2aN tnQihuQWIqmdCLp3g4kF8KDbQhy0A5l80GEsM7Y4dQ3wc17q3l57AV6FPZeuWcIMG8qE Tcyk1gdrNtxzmjoDIN7FMyc28ghxmIROCgblQmEJtTlU3zlYnZQM5qGboHqli5ZYnqA+ nLx3oJ9SP6rU9CdxF/ib+kbj2liz5StSRPOT1TniA0Og1Bh6RTpclyQyEt0kCvuL838h Faj5DxlDi/dJwZ5Z6BTsJD6V5PobC1n9JtClFHGcrbcoeL3Su+lN2Beim0AYwmHCWQnM BjlA== X-Gm-Message-State: AOJu0Yzr4y0OIneGfULIE+YyAbBY7P707v15zYbr5RQy39Gu/xsHU2ED 5OxdTNG2bRfuUMpbDtADBA1r/heDT1iQCA== X-Google-Smtp-Source: AGHT+IGWhyUWU/eooaGFn/YXBF7q5CIXiM2ZfMt6rw5kew7ILsH9tdyRTSZ7JnWSgEmNBnXRPirdfA== X-Received: by 2002:a05:6a20:3427:b0:18f:97c:9291 with SMTP id i39-20020a056a20342700b0018f097c9291mr2447320pzd.118.1703610578123; Tue, 26 Dec 2023 09:09:38 -0800 (PST) Received: from localhost ([2804:14d:7e39:8470:b425:ec2d:a09a:544f]) by smtp.gmail.com with ESMTPSA id o75-20020a62cd4e000000b006d99afd5fd9sm6677829pfg.207.2023.12.26.09.09.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 09:09:37 -0800 (PST) References: <20231028002008.1105723-1-amerey@redhat.com> <20231028002008.1105723-3-amerey@redhat.com> User-agent: mu4e 1.10.8; emacs 29.1 From: Thiago Jung Bauermann To: Aaron Merey Cc: aburgess@redhat.com, gdb-patches@sourceware.org Subject: Re: [PATCH 2/4 v2] gdb/progspace: Add reverse safe iterator and template for unwrapping iterator In-reply-to: <20231028002008.1105723-3-amerey@redhat.com> Date: Tue, 26 Dec 2023 14:09:35 -0300 Message-ID: <87frzogab4.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: Aaron Merey writes: > v1: https://sourceware.org/pipermail/gdb-patches/2023-June/199984.html > > v2 removes unwrapping_reverse_objfile_iterator and adds > basic_safe_reverse_range and basic_safe_reverse_iterator. > > Commit message: > > This patch changes progspace objfile_list insertion so that separate > debug objfiles are placed into the list after the parent objfile, > instead of before. Additionally qf_require_partial_symbols now returns > a safe_range. > > These changes are intended to prepare gdb for on-demand debuginfo > downloading and the downloading of .gdb_index sections. > > With on-demand downloading enabled, gdb might need to delete a > .gdb_index quick_symbol_functions from a parent objfile while looping > the objfile's list of quick_symbol_functions becasue the separate *because > debug objfile has just been downloaded. The use of a safe_range > prevents this removal from causing iterator invalidation. > diff --git a/gdb/progspace.h b/gdb/progspace.h > index a22e427400e..17bb1710ccf 100644 > --- a/gdb/progspace.h > +++ b/gdb/progspace.h > @@ -214,28 +214,32 @@ struct program_space > unwrapping_objfile_iterator (objfiles_list.end ())); > } > > - using objfiles_safe_range = basic_safe_range; > + using objfiles_safe_range = iterator_range; Does objfile_safe_range still need the safe qualifier? Or should it be called objfiles_range now? > + using objfiles_safe_reverse_range > + = basic_safe_reverse_range; > diff --git a/gdb/testsuite/gdb.python/py-objfile.exp b/gdb/testsuite/gdb.python/py-objfile.exp > index 61b9942de79..0bf49976b73 100644 > --- a/gdb/testsuite/gdb.python/py-objfile.exp > +++ b/gdb/testsuite/gdb.python/py-objfile.exp > @@ -135,7 +135,7 @@ gdb_test "p main" "= {} $hex
" \ > gdb_py_test_silent_cmd "python objfile.add_separate_debug_file(\"${binfile}\")" \ > "Add separate debug file file" 1 > > -gdb_py_test_silent_cmd "python sep_objfile = gdb.objfiles()\[0\]" \ > +gdb_py_test_silent_cmd "python sep_objfile = gdb.objfiles()\[1\]" \ > "Get separate debug info objfile" 1 Does the fact that this testcase needed change mean that there was an API break? In my opinion it doesn't and this patch is ok. I think it would be too much to guarantee a specific ordering of the returned objfiles. But I'm mentioning it anyway because perhaps someone has a different view? -- Thiago