================
@@ -157,7 +157,9 @@ static lldb::offset_t DumpInstructions(const DataExtractor 
&DE, Stream *s,
         exe_scope->CalculateExecutionContext(exe_ctx);
         disassembler_sp->GetInstructionList().Dump(
             s, show_address, show_bytes, show_control_flow_kind, &exe_ctx);
-      }
+      } else if (number_of_instructions)
+        s->Printf("warning: failed to decode instructions at 0x%" PRIx64 ".",
+                  addr);
----------------
JDevlieghere wrote:

Is there precedent for writing errors or warnings to this stream? Depending on 
how this method is used, this might be fine or it might result in something 
weird like `instruction = warnings: failed ...`. The print below just says 
"invalid target". Following that pattern also sidesteps the question of whether 
this is a warning or an error. 

FWIW, even if we always dump the stream to the `CommandReturnObject`, it may 
still be nice to separate this out so we can write it to the dedicated error or 
warning stream (so it gets prefixed correctly with color). But that's a bigger 
change than what you're doing here.

https://github.com/llvm/llvm-project/pull/164413
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to