A는 Xcode에 사용자 정의 LLDB 유형 요약을 추가하는 방법에 대해 잠시 후 a question을 게시했습니다. 나는 파이썬 스크립트를 로딩함으로써 그렇게 할 수 있다는 것을 알았다.여러 lldb 유형 요약 파일을 어떻게로드합니까?
그러나 여러 파이썬 파일을로드 할 수있는 방법이 있는지 알고 싶습니다. 여러 프로젝트에서 작업하므로 모든 프로젝트에서 사용되는 일반적인 유형에 대한 요약 파일 1 개와 프로젝트 별 유형에 대한 요약 파일 1 개가 있어야합니다.
~/MyGenericSummaries.py
import lldb
def __lldb_init_module(debugger, dictionary):
debugger.HandleCommand('type summary add --summary-string "these are words" MyGenericClass');
~/MyProjectSummaries.py
import lldb
def __lldb_init_module(debugger, dictionary):
debugger.HandleCommand('type summary add --summary-string "these are more words" MyProjectClass');
는 ~/.lldbinit
command script import ~/MyGenericSummaries.py
command script import ~/MyProjectSummaries.py
이 MyProjectSummaries.py의 유형 요약을로드하지 - LLDB은
error: module importing failed: module already imported
는 일반적인 요약 및 프로젝트 요약을 유지하는 것이 가능 하더군요 개별 파일에? 다른 프로젝트 사이에서 충돌하는 일부 형식 이름이 있기 때문에 이것은 실제로 도움이 될 것입니다. 그래서 이것을 분리하려고합니다.
~/MyGenericSummaries.py
import lldb
def doLoad(debugger, dictionary):
debugger.HandleCommand('type summary add --summary-string "these are words" MyGenericClass');
def __lldb_init_module(debugger, dictionary):
doLoad(debugger, dictionary);
:
많은 감사합니다 :)
은 'Handle Command'에 들어가는 것에 대한 더 이상의 문서를 발견했습니다. – carbonr