Browse Source

Fixed crash on debug show variables when variable name was empty

merge-requests/365/head
eidheim 10 years ago
parent
commit
2b2bfe76cf
  1. 4
      src/debug.cc
  2. 2
      src/directories.cc

4
src/debug.cc

@ -337,7 +337,9 @@ std::vector<Debug::Variable> Debug::get_variables() {
variable.thread_index_id=thread.GetIndexID(); variable.thread_index_id=thread.GetIndexID();
variable.frame_index=c_f; variable.frame_index=c_f;
variable.name=value.GetName(); auto value_name=value.GetName();
if(value_name!=NULL)
variable.name=value_name;
variable.line_nr=declaration.GetLine(); variable.line_nr=declaration.GetLine();
variable.line_index=declaration.GetColumn(); variable.line_index=declaration.GetColumn();

2
src/directories.cc

@ -134,7 +134,7 @@ void Directories::open(const boost::filesystem::path& dir_path) {
auto project=cmake->get_functions_parameters("project"); auto project=cmake->get_functions_parameters("project");
if(project.size()>0 && project[0].second.size()>0) { if(project.size()>0 && project[0].second.size()>0) {
auto title=project[0].second[0]; auto title=project[0].second[0];
//TOTO: report that set_title does not handle '_' correctly? //TODO: report that set_title does not handle '_' correctly?
size_t pos=0; size_t pos=0;
while((pos=title.find('_', pos))!=std::string::npos) { while((pos=title.find('_', pos))!=std::string::npos) {
title.replace(pos, 1, "__"); title.replace(pos, 1, "__");

Loading…
Cancel
Save