[3/4] radeonsi: fix line splitting in si_shader_dump_assembly

Submitted by Nicolai Hähnle on May 13, 2019, 9:14 p.m.

Details

Message ID 20190513211441.18108-3-nhaehnle@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Nicolai Hähnle May 13, 2019, 9:14 p.m.
From: Nicolai Hähnle <nicolai.haehnle@amd.com>

Compute the count since the start of the current line instead of the
count since the start of the the disassembly.
---
 src/gallium/drivers/radeonsi/si_shader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 835eedd89e6..2186938fec9 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -5176,21 +5176,21 @@  static void si_shader_dump_disassembly(struct si_screen *screen,
 		 * parsing of resulting logs.
 		 */
 		pipe_debug_message(debug, SHADER_INFO,
 				   "Shader Disassembly Begin");
 
 		uint64_t line = 0;
 		while (line < nbytes) {
 			int count = nbytes - line;
 			const char *nl = memchr(disasm + line, '\n', nbytes - line);
 			if (nl)
-				count = nl - disasm;
+				count = nl - (disasm + line);
 
 			if (count) {
 				pipe_debug_message(debug, SHADER_INFO,
 						   "%.*s", count, disasm + line);
 			}
 
 			line += count + 1;
 		}
 
 		pipe_debug_message(debug, SHADER_INFO,