Skip to content

Commit 4d8706d

Browse files
committed
[lldb] [disassembler] chore: enhance VariableAnnotator to return structured data: update both annotate and AnnotateStructured to use shared pointer tp module by value
Signed-off-by: Nikita B <[email protected]>
1 parent c955af3 commit 4d8706d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lldb/include/lldb/Core/Disassembler.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -599,14 +599,14 @@ class VariableAnnotator {
599599
/// Compute annotation strings for a single instruction and update `Live_`.
600600
/// Returns only the events that should be printed *at this instruction*.
601601
std::vector<std::string> annotate(Instruction &inst, Target &target,
602-
const lldb::ModuleSP &module_sp);
602+
lldb::ModuleSP module_sp);
603603

604604
/// Compute structured annotation data for a single instruction and update
605605
/// `Live_`. Returns structured data for all variables relevant at this
606606
/// instruction.
607-
std::vector<VariableAnnotation>
608-
AnnotateStructured(Instruction &inst, Target &target,
609-
const lldb::ModuleSP &module_sp);
607+
std::vector<VariableAnnotation> AnnotateStructured(Instruction &inst,
608+
Target &target,
609+
lldb::ModuleSP module_sp);
610610
};
611611

612612
} // namespace lldb_private

lldb/source/Core/Disassembler.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,9 @@ bool Disassembler::ElideMixedSourceAndDisassemblyLine(
299299
// The goal is to give users helpful live variable hints alongside the
300300
// disassembled instruction stream, similar to how debug information
301301
// enhances source-level debugging.
302-
std::vector<std::string>
303-
VariableAnnotator::annotate(Instruction &inst, Target &target,
304-
const lldb::ModuleSP &module_sp) {
302+
std::vector<std::string> VariableAnnotator::annotate(Instruction &inst,
303+
Target &target,
304+
lldb::ModuleSP module_sp) {
305305
auto structured_annotations = AnnotateStructured(inst, target, module_sp);
306306

307307
std::vector<std::string> events;
@@ -325,7 +325,7 @@ VariableAnnotator::annotate(Instruction &inst, Target &target,
325325

326326
std::vector<VariableAnnotation>
327327
VariableAnnotator::AnnotateStructured(Instruction &inst, Target &target,
328-
const lldb::ModuleSP &module_sp) {
328+
lldb::ModuleSP module_sp) {
329329
std::vector<VariableAnnotation> annotations;
330330

331331
// If we lost module context, mark all live variables as undefined.

0 commit comments

Comments
 (0)