================ @@ -0,0 +1,87 @@ +""" +Defines a command, fdis, that does filtered disassembly. The command does the +lldb disassemble command with -b and any other arguments passed in, and +pipes that through a provided filter program. + +The intention is to support disassembly of RISC-V proprietary instructions. +This is handled with llvm-objdump by piping the output of llvm-objdump through +a filter program. This script is intended to mimic that workflow. +""" + +import lldb +import subprocess + +filter_program = "crustfilt" + +def __lldb_init_module(debugger, dict): + debugger.HandleCommand( + 'command script add -f filter_disasm.fdis fdis') + print("Disassembly filter command (fdis) loaded") + print("Filter program set to %s" % filter_program) + + +def fdis(debugger, args, result, dict): ---------------- DavidSpickett wrote:
Oh that's cool. What I was thinking of means you don't have to format the usage though, it's generated by lldb. I'll have a look for it tomorrow. https://github.com/llvm/llvm-project/pull/145793 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits