[Lldb-commits] [PATCH] D144224: [lldb] Extend SWIG SBProcess interface with WriteMemoryAsCString method

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 20 07:46:36 PST 2023


labath added inline comments.


================
Comment at: lldb/bindings/interface/SBProcessExtensions.i:11
+            '''
+            if not str[-1] == '\0':
+                str += '\0'
----------------
I think this will fail if the string is empty (`""`). 

Somewhat relatedly, what if this appended the nul byte unconditionally (so it kinda behaved like std::string, which is always nul-terminated, but the nul byte is not counted as the length of the string)?


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

https://reviews.llvm.org/D144224



More information about the lldb-commits mailing list