From 5aac920e4968d5be37ec2dbecb18838e66ca2c95 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Tue, 15 Dec 2009 09:26:51 -0500 Subject: [PATCH] tgsi: make the tgsi assembly parser report line/column on error --- src/gallium/auxiliary/tgsi/tgsi_text.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c index 84e863b2375..9673686ace6 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_text.c +++ b/src/gallium/auxiliary/tgsi/tgsi_text.c @@ -197,7 +197,20 @@ struct translate_ctx static void report_error( struct translate_ctx *ctx, const char *msg ) { - debug_printf( "\nError: %s", msg ); + int line = 1; + int column = 1; + const char *itr = ctx->text; + + while (itr != ctx->cur) { + if (*itr == '\n') { + column = 1; + ++line; + } + ++column; + ++itr; + } + + debug_printf( "\nTGSI asm error: %s [%d : %d] \n", msg, line, column ); } /* Parse shader header. -- 2.30.2