llvm-project/lldb/source/Interpreter
Davide Italiano 24fff2429c [Command] Implement `statistics` command.
This allows us to collect useful metrics about lldb debugging sessions.

I thought that an example would be better than a thousand words:

  Process 19705 stopped
  * thread #1, queue = 'com.apple.main-thread', stop reason = step in
      frame #0: 0x0000000100000fb4 blah`main at blah.c:3
     1    int main(void) {
     2      int a = 6;
  -> 3      return 0;
     4    }
  (lldb) statistics enable
  (lldb) frame var a
  (int) a = 6
  (lldb) expr a
  (int) $1 = 6
  (lldb) statistics disable
  (lldb) statistics dump
  Number of expr evaluation successes : 1
  Number of expr evaluation failures : 0
  Number of frame var successes : 1
  Number of frame var failures : 0

Future improvements might include:

1. Passing a file, or implementing categories. The way this patch has
been implemented is generic enough to allow this to be extended
easily without breaking the grammar.
2. Adding an SBAPI and Python API for use in scripts.

Thanks to Jim Ingham for discussing the design with me.

<rdar://problem/36555975>

Differential Revision:  https://reviews.llvm.org/D45547

llvm-svn: 330043
2018-04-13 18:02:39 +00:00
..
Args.cpp Args: replace isprint8 usage with isprint 2018-04-10 10:07:22 +00:00
CMakeLists.txt Move Args::StringTo*** functions to a new OptionArgParser class 2018-04-10 09:03:59 +00:00
CommandAlias.cpp Move option parsing out of the Args class 2018-03-09 10:39:40 +00:00
CommandHistory.cpp Fix !N and !-N commands and add a test case. 2017-04-19 23:21:04 +00:00
CommandInterpreter.cpp [Command] Implement `statistics` command. 2018-04-13 18:02:39 +00:00
CommandObject.cpp Move option parsing out of the Args class 2018-03-09 10:39:40 +00:00
CommandObjectRegexCommand.cpp Make CommandObject help getters/setters use StringRef. 2016-11-12 20:41:02 +00:00
CommandObjectScript.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectScript.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandOptionValidators.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandReturnObject.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionArgParser.cpp Move Args::StringTo*** functions to a new OptionArgParser class 2018-04-10 09:03:59 +00:00
OptionGroupArchitecture.cpp Invert ArchSpec<->Platform dependency 2017-10-31 10:56:03 +00:00
OptionGroupBoolean.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionGroupFile.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionGroupFormat.cpp Move ArchSpec to the Utility module 2017-11-13 16:16:33 +00:00
OptionGroupOutputFile.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionGroupPlatform.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionGroupString.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionGroupUInt64.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionGroupUUID.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionGroupValueObjectDisplay.cpp Move Args::StringTo*** functions to a new OptionArgParser class 2018-04-10 09:03:59 +00:00
OptionGroupVariable.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionGroupWatchpoint.cpp Move Args::StringTo*** functions to a new OptionArgParser class 2018-04-10 09:03:59 +00:00
OptionValue.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionValueArch.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionValueArgs.cpp Rewrite all Property related functions in terms of StringRef. 2016-11-17 18:08:12 +00:00
OptionValueArray.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionValueBoolean.cpp Move Args::StringTo*** functions to a new OptionArgParser class 2018-04-10 09:03:59 +00:00
OptionValueChar.cpp Move Args::StringTo*** functions to a new OptionArgParser class 2018-04-10 09:03:59 +00:00
OptionValueDictionary.cpp [Interpreter] Remove unused variable usage. NFCI. 2017-11-01 23:46:21 +00:00
OptionValueEnumeration.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionValueFileSpec.cpp Make sure DataBufferLLVM contents are writable 2017-12-21 10:54:30 +00:00
OptionValueFileSpecLIst.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionValueFormat.cpp Move Args::StringTo*** functions to a new OptionArgParser class 2018-04-10 09:03:59 +00:00
OptionValueFormatEntity.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionValueLanguage.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionValuePathMappings.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionValueProperties.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionValueRegex.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionValueSInt64.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionValueString.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionValueUInt64.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
OptionValueUUID.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
Options.cpp Move option parsing out of the Args class 2018-03-09 10:39:40 +00:00
Property.cpp Move Args::StringTo*** functions to a new OptionArgParser class 2018-04-10 09:03:59 +00:00
ScriptInterpreter.cpp [Interpreter] Simplify else after return. NFCI. 2017-09-03 19:27:56 +00:00
embedded_interpreter.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00