File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -841,11 +841,20 @@ std::vector<DebugModule> GdbMiAdapter::GetModuleList()
841841 // Rest of the line is the objfile (path)
842842 std::getline (lineStream, objfile);
843843
844- // Trim leading whitespace from objfile
844+ // Trim leading and trailing whitespace from objfile
845845 size_t firstNonSpace = objfile.find_first_not_of (" \t " );
846- if (firstNonSpace ! = std::string::npos)
846+ if (firstNonSpace = = std::string::npos)
847847 {
848- objfile = objfile.substr (firstNonSpace);
848+ // Line is all whitespace, skip it
849+ continue ;
850+ }
851+ objfile = objfile.substr (firstNonSpace);
852+
853+ // Trim trailing whitespace
854+ size_t lastNonSpace = objfile.find_last_not_of (" \t " );
855+ if (lastNonSpace != std::string::npos)
856+ {
857+ objfile = objfile.substr (0 , lastNonSpace + 1 );
849858 }
850859
851860 // Skip lines without valid addresses or without objfile
You can’t perform that action at this time.
0 commit comments