[Lldb-commits] [PATCH] D129611: [lldb/crashlog] Add '-t|--target' option to interactive mode

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 3 11:43:10 PDT 2022


mib marked an inline comment as done.
mib added inline comments.


================
Comment at: lldb/examples/python/crashlog.py:1025
+        if not target:
+            result.PutCString("error: couldn't create target provided by the user ({option.target_path})")
+            return
----------------
JDevlieghere wrote:
> This is not an f-string so this will actually print `{option.target_path}` rather than the actual value. That said, we don't use those anywhere else, so let's use `.format()` to be consistent. 
`.format()` was too long compared to using an f-string :p that why I went with that ... I'll update it


================
Comment at: lldb/test/Shell/ScriptInterpreter/Python/Crashlog/scripted_crashlog_json.test:7
+# RUN: -o 'crashlog -a -i -t %t.dir/multithread-test %S/Inputs/interactive_crashlog/multithread-test.ips' \
 # RUN: -o "thread list" -o "bt all" 2>&1 | FileCheck %s
 
----------------
JDevlieghere wrote:
> Can we test some of the error cases here? Should be easy enough to provide a target that doesn't exist (and would've caught the f-string issue). 
I tried having a first `crashlog` command with an invalid target fail before the one that works but `lit` would just stop at the error. Instead, I test it in D129614. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129611/new/

https://reviews.llvm.org/D129611



More information about the lldb-commits mailing list