https://github.com/labath commented:

This idea has bothered me from the beginning, but I didn't want to say 
anything, as it was mostly just a feeling. After seeing this patch, I think I 
can put some words behind it.

The thing I don't like about this patch is the repetition/redundancy it 
creates. Like, you first create the CommandReturnObject, give it the command 
it's hold the result of. Then, you pass that object into HandleCommand, but 
that's not all you give it -- the function takes the string of the command, 
again.

It's not the end of the world, but I think it's unfortunate, and while it works 
nice for your current use case, I don't think it makes that much sense for 
other usages. For example, if the `CommandReturnObject` had always contained 
the command part, would the signature of a python command still be `def 
cmd(debugger, command, result, dict):`, or would we have expected the command 
to retrieve it from the result object?

It's hard to say, but what I think we can say is that if you make your current 
callback take the "command" and the "result of that command" as two separate 
arguments, then it will at least be consistent with the signature above.

https://github.com/llvm/llvm-project/pull/125132
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to