Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 3/7] Boolify line-program.c
Date: Sun, 07 Sep 2025 13:29:15 -0600	[thread overview]
Message-ID: <20250907-breakpoint-cu-expand-v1-3-dd2beef9d475@tromey.com> (raw)
In-Reply-To: <20250907-breakpoint-cu-expand-v1-0-dd2beef9d475@tromey.com>

This changes some code in line-program.c to use bool rather than int.
---
 gdb/dwarf2/line-program.c | 12 ++++++------
 gdb/dwarf2/line-program.h |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/gdb/dwarf2/line-program.c b/gdb/dwarf2/line-program.c
index 72bdd1f5a748ce228114105597b1e5a162254f69..5292d3d5e86722bc6d60b049740982c06550ef76 100644
--- a/gdb/dwarf2/line-program.c
+++ b/gdb/dwarf2/line-program.c
@@ -291,22 +291,22 @@ lnp_state_machine::handle_const_add_pc ()
    Note: Addresses in the line number state machine can never go backwards
    within one sequence, thus this coalescing is ok.  */
 
-static int
+static bool
 dwarf_record_line_p (struct dwarf2_cu *cu,
 		     unsigned int line, unsigned int last_line,
 		     int line_has_non_zero_discriminator,
 		     struct subfile *last_subfile)
 {
   if (cu->get_builder ()->get_current_subfile () != last_subfile)
-    return 1;
+    return true;
   if (line != last_line)
-    return 1;
+    return true;
   /* Same line for the same file that we've seen already.
      As a last check, for pr 17276, only record the line if the line
      has never had a non-zero discriminator.  */
   if (!line_has_non_zero_discriminator)
-    return 1;
-  return 0;
+    return true;
+  return false;
 }
 
 /* Use the CU's builder to record line number LINE beginning at
@@ -706,7 +706,7 @@ dwarf_decode_lines_1 (struct line_header *lh, struct dwarf2_cu *cu,
 
 void
 dwarf_decode_lines (struct line_header *lh, struct dwarf2_cu *cu,
-		    unrelocated_addr lowpc, int decode_mapping)
+		    unrelocated_addr lowpc, bool decode_mapping)
 {
   if (decode_mapping)
     dwarf_decode_lines_1 (lh, cu, lowpc);
diff --git a/gdb/dwarf2/line-program.h b/gdb/dwarf2/line-program.h
index c84403253e635225d7c27d49a91dd1581fa0fa2e..824f18f9613c55a714d1889666ad25045ba1dba8 100644
--- a/gdb/dwarf2/line-program.h
+++ b/gdb/dwarf2/line-program.h
@@ -42,6 +42,6 @@
 
 extern void dwarf_decode_lines (struct line_header *lh,
 				struct dwarf2_cu *cu,
-				unrelocated_addr lowpc, int decode_mapping);
+				unrelocated_addr lowpc, bool decode_mapping);
 
 #endif /* GDB_DWARF2_LINE_PROGRAM_H */

-- 
2.49.0


  parent reply	other threads:[~2025-09-07 19:31 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
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 ` Tom Tromey [this message]
2025-09-08 17:07   ` [PATCH 3/7] Boolify line-program.c 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=20250907-breakpoint-cu-expand-v1-3-dd2beef9d475@tromey.com \
    --to=tom@tromey.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