lldb_utilities icon indicating copy to clipboard operation
lldb_utilities copied to clipboard

Print to clipboard doesn't work. Crashed.

Open lolgear opened this issue 7 years ago • 3 comments

Trace:

(lldb) poc dictionary
Traceback (most recent call last):
  File "lldb_utilities/lldb_utilities.py", line 236, in call_proxy
    original_function(*args)
  File "lldb_utilities/lldb_utilities.py", line 90, in handle_debugger_command
    cmd.run()
  File "lldb_utilities/lldb_utilities.py", line 152, in run
    self.copy_object_expression_result_to_clipboard('[({}) description]'.format(self.command))
  File "lldb_utilities/lldb_utilities.py", line 71, in copy_object_expression_result_to_clipboard
    file_path = self.temporary_file_path(prefix='lldb-clipboard-', suffix='.dat')
  File "lldb_utilities/lldb_utilities.py", line 63, in temporary_file_path
    (handle, path) = tempfile.mkstemp(dir=self.temporary_directory(), prefix=prefix, suffix=suffix)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", line 308, in mkstemp
    return _mkstemp_inner(dir, prefix, suffix, flags)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", line 239, in _mkstemp_inner
    fd = _os.open(file, flags, 0600)
OSError: [Errno 2] No such file or directory: '/private/var/mobile/Containers/Data/Application/3A6978AA-0292-440D-AE0C-75BFE156624C/tmp/lldb-clipboard-HZg_OQ.dat'

lolgear avatar Jun 20 '17 10:06 lolgear

Hm I can't seem to reproduce this right now, when I do something like

poc [[[NSBundle mainBundle] bundleURL] path]

then it works, no crash. However, this command also is not very useful when running on another device because the clipboard will be inaccessible. It's really mostly for debugging processes running on the local Mac.

liyanage avatar Jun 20 '17 17:06 liyanage

I ran it on iPhone, yes, not on simulator.

lolgear avatar Jun 20 '17 17:06 lolgear

Thanks for the confirmation. When I try it on my iPhone, it does not crash, but it also does not do anything useful.

liyanage avatar Jun 20 '17 17:06 liyanage