public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
To: Aaron Merey <amerey@redhat.com>
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
Date: Tue, 26 Dec 2023 14:09:35 -0300	[thread overview]
Message-ID: <87frzogab4.fsf@linaro.org> (raw)
In-Reply-To: <20231028002008.1105723-3-amerey@redhat.com>


Aaron Merey <amerey@redhat.com> 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.

<snip>

> 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<objfiles_range>;
> +  using objfiles_safe_range = iterator_range<objfile_list::iterator>;

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<objfiles_safe_range>;

<snip>

> 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" "= {<text variable, no debug info>} $hex <main>" \
>  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

  parent reply	other threads:[~2023-12-26 17:09 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-28  0:20 [PATCH 0/4] On-demand debuginfo downloading Aaron Merey
2023-10-28  0:20 ` [PATCH 1/4 v7] gdb: Buffer output streams during events that might download debuginfo Aaron Merey
2023-11-12 20:20   ` Aaron Merey
2023-11-20 18:38     ` [PING*2][PATCH " Aaron Merey
2023-11-30 16:29       ` [PING*3][PATCH " Aaron Merey
2023-12-12 15:00         ` [PING*4][PATCH " Aaron Merey
2023-12-20 14:57           ` [PING*5][PATCH " Aaron Merey
2023-12-26 16:28   ` [PATCH " Thiago Jung Bauermann
2024-01-17 17:49     ` Aaron Merey
2024-01-17 18:05   ` Andrew Burgess
2023-10-28  0:20 ` [PATCH 2/4 v2] gdb/progspace: Add reverse safe iterator and template for unwrapping iterator Aaron Merey
2023-11-12 20:20   ` Aaron Merey
2023-11-20 18:39     ` [PING*2][PATCH " Aaron Merey
2023-11-30 16:30       ` [PING*3][PATCH " Aaron Merey
2023-12-12 15:01         ` [PING*4][PATCH " Aaron Merey
2023-12-20 14:57           ` [PING*5][PATCH " Aaron Merey
2023-12-26 17:09   ` Thiago Jung Bauermann [this message]
2023-10-28  0:20 ` [PATCH 3/4 v4] gdb/debuginfod: Support on-demand debuginfo downloading Aaron Merey
2023-11-12 20:20   ` Aaron Merey
2023-11-20 18:39     ` [PING*2][PATCH " Aaron Merey
2023-11-30 16:30       ` [PING*3][PATCH " Aaron Merey
2023-12-12 15:01         ` [PING*4][PATCH " Aaron Merey
2023-12-20 14:57           ` [PING*5][PATCH " Aaron Merey
2023-12-26 18:35   ` [PATCH " Thiago Jung Bauermann
2023-10-28  0:20 ` [PATCH 4/4 v5] gdb/debuginfod: Add .debug_line downloading Aaron Merey
2023-11-12 20:21   ` Aaron Merey
2023-11-20 18:40     ` [PING*2][PATCH " Aaron Merey
2023-11-30 16:30       ` [PING*3][PATCH " Aaron Merey
2023-12-12 15:08         ` [PING*4][PATCH " Aaron Merey
2023-12-20 14:58           ` [PING*5][PATCH " Aaron Merey
2023-12-27  0:30   ` [PATCH " Thiago Jung Bauermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87frzogab4.fsf@linaro.org \
    --to=thiago.bauermann@linaro.org \
    --cc=aburgess@redhat.com \
    --cc=amerey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).