[all-commits] [llvm/llvm-project] 13dbc1: [lldb] Refactor host::OpenFileInExternalEditor

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Fri Apr 28 18:13:10 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 13dbc16b4d82b9adc98c0919873b2b59ccc46afd
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2023-04-28 (Fri, 28 Apr 2023)

  Changed paths:
    M lldb/include/lldb/Host/Host.h
    M lldb/source/Host/common/Host.cpp
    M lldb/source/Host/macosx/objcxx/Host.mm
    M lldb/source/Interpreter/CommandInterpreter.cpp
    M lldb/source/Target/Thread.cpp

  Log Message:
  [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.


Differential revision: https://reviews.llvm.org/D149482

More information about the All-commits mailing list