Skip to content

Commit 4ab298b

Browse files
authored
[LLDB][ThreadELFCore] Set all the properties of ELFLinuxSigInfo to a non build dependent size (#117604)
On #110065 the changes to LinuxSigInfo Struct introduced some variables that will differ in size on 32b or 64b. I've rectified this by setting them all to build independent types.
1 parent 5a3299a commit 4ab298b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lldb/source/Plugins/Process/elf-core/ThreadElfCore.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ struct ELFLinuxSigInfo {
8383
int32_t si_errno;
8484
int32_t si_code;
8585
// Copied from siginfo_t so we don't have to include signal.h on non 'Nix
86-
// builds.
87-
struct {
88-
lldb::addr_t si_addr; /* faulting insn/memory ref. */
89-
short int si_addr_lsb; /* Valid LSB of the reported address. */
86+
// builds. Slight modifications to ensure no 32b vs 64b differences.
87+
struct alignas(8) {
88+
lldb::addr_t si_addr; /* faulting insn/memory ref. */
89+
int16_t si_addr_lsb; /* Valid LSB of the reported address. */
9090
union {
9191
/* used when si_code=SEGV_BNDERR */
9292
struct {
@@ -98,7 +98,8 @@ struct ELFLinuxSigInfo {
9898
} bounds;
9999
} sigfault;
100100

101-
enum { eUnspecified, eNT_SIGINFO } note_type;
101+
enum SigInfoNoteType : uint8_t { eUnspecified, eNT_SIGINFO };
102+
SigInfoNoteType note_type;
102103

103104
ELFLinuxSigInfo();
104105

0 commit comments

Comments
 (0)