From: Pedro Alves <pedro@palves.net>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/2] nat/amd64-linux-siginfo.c: Remove typedefs
Date: Sat, 5 Jun 2021 01:14:27 +0100 [thread overview]
Message-ID: <20210605001427.3597687-3-pedro@palves.net> (raw)
In-Reply-To: <20210605001427.3597687-1-pedro@palves.net>
Since GDB is written in C++ now, we don't need struct/union typedefs
any more. Remove them from nat/amd64-linux-siginfo.c.
gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <pedro@palves.net>
* nat/amd64-linux-siginfo.c (union nat_sigval): Rename to ...
(nat_sigval_t): ... this and remove typedef of same name.
(struct nat_siginfo): Rename to ...
(nat_siginfo_t): ... this and remove typedef of same name.
(struct compat_sigval): Rename to ...
(compat_sigval_t): ... this and remove typedef of same name.
(struct compat_siginfo): Rename to ...
(compat_siginfo_t): ... this and remove typedef of same name.
(struct compat_x32_siginfo): Rename to ...
(compat_x32_siginfo_t): ... this and remove typedef of same name.
(amd64_linux_siginfo_fixup_common): Adjust.
---
gdb/nat/amd64-linux-siginfo.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/gdb/nat/amd64-linux-siginfo.c b/gdb/nat/amd64-linux-siginfo.c
index 9ff9361487a..342840e5085 100644
--- a/gdb/nat/amd64-linux-siginfo.c
+++ b/gdb/nat/amd64-linux-siginfo.c
@@ -45,13 +45,13 @@ typedef int nat_timer_t;
/* For native 64-bit, clock_t in _sigchld is 64-bit. */
typedef long nat_clock_t;
-typedef union nat_sigval
+union nat_sigval_t
{
nat_int_t sival_int;
nat_uptr_t sival_ptr;
-} nat_sigval_t;
+};
-typedef struct nat_siginfo
+struct nat_siginfo_t
{
int si_signo;
int si_errno;
@@ -112,7 +112,7 @@ typedef struct nat_siginfo
int _fd;
} _sigpoll;
} _sifields;
-} nat_siginfo_t;
+};
#endif /* __ILP32__ */
@@ -133,13 +133,13 @@ struct compat_timeval
int tv_usec;
};
-typedef union compat_sigval
+union compat_sigval_t
{
compat_int_t sival_int;
compat_uptr_t sival_ptr;
-} compat_sigval_t;
+};
-typedef struct compat_siginfo
+struct compat_siginfo_t
{
int si_signo;
int si_errno;
@@ -201,12 +201,12 @@ typedef struct compat_siginfo
int _fd;
} _sigpoll;
} _sifields;
-} compat_siginfo_t;
+};
/* For x32, clock_t in _sigchld is 64bit aligned at 4 bytes. */
typedef long __attribute__ ((__aligned__ (4))) compat_x32_clock_t;
-typedef struct __attribute__ ((__aligned__ (8))) compat_x32_siginfo
+struct __attribute__ ((__aligned__ (8))) compat_x32_siginfo_t
{
int si_signo;
int si_errno;
@@ -263,7 +263,7 @@ typedef struct __attribute__ ((__aligned__ (8))) compat_x32_siginfo
int _fd;
} _sigpoll;
} _sifields;
-} compat_x32_siginfo_t;
+};
/* To simplify usage of siginfo fields. */
@@ -578,20 +578,20 @@ amd64_linux_siginfo_fixup_common (siginfo_t *ptrace, gdb_byte *inf,
if (mode == FIXUP_32)
{
if (direction == 0)
- compat_siginfo_from_siginfo ((struct compat_siginfo *) inf, ptrace);
+ compat_siginfo_from_siginfo ((compat_siginfo_t *) inf, ptrace);
else
- siginfo_from_compat_siginfo (ptrace, (struct compat_siginfo *) inf);
+ siginfo_from_compat_siginfo (ptrace, (compat_siginfo_t *) inf);
return 1;
}
else if (mode == FIXUP_X32)
{
if (direction == 0)
- compat_x32_siginfo_from_siginfo ((struct compat_x32_siginfo *) inf,
+ compat_x32_siginfo_from_siginfo ((compat_x32_siginfo_t *) inf,
ptrace);
else
siginfo_from_compat_x32_siginfo (ptrace,
- (struct compat_x32_siginfo *) inf);
+ (compat_x32_siginfo_t *) inf);
return 1;
}
--
2.26.2
next prev parent reply other threads:[~2021-06-05 0:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-05 0:14 [PATCH 0/2] Fix alignment issue flagged by Clang in nat/amd64-linux-siginfo.c Pedro Alves
2021-06-05 0:14 ` [PATCH 1/2] nat/amd64-linux-siginfo.c: Move align attribute from typedef to struct Pedro Alves
2021-06-05 21:20 ` John Baldwin
2021-06-07 22:20 ` Pedro Alves
2021-06-07 22:42 ` John Baldwin
2021-06-05 0:14 ` Pedro Alves [this message]
2021-06-06 14:41 ` [PATCH 0/2] Fix alignment issue flagged by Clang in nat/amd64-linux-siginfo.c Simon Marchi
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=20210605001427.3597687-3-pedro@palves.net \
--to=pedro@palves.net \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).