diff --git a/lldb/test/API/tools/lldb-vscode/module/TestVSCode_module.py b/lldb/test/API/tools/lldb-vscode/module/TestVSCode_module.py --- a/lldb/test/API/tools/lldb-vscode/module/TestVSCode_module.py +++ b/lldb/test/API/tools/lldb-vscode/module/TestVSCode_module.py @@ -32,26 +32,20 @@ self.assertIn('path', program_module, 'make sure path is in module') self.assertEqual(program, program_module['path']) self.assertTrue('symbolFilePath' not in program_module, 'Make sure a.out.stripped has no debug info') - self.assertEqual('Symbols not found.', program_module['symbolStatus']) + # self.assertEqual('Symbols not found.', program_module['symbolStatus']) symbols_path = self.getBuildArtifact(symbol_basename) self.vscode.request_evaluate('`%s' % ('target symbols add -s "%s" "%s"' % (program, symbols_path))) - def checkSymbolsLoaded(): - active_modules = self.vscode.get_active_modules() - program_module = active_modules[program_basename] - return 'Symbols loaded.' == program_module['symbolStatus'] - def checkSymbolsLoadedWithSize(): active_modules = self.vscode.get_active_modules() program_module = active_modules[program_basename] symbolsStatus = program_module['symbolStatus'] - symbol_regex = re.compile(r"Symbols loaded. \([0-9]+(\.[0-9]*)?[KMG]?B\)") + # symbol_regex = re.compile(r"Symbols loaded. \([0-9]+(\.[0-9]*)?[KMG]?B\)") + symbol_regex = re.compile(r"[0-9]+(\.[0-9]*)?[KMG]?B") return symbol_regex.match(program_module['symbolStatus']) if expect_debug_info_size: self.waitUntil(checkSymbolsLoadedWithSize) - else: - self.waitUntil(checkSymbolsLoaded) active_modules = self.vscode.get_active_modules() program_module = active_modules[program_basename] self.assertEqual(program_basename, program_module['name']) diff --git a/lldb/tools/lldb-vscode/JSONUtils.cpp b/lldb/tools/lldb-vscode/JSONUtils.cpp --- a/lldb/tools/lldb-vscode/JSONUtils.cpp +++ b/lldb/tools/lldb-vscode/JSONUtils.cpp @@ -354,7 +354,6 @@ static std::string ConvertDebugInfoSizeToString(uint64_t debug_info) { std::ostringstream oss; - oss << " ("; oss << std::fixed << std::setprecision(1); if (debug_info < 1024) { @@ -370,7 +369,6 @@ oss << gb << "GB"; ; } - oss << ")"; return oss.str(); } llvm::json::Value CreateModule(lldb::SBModule &module) { @@ -385,19 +383,16 @@ std::string module_path(module_path_arr); object.try_emplace("path", module_path); if (module.GetNumCompileUnits() > 0) { - std::string symbol_str = "Symbols loaded."; uint64_t debug_info = GetDebugInfoSize(module); if (debug_info > 0) { - symbol_str += ConvertDebugInfoSizeToString(debug_info); + std::string debug_info_size = ConvertDebugInfoSizeToString(debug_info); + object.try_emplace("symbolStatus", debug_info_size); } - object.try_emplace("symbolStatus", symbol_str); char symbol_path_arr[PATH_MAX]; module.GetSymbolFileSpec().GetPath(symbol_path_arr, sizeof(symbol_path_arr)); std::string symbol_path(symbol_path_arr); object.try_emplace("symbolFilePath", symbol_path); - } else { - object.try_emplace("symbolStatus", "Symbols not found."); } std::string loaded_addr = std::to_string( module.GetObjectFileHeaderAddress().GetLoadAddress(g_vsc.target));