diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2023-04-28 13:36:00 -0700 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2023-04-28 18:12:41 -0700 |
commit | 13dbc16b4d82b9adc98c0919873b2b59ccc46afd (patch) | |
tree | 3550c36699c6567741693520e3c0112f2bd8751b /lldb/include | |
parent | bfb5a4fd53fa00d450a0434f20e2193fff196ae6 (diff) | |
download | llvm-13dbc16b4d82b9adc98c0919873b2b59ccc46afd.tar.gz |
[lldb] Refactor host::OpenFileInExternalEditor
This patch refactors the macOS implementation of
OpenFileInExternalEditor. It fixes an AppleEvent memory leak, the
caching of LLDB_EXTERNAL_EDITOR and speculatively fixes a crash when
CFURL is NULL (rdar://108633464). The new code also improves error
handling, readability and documents calls to the CoreFoundation Launch
Services APIs.
A bunch of the Launch Services APIs have been deprecated
(LSFindApplicationForInfo, LSOpenURLsWithRole). The preferred API is
LSOpenCFURLRef but it doesn't specifying the "location" Apple Event
which is used to highlight the current line and switching over would
regress the existing behavior.
rdar://108633464
Differential revision: https://reviews.llvm.org/D149482
Diffstat (limited to 'lldb/include')
-rw-r--r-- | lldb/include/lldb/Host/Host.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/include/lldb/Host/Host.h b/lldb/include/lldb/Host/Host.h index 4fc2bd128b02..3fdf59dfb232 100644 --- a/lldb/include/lldb/Host/Host.h +++ b/lldb/include/lldb/Host/Host.h @@ -236,8 +236,8 @@ public: bool run_in_shell = true, bool hide_stderr = false); - static bool OpenFileInExternalEditor(const FileSpec &file_spec, - uint32_t line_no); + static llvm::Error OpenFileInExternalEditor(const FileSpec &file_spec, + uint32_t line_no); /// Check if we're running in an interactive graphical session. /// |