mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 15:45:08 +00:00
--debug disables libclang crash recovery
This commit is contained in:
parent
db1f707027
commit
403c892838
@ -2017,6 +2017,10 @@ optional<std::vector<std::unique_ptr<IndexFile>>> ParseWithTu(
|
||||
|
||||
CXIndexAction index_action = clang_IndexAction_create(index->cx_index);
|
||||
|
||||
// NOTE: libclang re-enables crash recovery whenever a new index is created.
|
||||
if (g_debug)
|
||||
clang_toggleCrashRecovery(0);
|
||||
|
||||
// |index_result| is a CXErrorCode instance.
|
||||
int index_result = clang_indexTranslationUnit(
|
||||
index_action, ¶m, &callback, sizeof(IndexerCallbacks),
|
||||
@ -2133,6 +2137,7 @@ void ClangSanityCheck() {
|
||||
const unsigned kIndexOpts = 0;
|
||||
CXIndexAction index_action = clang_IndexAction_create(index);
|
||||
int index_param = 0;
|
||||
clang_toggleCrashRecovery(0);
|
||||
clang_indexTranslationUnit(index_action, &index_param, &callback,
|
||||
sizeof(IndexerCallbacks), kIndexOpts, tu);
|
||||
clang_IndexAction_dispose(index_action);
|
||||
|
@ -108,6 +108,10 @@ TEST_SUITE("FindIncludeLine") {
|
||||
}
|
||||
|
||||
optional<char> ReadCharFromStdinBlocking() {
|
||||
// We do not use std::cin because it does not read bytes once stuck in
|
||||
// cin.bad(). We can call cin.clear() but C++ iostream has other annoyance like
|
||||
// std::{cin,cout} is tied by default, which causes undesired cout flush for
|
||||
// cin operations.
|
||||
int c = getchar();
|
||||
if (c >= 0)
|
||||
return c;
|
||||
|
Loading…
Reference in New Issue
Block a user