Browse Source

Debug::LLDB::get_variables no longer prefetch variable values

pipelines/280567345
eidheim 5 years ago
parent
commit
e08c39967f
  1. 15
      src/debug_lldb.cpp
  2. 2
      src/debug_lldb.hpp
  3. 2
      src/project.cpp

15
src/debug_lldb.cpp

@ -373,18 +373,21 @@ std::vector<Debug::LLDB::Variable> Debug::LLDB::get_variables() {
auto frame = thread.GetFrameAtIndex(c_f);
auto values = frame.GetVariables(true, true, true, false);
for(uint32_t value_index = 0; value_index < values.GetSize(); value_index++) {
lldb::SBStream stream;
auto value = values.GetValueAtIndex(value_index);
auto value = std::make_shared<lldb::SBValue>(values.GetValueAtIndex(value_index));
Debug::LLDB::Variable variable;
variable.thread_index_id = thread.GetIndexID();
variable.frame_index = c_f;
if(auto name = value.GetName())
if(auto name = value->GetName())
variable.name = name;
value.GetDescription(stream);
variable.value = stream.GetData();
auto declaration = value.GetDeclaration();
variable.get_value = [value]() {
lldb::SBStream stream;
value->GetDescription(stream);
return std::string(stream.GetData());
};
auto declaration = value->GetDeclaration();
if(declaration.IsValid()) {
variable.declaration_found = true;
variable.line_nr = declaration.GetLine();

2
src/debug_lldb.hpp

@ -23,7 +23,7 @@ namespace Debug {
uint32_t thread_index_id;
uint32_t frame_index;
std::string name;
std::string value;
std::function<std::string()> get_value;
bool declaration_found;
boost::filesystem::path file_path;
int line_nr;

2
src/project.cpp

@ -627,7 +627,7 @@ void Project::LLDB::debug_show_variables() {
auto set_tooltip_buffer = [rows, index](Tooltip &tooltip) {
auto variable = (*rows)[*index];
Glib::ustring value = variable.value;
Glib::ustring value = variable.get_value();
if(!value.empty()) {
Glib::ustring::iterator iter;
while(!value.validate(iter)) {

Loading…
Cancel
Save