From: Andrew Burgess <aburgess@redhat.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>
Subject: [PATCH 1/2] gdb: int to bool in struct entry_info
Date: Wed, 15 Apr 2026 21:25:56 +0100 [thread overview]
Message-ID: <7eb31f3cc02d146b7c16a1115dd4f5603d2eeb33.1776284661.git.aburgess@redhat.com> (raw)
In-Reply-To: <cover.1776284661.git.aburgess@redhat.com>
Convert 'struct entry_info' to use bool for flag fields. The places
where these flags are set are updated too.
There should be no user visible changes after this commit.
---
gdb/objfiles.h | 8 ++++----
gdb/symfile.c | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index 89ac559ce81..429d8c82681 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -115,11 +115,11 @@ struct entry_info
/* The index of the section in which the entry point appears. */
int the_bfd_section_index;
- /* Set to 1 iff ENTRY_POINT contains a valid value. */
- unsigned entry_point_p : 1;
+ /* Set to true iff ENTRY_POINT contains a valid value. */
+ bool entry_point_p : 1;
- /* Set to 1 iff this object was initialized. */
- unsigned initialized : 1;
+ /* Set to true iff this object was initialized. */
+ bool initialized : 1;
};
#define SECT_OFF_DATA(objfile) \
diff --git a/gdb/symfile.c b/gdb/symfile.c
index d0ea9506c63..d583960d430 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -776,7 +776,7 @@ init_entry_point_info (struct objfile *objfile)
if (ei->initialized)
return;
- ei->initialized = 1;
+ ei->initialized = true;
/* Save startup file's range of PC addresses to help blockframe.c
decide where the bottom of the stack is. */
@@ -786,7 +786,7 @@ init_entry_point_info (struct objfile *objfile)
/* Executable file -- record its entry point so we'll recognize
the startup file because it contains the entry point. */
ei->entry_point = bfd_get_start_address (objfile->obfd.get ());
- ei->entry_point_p = 1;
+ ei->entry_point_p = true;
}
else if (bfd_get_file_flags (objfile->obfd.get ()) & DYNAMIC
&& bfd_get_start_address (objfile->obfd.get ()) != 0)
@@ -795,12 +795,12 @@ init_entry_point_info (struct objfile *objfile)
runnable. There's no clear way to indicate this, so just check
for values other than zero. */
ei->entry_point = bfd_get_start_address (objfile->obfd.get ());
- ei->entry_point_p = 1;
+ ei->entry_point_p = true;
}
else
{
/* Examination of non-executable.o files. Short-circuit this stuff. */
- ei->entry_point_p = 0;
+ ei->entry_point_p = false;
}
if (ei->entry_point_p)
--
2.25.4
next prev parent reply other threads:[~2026-04-15 20:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-15 20:25 [PATCH 0/2] Internal error for shared library with no .text section Andrew Burgess
2026-04-15 20:25 ` Andrew Burgess [this message]
2026-04-15 20:25 ` [PATCH 2/2] gdb: don't use .text as default entry point section Andrew Burgess
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=7eb31f3cc02d146b7c16a1115dd4f5603d2eeb33.1776284661.git.aburgess@redhat.com \
--to=aburgess@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