Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/7] Move lnp_state_machine to new file
Date: Mon, 8 Sep 2025 12:04:17 -0400	[thread overview]
Message-ID: <3fccac07-1e35-48be-a028-94140c019abb@simark.ca> (raw)
In-Reply-To: <20250907-breakpoint-cu-expand-v1-1-dd2beef9d475@tromey.com>

On 9/7/25 3:29 PM, Tom Tromey wrote:
> This patch moves lnp_state_machine and some supporting code to a new
> file, dwarf2/line-program.c.  The main benefit of this is shrinking
> dwarf2/read.c a bit.
> ---
>  gdb/Makefile.in           |   1 +
>  gdb/dwarf2/line-program.c | 731 ++++++++++++++++++++++++++++++++++++++++++++
>  gdb/dwarf2/line-program.h |  47 +++
>  gdb/dwarf2/read.c         | 757 +---------------------------------------------
>  gdb/dwarf2/read.h         |  31 ++
>  5 files changed, 814 insertions(+), 753 deletions(-)
> 
> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
> index 7654fb1aa04465e570b2e06f9a223b95448b0ca2..d7f8b95cae736255d4d26bc6c85cb8e22675c9f1 100644
> --- a/gdb/Makefile.in
> +++ b/gdb/Makefile.in
> @@ -1910,6 +1910,7 @@ DWARF2_SRCS = \
>  	dwarf2/index-write.c \
>  	dwarf2/leb.c \
>  	dwarf2/line-header.c \
> +	dwarf2/line-program.c \
>  	dwarf2/loc.c \
>  	dwarf2/macro.c \
>  	dwarf2/parent-map.c \

I think we're supposed to add header files to the HFILES_NO_SRCDIR
variable (although I'm sure it's missing some).

> diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h
> index 74ec4204cadbc38d9d66f8a6a5cac432297a88ff..12c8666a7350246c71d1bbf97119ce6fa1d25a50 100644
> --- a/gdb/dwarf2/read.h
> +++ b/gdb/dwarf2/read.h
> @@ -1351,4 +1351,35 @@ extern file_and_directory &find_file_and_directory (die_info *die,
>  extern const dwarf2_section_info &get_section_for_ref
>    (const attribute &attr, dwarf2_cu *cu);
>  
> +/* A convenience function to find the proper .debug_line section for a CU.  */
> +
> +extern struct dwarf2_section_info *get_debug_line_section
> +  (struct dwarf2_cu *cu);
> +
> +struct file_entry;

I would put this at the top with the other forward decls.

Otherwise, looks very nice.  That's a good chunk of code out of read.c.

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Simon

  reply	other threads:[~2025-09-08 16:06 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-07 19:29 [PATCH 0/7] Shrink dwarf2/read.c and clean up lnp_state_machine Tom Tromey
2025-09-07 19:29 ` [PATCH 1/7] Move lnp_state_machine to new file Tom Tromey
2025-09-08 16:04   ` Simon Marchi [this message]
2025-09-09  0:51     ` Tom Tromey
2025-09-09  0:52       ` Simon Marchi
2025-09-09  2:33         ` Eli Zaretskii
2025-09-09 23:25           ` Tom Tromey
2025-09-07 19:29 ` [PATCH 2/7] Move compute_include_file_name earlier Tom Tromey
2025-09-08 16:08   ` Simon Marchi
2025-09-09  0:46     ` Tom Tromey
2025-09-07 19:29 ` [PATCH 3/7] Boolify line-program.c Tom Tromey
2025-09-08 17:07   ` Simon Marchi
2025-09-09  0:48     ` Tom Tromey
2025-09-09  0:50       ` Simon Marchi
2025-09-09  1:11         ` Tom Tromey
2025-09-09 23:55           ` Tom Tromey
2025-09-10  1:51             ` Simon Marchi
2025-09-07 19:29 ` [PATCH 4/7] Change dwarf_record_line_p to be a method Tom Tromey
2025-09-07 19:29 ` [PATCH 5/7] Add m_builder member to lnp_state_machine Tom Tromey
2025-09-08 17:12   ` Simon Marchi
2025-09-07 19:29 ` [PATCH 6/7] Change dwarf_finish_line to be a method Tom Tromey
2025-09-08 17:14   ` Simon Marchi
2025-09-07 19:29 ` [PATCH 7/7] Change dwarf_record_line_1 " Tom Tromey
2025-09-08 17:17   ` Simon Marchi
2025-09-08 17:18 ` [PATCH 0/7] Shrink dwarf2/read.c and clean up lnp_state_machine Simon Marchi
2025-09-09  0:54   ` 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=3fccac07-1e35-48be-a028-94140c019abb@simark.ca \
    --to=simark@simark.ca \
    --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