radv: ignore BB labels when splitting the disassembly string
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 19 Aug 2020 11:42:57 +0000 (13:42 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 21 Aug 2020 08:34:22 +0000 (10:34 +0200)
Ignore everything that is not an instruction. This should fix
the annotated UMR disassembly.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6387>

src/amd/vulkan/radv_debug.c

index e86b0079df7803f68da9fcef59625a1341c5c973..47d70b96499b90f31393f9ac4a1647494395dff2 100644 (file)
@@ -273,6 +273,12 @@ static void si_add_split_disasm(const char *disasm,
                struct radv_shader_inst *inst = &instructions[*num];
                unsigned len = next - disasm;
 
                struct radv_shader_inst *inst = &instructions[*num];
                unsigned len = next - disasm;
 
+               if (!memchr(disasm, ';', len)) {
+                       /* Ignore everything that is not an instruction. */
+                       disasm = next + 1;
+                       continue;
+               }
+
                assert(len < ARRAY_SIZE(inst->text));
                memcpy(inst->text, disasm, len);
                inst->text[len] = 0;
                assert(len < ARRAY_SIZE(inst->text));
                memcpy(inst->text, disasm, len);
                inst->text[len] = 0;