From: "Jan Pokorný" <pokorny_jan@seznam.cz>
To: sparse@chrisli.org
Cc: linux-sparse@vger.kernel.org
Subject: [PATCH 4/4] more transparent dealing with tokens/position
Date: Tue, 12 Apr 2011 13:23:59 +0200 [thread overview]
Message-ID: <4DA4364F.9080402@seznam.cz> (raw)
In-Reply-To: <4DA435D8.5000900@seznam.cz>
Unify usage of `token_type' and `eof_token' also with gdbhelpers.
When 3/4 is applied, no need to do explicit cast to `enum token_type'.
Tested to work as it used to*).
*) testing commands sequence:
$ gdb --args ./sparse compat/mmap-blob.c
(gdb) source gdbhelpers
(gdb) b lib.c:882
(gdb) r
(gdb) gdb_show_tokens token
Signed-off-by: Jan Pokorny <pokorny_jan@seznam.cz>
---
gdbhelpers | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/gdbhelpers b/gdbhelpers
index 8634786..9a3630d 100644
--- a/gdbhelpers
+++ b/gdbhelpers
@@ -259,7 +259,7 @@ end
define gdb_show_token
printf "%p: '%s', type = ", $arg0, show_token($arg0)
- output (enum token_type) ($arg0)->pos.type
+ output token_type($arg0)
printf "\n"
if (! $showing_token)
@@ -268,18 +268,18 @@ define gdb_show_token
set $token = $arg0
- if ($token->pos.type == TOKEN_IDENT)
+ if (token_type($token) == TOKEN_IDENT)
gdb_tabs
printf "ident = "
gdb_show_ident $token.ident
end
- if ($token->pos.type == TOKEN_MACRO_ARGUMENT)
+ if (token_type($token) == TOKEN_MACRO_ARGUMENT)
gdb_tabs
printf "argnum = %d\n", $token->argnum
end
- if ($token->pos.type == TOKEN_SPECIAL)
+ if (token_type($token) == TOKEN_SPECIAL)
gdb_tabs
printf "special = \"%s\"\n", show_special($token.special)
end
@@ -294,7 +294,7 @@ define gdb_show_tokens
set $t = $arg0
printf "{\n"
set $ntabs++
- while ($t != &eof_token_entry)
+ while (!eof_token($t))
gdb_tabs
printf "token = "
gdb_show_token($t)
--
1.7.1
next prev parent reply other threads:[~2011-04-12 11:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-12 11:01 [PATCH 1/4] more transparent dealing with tokens/position Jan Pokorný
2011-04-12 11:19 ` [PATCH 2/4] " Jan Pokorný
2011-04-12 11:22 ` [PATCH 3/4] " Jan Pokorný
2011-04-12 11:23 ` Jan Pokorný [this message]
2011-04-12 11:25 ` [PATCH 2/4] " Jan Pokorný
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=4DA4364F.9080402@seznam.cz \
--to=pokorny_jan@seznam.cz \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.