[Lldb-commits] [lldb] Add options to "statistics dump" to control what sections are dumped (PR #95075)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 14 12:13:59 PDT 2024


================
@@ -77,12 +78,33 @@ class CommandObjectStatsDump : public CommandObjectParsed {
         break;
       case 's':
         m_stats_options.summary_only = true;
+        // In the "summary" mode, the following sections should be omitted by
+        // default unless their corresponding options are explicitly given.
+        // If such options were processed before 's', `m_seen_options` should
+        // contain them, and we will skip setting them to `false` here. If such
+        // options are not yet processed, we will set them to `false` here, and
+        // they will be overwritten when the options are processed.
+        if (m_seen_options.find((int)'r') == m_seen_options.end())
+          m_stats_options.include_targets = false;
+        if (m_seen_options.find((int)'m') == m_seen_options.end())
+          m_stats_options.include_modules = false;
+        if (m_seen_options.find((int)'t') == m_seen_options.end())
+          m_stats_options.include_transcript = false;
         break;
----------------
clayborg wrote:

We should put these smarts into the `StatisticsOptions` class so that we don't have to do this logic here _and_ this means that when people use the `SBStatisticsOptions` class via the API, we will do the right thing when using the API and it will match the behavior here.

https://github.com/llvm/llvm-project/pull/95075


More information about the lldb-commits mailing list