Skip to content

Commit 3e35495

Browse files
committed
conventions
1 parent e4e80ca commit 3e35495

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

lldb/tools/lldb-dap/Breakpoint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ GetPersistenceDataForAddress(lldb::SBAddress &addr) {
3737
return std::nullopt;
3838

3939
persistence_data.module = GetSBFileSpecPath(file_spec);
40-
persistence_data.file_addr = addr.GetFileAddress();
40+
persistence_data.fileAddress = addr.GetFileAddress();
4141
return persistence_data;
4242
}
4343

lldb/tools/lldb-dap/DAP.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1497,8 +1497,9 @@ std::vector<protocol::Breakpoint> DAP::SetSourceBreakpoints(
14971497

14981498
protocol::Breakpoint response_breakpoint =
14991499
iv->second.ToProtocolBreakpoint();
1500-
response_breakpoint.source = source;
15011500

1501+
if (!response_breakpoint.source)
1502+
response_breakpoint.source = source;
15021503
if (!response_breakpoint.line &&
15031504
src_bp.GetLine() != LLDB_INVALID_LINE_NUMBER)
15041505
response_breakpoint.line = src_bp.GetLine();

lldb/tools/lldb-dap/Protocol/DAPTypes.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ bool fromJSON(const llvm::json::Value &Params, PersistenceData &PD,
99
llvm::json::Path P) {
1010
json::ObjectMapper O(Params, P);
1111
return O && O.mapOptional("module", PD.module) &&
12-
O.mapOptional("file_addr", PD.file_addr);
12+
O.mapOptional("fileAddress", PD.fileAddress);
1313
}
1414

1515
llvm::json::Value toJSON(const PersistenceData &PD) {
1616
json::Object result{
1717
{"module", PD.module},
18-
{"file_addr", PD.file_addr},
18+
{"fileAddress", PD.fileAddress},
1919
};
2020

2121
return result;
@@ -24,13 +24,13 @@ llvm::json::Value toJSON(const PersistenceData &PD) {
2424
bool fromJSON(const llvm::json::Value &Params, SourceLLDBData &SLD,
2525
llvm::json::Path P) {
2626
json::ObjectMapper O(Params, P);
27-
return O && O.mapOptional("persistence_data", SLD.persistence_data);
27+
return O && O.mapOptional("persistenceData", SLD.persistenceData);
2828
}
2929

3030
llvm::json::Value toJSON(const SourceLLDBData &SLD) {
3131
json::Object result;
32-
if (SLD.persistence_data)
33-
result.insert({"persistence_data", SLD.persistence_data});
32+
if (SLD.persistenceData)
33+
result.insert({"persistenceData", SLD.persistenceData});
3434
return result;
3535
}
3636

lldb/tools/lldb-dap/Protocol/DAPTypes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct PersistenceData {
3232
std::string module;
3333

3434
/// The file address of the function.
35-
lldb::addr_t file_addr;
35+
lldb::addr_t fileAddress;
3636
};
3737
bool fromJSON(const llvm::json::Value &, PersistenceData &, llvm::json::Path);
3838
llvm::json::Value toJSON(const PersistenceData &);
@@ -43,7 +43,7 @@ llvm::json::Value toJSON(const PersistenceData &);
4343
struct SourceLLDBData {
4444
/// Data that helps lldb resolve this source persistently across different
4545
/// sessions.
46-
std::optional<PersistenceData> persistence_data;
46+
std::optional<PersistenceData> persistenceData;
4747
};
4848
bool fromJSON(const llvm::json::Value &, SourceLLDBData &, llvm::json::Path);
4949
llvm::json::Value toJSON(const SourceLLDBData &);

lldb/tools/lldb-dap/SourceBreakpoint.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ llvm::Error SourceBreakpoint::SetBreakpoint(const protocol::Source &source) {
4848

4949
if (source.sourceReference) {
5050
// Breakpoint set by assembly source.
51-
if (source.adapterData && source.adapterData->persistence_data) {
51+
if (source.adapterData && source.adapterData->persistenceData) {
5252
// Prefer use the adapter persitence data, because this could be a
5353
// breakpoint from a previous session where the `sourceReference` is not
5454
// valid anymore.
5555
if (llvm::Error error = CreateAssemblyBreakpointWithPersistenceData(
56-
*source.adapterData->persistence_data))
56+
*source.adapterData->persistenceData))
5757
return error;
5858
} else {
5959
if (llvm::Error error = CreateAssemblyBreakpointWithSourceReference(
@@ -123,7 +123,7 @@ llvm::Error SourceBreakpoint::CreateAssemblyBreakpointWithPersistenceData(
123123
const protocol::PersistenceData &persistence_data) {
124124
lldb::SBFileSpec file_spec(persistence_data.module.c_str());
125125
m_bp = m_dap.target.BreakpointCreateByFileAddress(
126-
file_spec, persistence_data.file_addr, 0, m_line - 1);
126+
file_spec, persistence_data.fileAddress, 0, m_line - 1);
127127
return llvm::Error::success();
128128
}
129129

0 commit comments

Comments
 (0)