From: Simon Marchi <simon.marchi@polymtl.ca>
To: Simon Marchi <simon.marchi@efficios.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2] gdb/dwarf: dump cooked index contents in cooked_index_functions::dump
Date: Mon, 30 Jan 2023 11:08:02 -0500 [thread overview]
Message-ID: <44127e38-4aa2-a41e-a4c5-1641b61a8143@polymtl.ca> (raw)
In-Reply-To: <20230130160337.55890-1-simon.marchi@efficios.com>
On 1/30/23 11:03, Simon Marchi wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
>
> New in v2:
>
> - move the implementation to the cooked_index_vector class
> - use the gdbarch from the objfile
> - add some QUIT macro calls
> - add call to wait, to ensure the index is finished
>
> As I am investigating a crash I see with the cooked index, I thought it
> would be useful to have a way to dump the index contents. For those not
> too familiar with it (that includes me), it can help get a feel of what
> it contains and how it is structured.
>
> The cooked_index_functions::dump function is called as part of the
> "maintenance print objfiles" command. I tried to make the output
> well structured and indented to help readability, as this prints a lot
> of text.
>
> The dump function first dumps all cooked index entries, like this:
>
> [25] ((cooked_index_entry *) 0x621000121220)
> name: __ioinit
> canonical: __ioinit
> DWARF tag: DW_TAG_variable
> flags: 0x2 [IS_STATIC]
> DIE offset: 0x21a4
> parent: ((cooked_index_entry *) 0x6210000f9610) [std]
>
> Then the information about the main symbol:
>
> main: ((cooked_index_entry *) 0x621000123b40) [main]
>
> And finally the address map contents:
>
> [1] ((addrmap *) 0x6210000f7910)
>
> [0x0] ((dwarf2_per_cu_data *) 0)
> [0x118a] ((dwarf2_per_cu_data *) 0x60c000007f00)
> [0x1cc7] ((dwarf2_per_cu_data *) 0)
> [0x1cc8] ((dwarf2_per_cu_data *) 0x60c000007f00)
> [0x1cdf] ((dwarf2_per_cu_data *) 0)
> [0x1ce0] ((dwarf2_per_cu_data *) 0x60c000007f00)
>
> The display of address maps above could probably be improved, to show it
> more as ranges, but I think this is a reasonable start.
>
> Note that this patch depends on Pedro Alves' patch "enum_flags
> to_string" [1]. If my patch is to be merged before Pedro's series, I
> will cherry-pick this patch from his series and merge it before mine.
>
> [1] https://inbox.sourceware.org/gdb-patches/20221212203101.1034916-8-pedro@palves.net/
I just realized, this patch also depends on the following patch:
[PATCH v2] Make addrmap const-correct in cooked index
https://inbox.sourceware.org/gdb-patches/20230130152936.41750-1-simon.marchi@efficios.com/T/#u
Simon
next prev parent reply other threads:[~2023-01-30 16:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 16:03 Simon Marchi
2023-01-30 16:08 ` Simon Marchi [this message]
2023-01-30 19:07 ` Tom Tromey
2023-01-30 20:08 ` Simon Marchi
2023-01-30 21:35 ` Andrew Burgess
2023-01-31 3:06 ` Simon Marchi
2023-01-31 9:21 ` Andrew Burgess
2023-01-31 15:49 ` Simon Marchi
2023-01-31 17:27 ` Tom Tromey
2023-01-31 14:19 ` Tom Tromey
2023-01-31 15:35 ` Simon Marchi
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=44127e38-4aa2-a41e-a4c5-1641b61a8143@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.com \
/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).