diff mbox

show_token: handle TOKEN_UNTAINT and TOKEN_ARG_COUNT types

Message ID 87tz0ek0is.fsf@faui44a.informatik.uni-erlangen.de (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Reinhard Tartler April 30, 2009, 9:08 p.m. UTC
These cases are probably never hit with "regular" codepaths, but are
useful when called in a gdb session to print token sequences.

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
---
 tokenize.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

Comments

Chris Li Aug. 11, 2009, 8:39 p.m. UTC | #1
On Thu, Apr 30, 2009 at 2:08 PM, Reinhard Tartler<siretart@tauware.de> wrote:
>
> These cases are probably never hit with "regular" codepaths, but are
> useful when called in a gdb session to print token sequences.
>
> Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Thanks, applied.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/tokenize.c b/tokenize.c
index 6b67b96..93dd007 100644
--- a/tokenize.c
+++ b/tokenize.c
@@ -162,9 +162,18 @@  const char *show_token(const struct token *token)
 	case TOKEN_STREAMEND:
 		sprintf(buffer, "<end of '%s'>", stream_name(token->pos.stream));
 		return buffer;
-	
+
+	case TOKEN_UNTAINT:
+		sprintf(buffer, "<untaint>");
+		return buffer;
+
+	case TOKEN_ARG_COUNT:
+		sprintf(buffer, "<argcnt>");
+		return buffer;
+
 	default:
-		return "WTF???";
+		sprintf(buffer, "unhandled token type '%d' ", token_type(token));
+		return buffer;
 	}
 }