Skip to content

Commit 956c600

Browse files
committed
Add dtor, amend Jonas's feedback on docstrings and formatting
1 parent d28deda commit 956c600

File tree

3 files changed

+27
-8
lines changed

3 files changed

+27
-8
lines changed

lldb/bindings/interface/SBProgressDocstrings.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ The Progress class helps make sure that progress is correctly reported
1111
and will always send an initial progress update, updates when
1212
Progress::Increment() is called, and also will make sure that a progress
1313
completed update is reported even if the user doesn't explicitly cause one
14-
to be sent.") lldb::SBProgress
14+
to be sent.") lldb::SBProgress;

lldb/include/lldb/API/SBProgress.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,19 @@
1414

1515
namespace lldb {
1616

17-
/// A SB API Wrapper around lldb_private::Progress
17+
/// A Progress indicator helper class.
18+
///
19+
/// Any potentially long running sections of code in LLDB should report
20+
/// progress so that clients are aware of delays that might appear during
21+
/// debugging. Delays commonly include indexing debug information, parsing
22+
/// symbol tables for object files, downloading symbols from remote
23+
/// repositories, and many more things.
24+
///
25+
/// The Progress class helps make sure that progress is correctly reported
26+
/// and will always send an initial progress update, updates when
27+
/// Progress::Increment() is called, and also will make sure that a progress
28+
/// completed update is reported even if the user doesn't explicitly cause one
29+
/// to be sent.
1830
class LLDB_API SBProgress {
1931
public:
2032
/// Construct a progress object with a title, details and a given debugger.
@@ -38,12 +50,12 @@ class LLDB_API SBProgress {
3850
/// The debugger for this progress object to report to.
3951
SBProgress(const char *title, const char *details, uint64_t total_units,
4052
SBDebugger &debugger);
41-
SBProgress(const lldb::SBProgress &rhs);
53+
4254
~SBProgress();
4355

4456
const SBProgress &operator=(const lldb::SBProgress &rhs);
4557

46-
void Increment(uint64_t amount = 1, const char *description = nullptr);
58+
void Increment(uint64_t amount, const char *description = nullptr);
4759

4860
protected:
4961
lldb_private::Progress &ref() const;

lldb/source/API/SBProgress.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
//===-- SBProgress.cpp -------------------------------------------*- C++
2-
//-*-===//
1+
//===-- SBProgress.cpp --------------------------------------------------*-===//
32
//
43
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
54
// See https://llvm.org/LICENSE.txt for license information.
@@ -11,23 +10,31 @@
1110
#include "lldb/Core/Progress.h"
1211
#include "lldb/Utility/Instrumentation.h"
1312

13+
#include "Utils.h"
14+
1415
using namespace lldb;
1516

1617
SBProgress::SBProgress(const char *title, const char *details,
1718
SBDebugger &debugger) {
18-
LLDB_INSTRUMENT_VA(this, title, details, debugger)
19+
LLDB_INSTRUMENT_VA(this, title, details, debugger);
20+
1921
m_opaque_up = std::make_unique<lldb_private::Progress>(
2022
title, details, std::nullopt, debugger.get());
2123
}
2224

2325
SBProgress::SBProgress(const char *title, const char *details,
2426
uint64_t total_units, SBDebugger &debugger) {
25-
LLDB_INSTRUMENT_VA(this, title, details, total_units, debugger)
27+
LLDB_INSTRUMENT_VA(this, title, details, total_units, debugger);
28+
2629
m_opaque_up = std::make_unique<lldb_private::Progress>(
2730
title, details, total_units, debugger.get());
2831
}
2932

33+
SBProgress::~SBProgress() = default;
34+
3035
void SBProgress::Increment(uint64_t amount, const char *description) {
36+
LLDB_INSTRUMENT_VA(amount, description);
37+
3138
m_opaque_up->Increment(amount, description);
3239
}
3340

0 commit comments

Comments
 (0)