From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Cc: Aleksandar Ristovski <ARistovski@qnx.com>
Subject: [PATCH v7 03/10] Code cleanup: Rename enum -> enum filterflags
Date: Sun, 14 Jun 2015 19:26:00 -0000 [thread overview]
Message-ID: <20150614192606.18346.1038.stgit@host1.jankratochvil.net> (raw)
In-Reply-To: <20150614192542.18346.87859.stgit@host1.jankratochvil.net>
Hi Sergio,
this is an unrelated cleanup, bit mask ints are better to make enums as GDB
already has support to automatically decode them:
before this patch:
(gdb) p filterflags
$1 = 51
(gdb) p/x filterflags
$2 = 0x33
after this patch:
(gdb) p filterflags
$1 = (COREFILTER_ANON_PRIVATE | COREFILTER_ANON_SHARED | COREFILTER_ELF_HEADERS | COREFILTER_HUGETLB_PRIVATE)
New patch, not yet reviewed before.
Jan
gdb/ChangeLog
2015-06-07 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-tdep.c (enum filterflags): Make it from anonymous enum.
(dump_mapping_p): Use it for parameter filterflags.
(linux_find_memory_regions_full): Use it for variable filterflags.
---
gdb/linux-tdep.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index f0cdc9c..c81f71b 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -46,7 +46,7 @@
Documentation/filesystems/proc.txt, inside the Linux kernel
tree. */
-enum
+enum filterflags
{
COREFILTER_ANON_PRIVATE = 1 << 0,
COREFILTER_ANON_SHARED = 1 << 1,
@@ -598,7 +598,7 @@ mapping_is_anonymous_p (const char *filename)
This should work OK enough, however. */
static int
-dump_mapping_p (unsigned int filterflags, const struct smaps_vmflags *v,
+dump_mapping_p (enum filterflags filterflags, const struct smaps_vmflags *v,
int maybe_private_p, int mapping_anon_p, int mapping_file_p,
const char *filename)
{
@@ -1119,10 +1119,10 @@ linux_find_memory_regions_full (struct gdbarch *gdbarch,
/* Default dump behavior of coredump_filter (0x33), according to
Documentation/filesystems/proc.txt from the Linux kernel
tree. */
- unsigned int filterflags = (COREFILTER_ANON_PRIVATE
- | COREFILTER_ANON_SHARED
- | COREFILTER_ELF_HEADERS
- | COREFILTER_HUGETLB_PRIVATE);
+ enum filterflags filterflags = (COREFILTER_ANON_PRIVATE
+ | COREFILTER_ANON_SHARED
+ | COREFILTER_ELF_HEADERS
+ | COREFILTER_HUGETLB_PRIVATE);
/* We need to know the real target PID to access /proc. */
if (current_inferior ()->fake_pid_p)
next prev parent reply other threads:[~2015-06-14 19:26 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-14 19:25 [PATCH v7 00/10] Validate binary before use Jan Kratochvil
2015-06-14 19:25 ` [PATCH v7 01/10] Move utility functions to common/ Jan Kratochvil
2015-06-15 13:22 ` Joel Brobecker
2015-06-15 15:07 ` [commit] " Jan Kratochvil
2015-06-14 19:26 ` [PATCH v7 06/10] Prepare linux_find_memory_regions_full & co. for move Jan Kratochvil
2015-06-14 19:26 ` [PATCH v7 02/10] Merge multiple hex conversions Jan Kratochvil
2015-06-15 13:33 ` Joel Brobecker
2015-06-15 15:09 ` [commit] " Jan Kratochvil
2015-06-14 19:26 ` [PATCH v7 04/10] Create empty nat/linux-maps.[ch] and common/target-utils.[ch] Jan Kratochvil
2015-06-14 19:26 ` [PATCH v7 07/10] Move linux_find_memory_regions_full & co Jan Kratochvil
2015-06-14 19:26 ` Jan Kratochvil [this message]
2015-06-15 13:34 ` [PATCH v7 03/10] Code cleanup: Rename enum -> enum filterflags Joel Brobecker
2015-06-15 15:12 ` [commit] " Jan Kratochvil
2015-07-08 14:38 ` Pedro Alves
2015-06-14 19:26 ` [PATCH v7 05/10] Move gdb_regex* to common/ Jan Kratochvil
2015-07-08 14:39 ` Pedro Alves
2015-07-14 20:13 ` Jan Kratochvil
2015-06-14 19:27 ` [PATCH v7 08/10] gdbserver build-id attribute generator Jan Kratochvil
2015-07-08 14:41 ` Pedro Alves
2015-06-14 19:27 ` [PATCH v7 10/10] Tests for validate symbol file using build-id Jan Kratochvil
2015-07-08 14:44 ` Pedro Alves
2015-06-14 19:27 ` [PATCH v7 09/10] Validate " Jan Kratochvil
2015-06-21 10:16 ` [PATCH v8 " Jan Kratochvil
2015-06-22 12:55 ` Aleksandar Ristovski
2015-06-22 20:37 ` Jan Kratochvil
2015-06-22 20:41 ` Aleksandar Ristovski
2015-06-22 22:25 ` Doug Evans
2015-06-23 20:47 ` Jan Kratochvil
2015-07-08 14:44 ` Pedro Alves
2015-07-12 19:09 ` Jan Kratochvil
2015-07-12 19:29 ` [PATCH v9 " Jan Kratochvil
2015-07-12 19:54 ` Eli Zaretskii
2015-07-12 20:01 ` Jan Kratochvil
2015-07-13 2:30 ` Eli Zaretskii
2015-07-13 10:34 ` Pedro Alves
2015-07-13 12:38 ` Jan Kratochvil
2015-07-14 16:14 ` Doug Evans
2015-07-15 8:21 ` Jan Kratochvil
2015-07-15 14:59 ` Doug Evans
2015-06-27 21:05 ` [PATCH v8 " Jan Kratochvil
2015-07-08 15:40 ` Doug Evans
2015-07-12 19:27 ` Jan Kratochvil
2015-07-15 16:36 ` [commit] [PATCH v7 00/10] Validate binary before use Jan Kratochvil
2015-07-15 18:33 ` [revert] " Jan Kratochvil
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=20150614192606.18346.1038.stgit@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=ARistovski@qnx.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).