diff --git a/src/debug_clang.cc b/src/debug_clang.cc index 54f0d45..63b53fd 100644 --- a/src/debug_clang.cc +++ b/src/debug_clang.cc @@ -405,7 +405,7 @@ std::string Debug::Clang::get_value(const std::string &variable, const boost::fi } if(variable_value.empty()) { //In case a variable is missing file and line number, only do check on name - auto value=frame.FindVariable(variable.c_str()); + auto value=frame.GetValueForVariablePath(variable.c_str()); if(value.IsValid()) { lldb::SBStream stream; value.GetDescription(stream); diff --git a/src/source_clang.cc b/src/source_clang.cc index 98d297d..e3bed92 100644 --- a/src/source_clang.cc +++ b/src/source_clang.cc @@ -413,7 +413,22 @@ void Source::ClangViewParse::show_type_tooltips(const Gdk::Rectangle &rectangle) if(Debug::Clang::get().is_stopped()) { auto location=token.get_cursor().get_referenced().get_source_location(); Glib::ustring value_type="Value"; - Glib::ustring debug_value=Debug::Clang::get().get_value(token.get_spelling(), location.get_path(), location.get_offset().line, location.get_offset().index); + + auto start=get_buffer()->get_iter_at_line_index(token.offsets.first.line-1, token.offsets.first.index-1); + auto end=get_buffer()->get_iter_at_line_index(token.offsets.second.line-1, token.offsets.second.index-1); + auto iter=start; + while((*iter>='a' && *iter<='z') || (*iter>='A' && *iter<='Z') || (*iter>='0' && *iter<='9') || *iter=='_' || *iter=='.') { + start=iter; + if(!iter.backward_char()) + break; + if(*iter=='>') { + if(!(iter.backward_char() && *iter=='-' && iter.backward_char())) + break; + } + } + auto spelling=get_buffer()->get_text(start, end).raw(); + + Glib::ustring debug_value=Debug::Clang::get().get_value(spelling, location.get_path(), location.get_offset().line, location.get_offset().index); if(debug_value.empty()) { value_type="Return value"; auto cursor=token.get_cursor();