[Mesa-dev] [PATCH] nir: Call fflush() at the end of nir_print_shader()

Matt Turner mattst88 at gmail.com
Tue Nov 27 08:08:08 UTC 2018


We normally call with stderr which is unbuffered, so this won't affect
that, but it does let me call nir_print_shader(nir, fopen("log", "w+"))
from gdb and actually get the whole shader in my file.
---
 src/compiler/nir/nir_print.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c
index 19f26f46405..1dcf043a799 100644
--- a/src/compiler/nir/nir_print.c
+++ b/src/compiler/nir/nir_print.c
@@ -1311,6 +1311,7 @@ void
 nir_print_shader(nir_shader *shader, FILE *fp)
 {
    nir_print_shader_annotated(shader, fp, NULL);
+   fflush(fp);
 }
 
 void
-- 
2.18.1



More information about the mesa-dev mailing list