aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r--lldb/source/Commands/CommandCompletions.cpp8
-rw-r--r--lldb/source/Commands/CommandObjectSource.cpp23
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp17
-rw-r--r--lldb/source/Commands/CommandObjectThread.cpp2
4 files changed, 27 insertions, 23 deletions
diff --git a/lldb/source/Commands/CommandCompletions.cpp b/lldb/source/Commands/CommandCompletions.cpp
index 469a6bb..d325b72 100644
--- a/lldb/source/Commands/CommandCompletions.cpp
+++ b/lldb/source/Commands/CommandCompletions.cpp
@@ -378,8 +378,10 @@ CommandCompletions::SourceFileCompleter::SearchCallback(SearchFilter &filter,
}
}
} else {
- const char *cur_file_name = context.comp_unit->GetFilename().GetCString();
- const char *cur_dir_name = context.comp_unit->GetDirectory().GetCString();
+ const char *cur_file_name =
+ context.comp_unit->GetPrimaryFile().GetFilename().GetCString();
+ const char *cur_dir_name =
+ context.comp_unit->GetPrimaryFile().GetDirectory().GetCString();
bool match = false;
if (m_file_name && cur_file_name &&
@@ -391,7 +393,7 @@ CommandCompletions::SourceFileCompleter::SearchCallback(SearchFilter &filter,
match = false;
if (match) {
- m_matching_files.AppendIfUnique(context.comp_unit);
+ m_matching_files.AppendIfUnique(context.comp_unit->GetPrimaryFile());
}
}
}
diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp
index fd1b158..f2591b4 100644
--- a/lldb/source/Commands/CommandObjectSource.cpp
+++ b/lldb/source/Commands/CommandObjectSource.cpp
@@ -256,7 +256,8 @@ protected:
if (num_matches > 0)
strm << "\n\n";
strm << "Lines found for file " << file_spec_name
- << " in compilation unit " << cu->GetFilename() << " in `"
+ << " in compilation unit "
+ << cu->GetPrimaryFile().GetFilename() << " in `"
<< module_file_name << "\n";
cu_header_printed = true;
}
@@ -1077,7 +1078,8 @@ protected:
if (m_options.show_bp_locs) {
m_breakpoint_locations.Clear();
const bool show_inlines = true;
- m_breakpoint_locations.Reset(*sc.comp_unit, 0, show_inlines);
+ m_breakpoint_locations.Reset(sc.comp_unit->GetPrimaryFile(), 0,
+ show_inlines);
SearchFilterForUnconstrainedSearches target_search_filter(
target->shared_from_this());
target_search_filter.Search(m_breakpoint_locations);
@@ -1106,8 +1108,8 @@ protected:
? sc.line_entry.column
: 0;
target->GetSourceManager().DisplaySourceLinesWithLineNumbers(
- sc.comp_unit, sc.line_entry.line, column, lines_to_back_up,
- m_options.num_lines - lines_to_back_up, "->",
+ sc.comp_unit->GetPrimaryFile(), sc.line_entry.line, column,
+ lines_to_back_up, m_options.num_lines - lines_to_back_up, "->",
&result.GetOutputStream(), GetBreakpointLocations());
result.SetStatus(eReturnStatusSuccessFinishResult);
}
@@ -1190,18 +1192,18 @@ protected:
if (num_matches > 1) {
bool got_multiple = false;
- FileSpec *test_cu_spec = nullptr;
+ CompileUnit *test_cu = nullptr;
for (unsigned i = 0; i < num_matches; i++) {
SymbolContext sc;
sc_list.GetContextAtIndex(i, sc);
if (sc.comp_unit) {
- if (test_cu_spec) {
- if (test_cu_spec != static_cast<FileSpec *>(sc.comp_unit))
+ if (test_cu) {
+ if (test_cu != sc.comp_unit)
got_multiple = true;
break;
} else
- test_cu_spec = sc.comp_unit;
+ test_cu = sc.comp_unit;
}
}
if (got_multiple) {
@@ -1218,7 +1220,8 @@ protected:
if (sc.comp_unit) {
if (m_options.show_bp_locs) {
const bool show_inlines = true;
- m_breakpoint_locations.Reset(*sc.comp_unit, 0, show_inlines);
+ m_breakpoint_locations.Reset(sc.comp_unit->GetPrimaryFile(), 0,
+ show_inlines);
SearchFilterForUnconstrainedSearches target_search_filter(
target->shared_from_this());
target_search_filter.Search(m_breakpoint_locations);
@@ -1229,7 +1232,7 @@ protected:
m_options.num_lines = 10;
const uint32_t column = 0;
target->GetSourceManager().DisplaySourceLinesWithLineNumbers(
- sc.comp_unit, m_options.start_line, column, 0,
+ sc.comp_unit->GetPrimaryFile(), m_options.start_line, column, 0,
m_options.num_lines, "", &result.GetOutputStream(),
GetBreakpointLocations());
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index d77207b..9f4e58e 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -816,15 +816,14 @@ protected:
return;
if (sc.module_sp) {
if (sc.comp_unit) {
- s.Printf("Global variables for %s in %s:\n",
- sc.comp_unit->GetPath().c_str(),
- sc.module_sp->GetFileSpec().GetPath().c_str());
+ s.Format("Global variables for {0} in {1}:\n",
+ sc.comp_unit->GetPrimaryFile(), sc.module_sp->GetFileSpec());
} else {
s.Printf("Global variables for %s\n",
sc.module_sp->GetFileSpec().GetPath().c_str());
}
} else if (sc.comp_unit) {
- s.Printf("Global variables for %s\n", sc.comp_unit->GetPath().c_str());
+ s.Format("Global variables for {0}\n", sc.comp_unit->GetPrimaryFile());
}
for (VariableSP var_sp : variable_list) {
@@ -926,9 +925,9 @@ protected:
if (!success) {
if (frame) {
if (comp_unit)
- result.AppendErrorWithFormat(
- "no global variables in current compile unit: %s\n",
- comp_unit->GetPath().c_str());
+ result.AppendErrorWithFormatv(
+ "no global variables in current compile unit: {0}\n",
+ comp_unit->GetPrimaryFile());
else
result.AppendErrorWithFormat(
"no debug information for frame %u\n",
@@ -1327,8 +1326,8 @@ static uint32_t DumpCompileUnitLineTable(CommandInterpreter &interpreter,
if (i > 0)
strm << "\n\n";
- strm << "Line table for " << *static_cast<FileSpec *>(sc.comp_unit)
- << " in `" << module->GetFileSpec().GetFilename() << "\n";
+ strm << "Line table for " << sc.comp_unit->GetPrimaryFile() << " in `"
+ << module->GetFileSpec().GetFilename() << "\n";
LineTable *line_table = sc.comp_unit->GetLineTable();
if (line_table)
line_table->GetDescription(
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp
index a74eec0..13c17df 100644
--- a/lldb/source/Commands/CommandObjectThread.cpp
+++ b/lldb/source/Commands/CommandObjectThread.cpp
@@ -1193,7 +1193,7 @@ protected:
LineEntry line_entry;
const bool exact = false;
start_idx_ptr = sc.comp_unit->FindLineEntry(
- start_idx_ptr, line_number, sc.comp_unit, exact, &line_entry);
+ start_idx_ptr, line_number, nullptr, exact, &line_entry);
if (start_idx_ptr == UINT32_MAX)
break;