Skip to content

Commit 34cb7a2

Browse files
committed
Address method/var name changes
1 parent 0c9b4db commit 34cb7a2

22 files changed

+45
-49
lines changed

lldb/bindings/interface/SBStatisticsOptionsDocstrings.i

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
) lldb::SBStatisticsOptions::GetSummaryOnly;
99
%feature("docstring", "
1010
Sets whether the statistics will force loading all possible debug info."
11-
) lldb::SBStatisticsOptions::SetForceLoading;
11+
) lldb::SBStatisticsOptions::SetReportAllAvailableDebugInfo;
1212
%feature("docstring", "
1313
Gets whether the statistics will force loading all possible debug info."
14-
) lldb::SBStatisticsOptions::GetForceLoading;
14+
) lldb::SBStatisticsOptions::GetReportAllAvailableDebugInfo;

lldb/include/lldb/API/SBStatisticsOptions.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,14 @@ class LLDB_API SBStatisticsOptions {
2424

2525
void SetSummaryOnly(bool b);
2626
bool GetSummaryOnly();
27-
28-
void SetForceLoading(bool b);
29-
bool GetForceLoading();
27+
28+
/// If set to true, the debugger will load all debug info that is available
29+
/// and report statistics on the total amount. If this is set to false, then
30+
/// only report statistics on the currently loaded debug information.
31+
/// This can avoid loading debug info from separate files just so it can
32+
/// report the total size which can slow down statistics reporting.
33+
void SetReportAllAvailableDebugInfo(bool b);
34+
bool GetReportAllAvailableDebugInfo();
3035

3136
protected:
3237
friend class SBTarget;

lldb/include/lldb/Symbol/SymbolFile.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,13 +393,13 @@ class SymbolFile : public PluginInterface {
393393
/// function will iterate over all sections in a module and add up their
394394
/// debug info only section byte sizes.
395395
///
396-
/// \param load_if_needed
396+
/// \param load_all_debug_info
397397
/// If true, force loading any symbol files if they are not yet loaded and
398-
/// add to the total size
398+
/// add to the total size. Default to false.
399399
///
400400
/// \returns
401401
/// Total currently loaded debug info size in bytes
402-
virtual uint64_t GetDebugInfoSize(bool load_if_needed = false) = 0;
402+
virtual uint64_t GetDebugInfoSize(bool load_all_debug_info = false) = 0;
403403

404404
/// Return the time taken to parse the debug information.
405405
///
@@ -542,7 +542,7 @@ class SymbolFileCommon : public SymbolFile {
542542

543543
void Dump(Stream &s) override;
544544

545-
uint64_t GetDebugInfoSize(bool load_if_needed = false) override;
545+
uint64_t GetDebugInfoSize(bool load_all_debug_info = false) override;
546546

547547
bool GetDebugInfoIndexWasLoadedFromCache() const override {
548548
return m_index_was_loaded_from_cache;

lldb/include/lldb/Symbol/SymbolFileOnDemand.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ class SymbolFileOnDemand : public lldb_private::SymbolFile {
178178

179179
void PreloadSymbols() override;
180180

181-
uint64_t GetDebugInfoSize(bool load_if_needed = false) override;
181+
uint64_t GetDebugInfoSize(bool load_all_debug_info = false) override;
182182
lldb_private::StatsDuration::Duration GetDebugInfoParseTime() override;
183183
lldb_private::StatsDuration::Duration GetDebugInfoIndexTime() override;
184184

lldb/include/lldb/Target/Statistics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ struct ConstStringStats {
132132

133133
struct StatisticsOptions {
134134
bool summary_only = false;
135-
bool force_loading = false;
135+
bool load_all_debug_info = false;
136136
};
137137

138138
/// A class that represents statistics for a since lldb_private::Target.

lldb/source/API/SBStatisticsOptions.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ void SBStatisticsOptions::SetSummaryOnly(bool b) {
4444

4545
bool SBStatisticsOptions::GetSummaryOnly() { return m_opaque_up->summary_only; }
4646

47-
void SBStatisticsOptions::SetForceLoading(bool b) {
48-
m_opaque_up->force_loading = b;
47+
void SBStatisticsOptions::SetReportAllAvailableDebugInfo(bool b) {
48+
m_opaque_up->load_all_debug_info = b;
4949
}
5050

51-
bool SBStatisticsOptions::GetForceLoading() { return m_opaque_up->force_loading; }
51+
bool SBStatisticsOptions::GetReportAllAvailableDebugInfo() {
52+
return m_opaque_up->load_all_debug_info;
53+
}
5254

5355
const lldb_private::StatisticsOptions &SBStatisticsOptions::ref() const {
5456
return *m_opaque_up;

lldb/source/Commands/CommandObjectStats.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class CommandObjectStatsDump : public CommandObjectParsed {
7979
m_stats_options.summary_only = true;
8080
break;
8181
case 'f':
82-
m_stats_options.force_loading = true;
82+
m_stats_options.load_all_debug_info = true;
8383
break;
8484
default:
8585
llvm_unreachable("Unimplemented option");

lldb/source/Commands/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,8 +1421,8 @@ let Command = "statistics dump" in {
14211421
def statistics_dump_summary: Option<"summary", "s">, Group<1>,
14221422
Desc<"Dump only high-level summary statistics. "
14231423
"Exclude targets, modules, breakpoints etc... details.">;
1424-
def statistics_dump_force: Option<"force", "f">, Group<1>,
1424+
def statistics_dump_force: Option<"load-all-debug-info", "f">, Group<1>,
14251425
Desc<"Dump the total possible debug info statistics. "
1426-
"Force loading the debug information if not yet loaded, and collect "
1426+
"Force loading all the debug information if not yet loaded, and collect "
14271427
"statistics with those.">;
14281428
}

lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ void SymbolFileBreakpad::ParseUnwindData() {
918918
m_unwind_data->win.Sort();
919919
}
920920

921-
uint64_t SymbolFileBreakpad::GetDebugInfoSize(bool load_if_needed) {
921+
uint64_t SymbolFileBreakpad::GetDebugInfoSize(bool load_all_debug_info) {
922922
// Breakpad files are all debug info.
923923
return m_objfile_sp->GetByteSize();
924924
}

lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class SymbolFileBreakpad : public SymbolFileCommon {
141141

142142
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
143143

144-
uint64_t GetDebugInfoSize(bool load_if_needed = false) override;
144+
uint64_t GetDebugInfoSize(bool load_all_debug_info = false) override;
145145

146146
private:
147147
// A class representing a position in the breakpad file. Useful for

lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -896,8 +896,8 @@ void DWARFUnit::ComputeAbsolutePath() {
896896
m_file_spec->MakeAbsolute(GetCompilationDirectory());
897897
}
898898

899-
SymbolFileDWARFDwo *DWARFUnit::GetDwoSymbolFile(bool load_if_needed) {
900-
if (load_if_needed)
899+
SymbolFileDWARFDwo *DWARFUnit::GetDwoSymbolFile(bool load_all_debug_info) {
900+
if (load_all_debug_info)
901901
ExtractUnitDIEIfNeeded();
902902
if (m_dwo)
903903
return &llvm::cast<SymbolFileDWARFDwo>(m_dwo->GetSymbolFileDWARF());

lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ class DWARFUnit : public UserID {
241241
FileSpec GetFile(size_t file_idx);
242242
FileSpec::Style GetPathStyle();
243243

244-
SymbolFileDWARFDwo *GetDwoSymbolFile(bool load_if_needed = false);
244+
SymbolFileDWARFDwo *GetDwoSymbolFile(bool load_all_debug_info = false);
245245

246246
die_iterator_range dies() {
247247
ExtractDIEsIfNeeded();

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2672,7 +2672,7 @@ static bool UpdateCompilerContextForSimpleTemplateNames(TypeQuery &match) {
26722672
return any_context_updated;
26732673
}
26742674

2675-
uint64_t SymbolFileDWARF::GetDebugInfoSize(bool load_if_needed) {
2675+
uint64_t SymbolFileDWARF::GetDebugInfoSize(bool load_all_debug_info) {
26762676
DWARFDebugInfo &info = DebugInfo();
26772677
uint32_t num_comp_units = info.GetNumUnits();
26782678

@@ -2687,7 +2687,7 @@ uint64_t SymbolFileDWARF::GetDebugInfoSize(bool load_if_needed) {
26872687
if (cu == nullptr)
26882688
continue;
26892689

2690-
SymbolFileDWARFDwo *dwo = cu->GetDwoSymbolFile(load_if_needed);
2690+
SymbolFileDWARFDwo *dwo = cu->GetDwoSymbolFile(load_all_debug_info);
26912691
if (dwo)
26922692
debug_info_size += dwo->GetDebugInfoSize();
26932693
}

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -186,19 +186,7 @@ class SymbolFileDWARF : public SymbolFileCommon {
186186
GetMangledNamesForFunction(const std::string &scope_qualified_name,
187187
std::vector<ConstString> &mangled_names) override;
188188

189-
/// Get total currently loaded debug info size or total possible debug info
190-
/// size.
191-
///
192-
/// For cases like .dwo files, the debug info = skeleton debug info +
193-
/// all dwo debug info where .dwo files might not be loaded yet. Calling this
194-
/// function by default will NOT force the loading of any .dwo files.
195-
///
196-
/// \param load_if_needed
197-
/// If true, force loading any .dwo files associated and add to the size
198-
///
199-
/// \return
200-
/// Returns total currently loaded debug info size
201-
uint64_t GetDebugInfoSize(bool load_if_needed = false) override;
189+
uint64_t GetDebugInfoSize(bool load_all_debug_info = false) override;
202190

203191
void FindTypes(const lldb_private::TypeQuery &match,
204192
lldb_private::TypeResults &results) override;

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ lldb::offset_t SymbolFileDWARFDwo::GetVendorDWARFOpcodeSize(
8585
return GetBaseSymbolFile().GetVendorDWARFOpcodeSize(data, data_offset, op);
8686
}
8787

88-
uint64_t SymbolFileDWARFDwo::GetDebugInfoSize(bool load_if_needed) {
88+
uint64_t SymbolFileDWARFDwo::GetDebugInfoSize(bool load_all_debug_info) {
8989
// Directly get debug info from current dwo object file's section list
9090
// instead of asking SymbolFileCommon::GetDebugInfo() which parses from
9191
// owning module which is wrong.

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class SymbolFileDWARFDwo : public SymbolFileDWARF {
4747
const lldb::offset_t data_offset,
4848
const uint8_t op) const override;
4949

50-
uint64_t GetDebugInfoSize(bool load_if_needed = false) override;
50+
uint64_t GetDebugInfoSize(bool load_all_debug_info = false) override;
5151

5252
bool ParseVendorDWARFOpcode(uint8_t op, const DataExtractor &opcodes,
5353
lldb::offset_t &offset,

lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2156,7 +2156,7 @@ SymbolFileNativePDB::GetTypeSystemForLanguage(lldb::LanguageType language) {
21562156
return type_system_or_err;
21572157
}
21582158

2159-
uint64_t SymbolFileNativePDB::GetDebugInfoSize(bool load_if_needed) {
2159+
uint64_t SymbolFileNativePDB::GetDebugInfoSize(bool load_all_debug_info) {
21602160
// PDB files are a separate file that contains all debug info.
21612161
return m_index->pdb().getFileSize();
21622162
}

lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class SymbolFileNativePDB : public SymbolFileCommon {
7777

7878
void InitializeObject() override;
7979

80-
uint64_t GetDebugInfoSize(bool load_if_needed = false) override;
80+
uint64_t GetDebugInfoSize(bool load_all_debug_info = false) override;
8181

8282
// Compile Unit function calls
8383

lldb/source/Symbol/SymbolFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ SymbolFileCommon::GetTypeSystemForLanguage(lldb::LanguageType language) {
227227
return type_system_or_err;
228228
}
229229

230-
uint64_t SymbolFileCommon::GetDebugInfoSize(bool load_if_needed) {
230+
uint64_t SymbolFileCommon::GetDebugInfoSize(bool load_all_debug_info) {
231231
if (!m_objfile_sp)
232232
return 0;
233233
ModuleSP module_sp(m_objfile_sp->GetModule());

lldb/source/Symbol/SymbolFileOnDemand.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,11 +535,11 @@ void SymbolFileOnDemand::PreloadSymbols() {
535535
return m_sym_file_impl->PreloadSymbols();
536536
}
537537

538-
uint64_t SymbolFileOnDemand::GetDebugInfoSize(bool load_if_needed) {
538+
uint64_t SymbolFileOnDemand::GetDebugInfoSize(bool load_all_debug_info) {
539539
// Always return the real debug info size.
540540
LLDB_LOG(GetLog(), "[{0}] {1} is not skipped", GetSymbolFileName(),
541541
__FUNCTION__);
542-
return m_sym_file_impl->GetDebugInfoSize(load_if_needed);
542+
return m_sym_file_impl->GetDebugInfoSize(load_all_debug_info);
543543
}
544544

545545
StatsDuration::Duration SymbolFileOnDemand::GetDebugInfoParseTime() {

lldb/source/Target/Statistics.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ llvm::json::Value DebuggerStats::ReportStatistics(
224224
const lldb_private::StatisticsOptions &options) {
225225

226226
const bool summary_only = options.summary_only;
227-
const bool force_laoding = options.force_loading;
227+
const bool load_all_debug_info = options.load_all_debug_info;
228228

229229
json::Array json_targets;
230230
json::Array json_modules;
@@ -281,7 +281,8 @@ llvm::json::Value DebuggerStats::ReportStatistics(
281281
++debug_index_saved;
282282
module_stat.debug_index_time = sym_file->GetDebugInfoIndexTime().count();
283283
module_stat.debug_parse_time = sym_file->GetDebugInfoParseTime().count();
284-
module_stat.debug_info_size = sym_file->GetDebugInfoSize(force_laoding);
284+
module_stat.debug_info_size =
285+
sym_file->GetDebugInfoSize(load_all_debug_info);
285286
module_stat.symtab_stripped = module->GetObjectFile()->IsStripped();
286287
if (module_stat.symtab_stripped)
287288
++num_stripped_modules;

lldb/test/API/functionalities/stats_api/TestStatisticsAPI.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def test_command_stats_api(self):
117117
self.assertNotIn("bt", command_stats)
118118
# Verify bt's regex command is not duplicatedly captured.
119119
self.assertNotIn("_regexp-bt", command_stats)
120-
120+
121121
def test_command_stats_force(self):
122122
"""
123123
Test reporting all pssible debug info stats by force loading all debug
@@ -136,7 +136,7 @@ def test_command_stats_force(self):
136136
# Create a target with the object file we just created from YAML
137137
target = self.dbg.CreateTarget(obj_path)
138138
self.assertTrue(target, VALID_TARGET)
139-
139+
140140
# Get statistics
141141
stats_options = lldb.SBStatisticsOptions()
142142
stats = target.GetStatistics(stats_options)
@@ -146,7 +146,7 @@ def test_command_stats_force(self):
146146
self.assertEqual(debug_stats["totalDebugInfoByteSize"], 188)
147147

148148
# Get statistics with force loading
149-
stats_options.SetForceLoading(True)
149+
stats_options.SetReportAllAvailableDebugInfo(True)
150150
stats_force = target.GetStatistics(stats_options)
151151
stream_force = lldb.SBStream()
152152
stats_force.GetAsJSON(stream_force)

0 commit comments

Comments
 (0)