From 2e6a0a8b81d7be948491ce39d241695dc1385429 Mon Sep 17 00:00:00 2001 From: Walter Erquinigo Date: Thu, 24 Jun 2021 13:35:11 -0700 Subject: [PATCH] [lldb] Load the fblldb module automatically Summary: ``` // Facebook only: // We want to load automatically the fblldb python module as soon as lldb or // lldb-vscode start. This will ensure that logging and formatters are enabled // by default. // // As we want to have a mechanism for not triggering this by default, if the // user is starting lldb disabling .lldbinit support, then we also don't load // this module. This is equivalent to appending this line to all .lldbinit // files. // // We don't have the fblldb module on windows, so we don't include it for that // build. ``` Test Plan: the fbsymbols module is loaded automatically ``` ./bin/lldb (lldb) help fbsymbols Facebook {mini,core}dump utility. Expects 'raw' input (see 'help raw-input'.) ``` Reviewers: wanyi Reviewed By: wanyi Subscribers: mnovakovic, serhiyr, phabricatorlinter Differential Revision: https://phabricator.intern.facebook.com/D29372804 Tags: accept2ship Signature: 29372804:1624567770:07836e50e576bd809124ed80a6bc01082190e48f [lldb] Load fblldbinit instead of fblldb Summary: Once accepted, it'll merge it with the existing commit in our branch so that we keep the commit list as short as possible. Test Plan: https://www.internalfb.com/diff/D30293094 Reviewers: aadsm, wanyi Reviewed By: aadsm Subscribers: mnovakovic, serhiyr Differential Revision: https://phabricator.intern.facebook.com/D30293211 Tags: accept2ship Signature: 30293211:1628880953:423e2e543cade107df69da0ebf458e581e54ae3a --- lldb/source/Interpreter/CommandInterpreter.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 301bf949feef4..1df74f9656357 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -2352,6 +2352,20 @@ void CommandInterpreter::SourceInitFileHome(CommandReturnObject &result, result.SetStatus(eReturnStatusSuccessFinishNoResult); return; } +#if !defined(_WIN32) + // Facebook only: + // + // The 'fblldbinit' module will set up the python support specific to FB. + // + // As we want to have a mechanism for not triggering this by default, if the + // user is starting lldb disabling .lldbinit support, then we also don't load + // this module. This is equivalent to preppending the following line to all + // .lldbinit files. + // + // We don't have the fblldbinit module on windows, so we don't include it for + // that build. + HandleCommand("script import fblldbinit", eLazyBoolNo, result); +#endif llvm::SmallString<128> init_file;