public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Cc: Eli Zaretskii <eliz@gnu.org>
Subject: Re: [PATCH v2 00/17] Rewrite .debug_names reader and writer
Date: Thu, 18 Jan 2024 11:05:50 +0100	[thread overview]
Message-ID: <ce6e893e-d7c4-4732-8469-6a74a5914465@suse.de> (raw)
In-Reply-To: <20240117-debug-names-fix-v2-0-dbd5971a9c31@tromey.com>

On 1/17/24 17:39, Tom Tromey wrote:
> This series rewrites gdb's .debug_names reader and writer.
> 
> Currently, gdb can generate a .debug_names index, but the contents are
> very wrong -- they use fully-qualified names, which is not at all what
> is envisioned in the DWARF spec.
> 
> After this series, the section contents will be much closer to DWARF.
> However, it's not really useful for gdb to follow DWARF exactly.
> 
> First, the DWARF spec has a few bugs affecting the generation of the
> index.  GDB fixes these -- you won't see these fixes in this series,
> though, as they were all handled by the new DWARF scanner.
> 
> Second, gdb likes to have some information not readily available in
> the DWARF-specified contents.  You can see the new DW_IDX_* constants
> patch for a list.
> 
> I've regression tested this using the default board and the
> cc-with-debug-names board on x86-64 Fedora 38.
> 

I've applied the series and tested on x86-64 openSUSE Leap 15.4, using 
the default board and cc-with-debug-names.  No issues found, other than:
...
Running 
/data/vries/gdb/src/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp ...
ERROR: tcl error sourcing 
/data/vries/gdb/src/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp.
ERROR: can't read "binfile_stripped": no such variable
...

Thanks,
- Tom

> It's possible that there are regressions with cc-with-debug-names at
> some intermediate points in the series -- in particular I think it
> would happen after the reader is rewritten but before the writer patch
> is applied.  I didn't test this situation, since I don't think it is
> very important.  It could be worked around by combining the two
> patches, but I thought that would make review much more difficult.
> 
> ---
> Changes in v2:
> - Updated some tests
> - Reverted change to be strict about requiring .debug_aranges
> - Link to v1: https://inbox.sourceware.org/gdb-patches/20231210-debug-names-fix-v1-0-a8f6d2525018@tromey.com
> 
> ---
> Tom Tromey (17):
>        Refactor 'maint set dwarf synchronous' handling
>        Refactor quick-function installation in DWARF reader
>        Remove IS_ENUM_CLASS from cooked_index_flag
>        Document GDB extensions to DWARF .debug_names
>        Add language to cooked_index_entry
>        Move cooked_index_functions to cooked-index.h
>        Do not write the index cache from an index
>        Change cooked_index_worker to abstract base class
>        Remove cooked_index_worker::start_reading
>        Empty hash table fix in .debug_names reader
>        Fix dw2-zero-range.exp when an index is in use
>        Explicitly expand CUs in dw2-inline-with-lexical-scope.exp
>        Remove some .debug_names tests
>        Allow other results in DW_TAG_entry_point test
>        Rewrite .debug_names reader
>        Export dwarf5_augmentation
>        Rewrite .debug_names writer
> 
>   gdb/doc/gdb.texinfo                                |  39 +
>   gdb/dwarf2/cooked-index.c                          | 164 +++-
>   gdb/dwarf2/cooked-index.h                          | 168 +++-
>   gdb/dwarf2/index-write.c                           | 401 ++++-----
>   gdb/dwarf2/mapped-index.h                          |   4 +-
>   gdb/dwarf2/read-debug-names.c                      | 956 ++++++++-------------
>   gdb/dwarf2/read-debug-names.h                      |   2 +
>   gdb/dwarf2/read.c                                  | 341 ++------
>   gdb/testsuite/gdb.dwarf2/clang-debug-names-2-foo.c |  22 -
>   gdb/testsuite/gdb.dwarf2/clang-debug-names-2.c     |  27 -
>   gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp   |  42 -
>   gdb/testsuite/gdb.dwarf2/clang-debug-names.c       |  25 -
>   gdb/testsuite/gdb.dwarf2/clang-debug-names.exp     |  42 -
>   gdb/testsuite/gdb.dwarf2/clang-debug-names.exp.tcl | 121 ---
>   .../gdb.dwarf2/debug-names-bad-cu-index.exp        |  20 +-
>   gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp      |   5 +-
>   gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp      |   7 +
>   .../gdb.dwarf2/dw2-inline-with-lexical-scope.exp   |   4 +
>   gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp      |  10 +
>   gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp        |  10 +-
>   gdb/testsuite/lib/dwarf.exp                        |   7 +-
>   21 files changed, 976 insertions(+), 1441 deletions(-)
> ---
> base-commit: 2002c0099f9fb4d737930acd66733cfad39f68f1
> change-id: 20231210-debug-names-fix-cfbaf8761ecc
> 
> Best regards,


  parent reply	other threads:[~2024-01-18 10:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 16:39 Tom Tromey
2024-01-17 16:39 ` [PATCH v2 01/17] Refactor 'maint set dwarf synchronous' handling Tom Tromey
2024-01-17 16:39 ` [PATCH v2 02/17] Refactor quick-function installation in DWARF reader Tom Tromey
2024-01-17 16:39 ` [PATCH v2 03/17] Remove IS_ENUM_CLASS from cooked_index_flag Tom Tromey
2024-01-17 16:39 ` [PATCH v2 04/17] Document GDB extensions to DWARF .debug_names Tom Tromey
2024-01-17 16:39 ` [PATCH v2 05/17] Add language to cooked_index_entry Tom Tromey
2024-01-17 16:39 ` [PATCH v2 06/17] Move cooked_index_functions to cooked-index.h Tom Tromey
2024-01-17 16:39 ` [PATCH v2 07/17] Do not write the index cache from an index Tom Tromey
2024-01-17 16:39 ` [PATCH v2 08/17] Change cooked_index_worker to abstract base class Tom Tromey
2024-01-17 16:39 ` [PATCH v2 09/17] Remove cooked_index_worker::start_reading Tom Tromey
2024-01-17 16:39 ` [PATCH v2 10/17] Empty hash table fix in .debug_names reader Tom Tromey
2024-01-17 16:39 ` [PATCH v2 11/17] Fix dw2-zero-range.exp when an index is in use Tom Tromey
2024-01-17 16:39 ` [PATCH v2 12/17] Explicitly expand CUs in dw2-inline-with-lexical-scope.exp Tom Tromey
2024-01-17 16:39 ` [PATCH v2 13/17] Remove some .debug_names tests Tom Tromey
2024-01-17 16:39 ` [PATCH v2 14/17] Allow other results in DW_TAG_entry_point test Tom Tromey
2024-01-17 16:39 ` [PATCH v2 15/17] Rewrite .debug_names reader Tom Tromey
2024-01-17 16:39 ` [PATCH v2 16/17] Export dwarf5_augmentation Tom Tromey
2024-01-17 16:39 ` [PATCH v2 17/17] Rewrite .debug_names writer Tom Tromey
2024-01-18 10:05 ` Tom de Vries [this message]
2024-01-18 15:42   ` [PATCH v2 00/17] Rewrite .debug_names reader and writer Tom Tromey
2024-01-18 20:33     ` Tom Tromey

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=ce6e893e-d7c4-4732-8469-6a74a5914465@suse.de \
    --to=tdevries@suse.de \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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).