From: Andrew Burgess Date: Wed, 15 Apr 2026 09:42:03 +0000 (+0100) Subject: gdb: int to bool in struct entry_info X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb0801fe571a581ce2dbd8492ad7b1166d7ffcaa;p=thirdparty%2Fbinutils-gdb.git gdb: int to bool in struct entry_info Convert 'struct entry_info' to use bool for flag fields. The places where these flags are set are updated too. I have also removed the bit width specifier ": 1" from the flag field definitions. There is one entry_info struct per BFD in GDB, which is not a huge number, so forcing the bool fields to 1-bit doesn't seen necessary. There should be no user visible changes after this commit. Approved-By: Tom Tromey --- diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 76d6130f504..58c4ff81008 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; - /* Set to 1 iff this object was initialized. */ - unsigned initialized : 1; + /* Set to true iff this object was initialized. */ + bool initialized; }; #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)