From: Zack Rusin Date: Tue, 15 Dec 2009 14:26:51 +0000 (-0500) Subject: tgsi: make the tgsi assembly parser report line/column on error X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5aac920e4968d5be37ec2dbecb18838e66ca2c95;p=mesa.git tgsi: make the tgsi assembly parser report line/column on error --- 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.