[Lldb-commits] [PATCH] D79646: [Reproducers] Serialize process arguments in ProcessInfo
Pavel Labath via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon May 11 03:10:57 PDT 2020
labath added inline comments.
================
Comment at: lldb/source/Utility/Args.cpp:691
+ std::string str;
+ Val.GetCommandString(str);
+ Out << str;
----------------
The `GetCommandString` -> `SetCommandString` roundtrip is very lossy (mainly because of the `Get` part). That may be enough for `platform process list`, but I don't think it's a good general representation. I think it would be better to represent this as a vector of `(string, quote_char)` pairs.
================
Comment at: lldb/test/Shell/Reproducer/TestProcessList.test:1-21
+# UNSUPPORTED: system-freebsd
+
+# Test that ProcessInfo is correctly serialized by comparing the output of
+# 'platform process list -v' during capture and replay. The test assumes that
+# there's at least two processes.
+
+# RUN: %lldb -x -b -o 'platform process list -v' -o 'reproducer generate' --capture --capture-path %t.repro > %t.log
----------------
This isn't too bad, though for a change like this, it may be enough to write a (c++) unit test for the ProcessInfo<->yaml conversion -- it's going to run everywhere, and you can make proper assertions about the expected output.
Repository:
rLLDB LLDB
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79646/new/
https://reviews.llvm.org/D79646
More information about the lldb-commits
mailing list