| 397 | } |
| 398 | |
| 399 | void SymbolImporter::ImportExtraSymbols( |
| 400 | ccc::SymbolDatabase& database, |
| 401 | const Pcsx2Config::DebugAnalysisOptions& options, |
| 402 | const std::map<std::string, ccc::DataTypeHandle>& builtin_types, |
| 403 | u32 importer_flags, |
| 404 | const ccc::DemanglerFunctions& demangler, |
| 405 | const std::atomic_bool* interrupt) |
| 406 | { |
| 407 | MipsExpressionFunctions expression_functions(&r5900Debug, &database, true); |
| 408 | |
| 409 | for (const DebugExtraSymbolFile& extra_symbol_file : options.ExtraSymbolFiles) |
| 410 | { |
| 411 | if (*interrupt) |
| 412 | return; |
| 413 | |
| 414 | std::string path = Path::ToNativePath(extra_symbol_file.Path); |
| 415 | if (!Path::IsAbsolute(path)) |
| 416 | path = Path::Combine(EmuFolders::GameSettings, path); |
| 417 | |
| 418 | if (!extra_symbol_file.Condition.empty()) |
| 419 | { |
| 420 | u64 expression_result = 0; |
| 421 | std::string error; |
| 422 | if (!parseExpression(extra_symbol_file.Condition.c_str(), &expression_functions, expression_result, error)) |
| 423 | { |
| 424 | Console.Error("Failed to evaluate condition expression '%s' while importing extra symbol file '%s': %s", |
| 425 | extra_symbol_file.Condition.c_str(), path.c_str(), error.c_str()); |
| 426 | } |
| 427 | |
| 428 | if (!expression_result) |
| 429 | continue; |
| 430 | } |
| 431 | |
| 432 | ccc::Address base_address; |
| 433 | if (!extra_symbol_file.BaseAddress.empty()) |
| 434 | { |
| 435 | u64 expression_result = 0; |
| 436 | std::string error; |
| 437 | if (!parseExpression(extra_symbol_file.BaseAddress.c_str(), &expression_functions, expression_result, error)) |
| 438 | { |
| 439 | Console.Error("Failed to evaluate base address expression '%s' while importing extra symbol file '%s': %s", |
| 440 | extra_symbol_file.BaseAddress.c_str(), path.c_str(), error.c_str()); |
| 441 | } |
| 442 | |
| 443 | base_address = static_cast<u32>(expression_result); |
| 444 | } |
| 445 | |
| 446 | if (StringUtil::EndsWithNoCase(path, ".sym")) |
| 447 | { |
| 448 | ccc::Result<bool> nocash_result = ImportNocashSymbols( |
| 449 | database, path, base_address.get_or_zero(), builtin_types); |
| 450 | if (!nocash_result.success()) |
| 451 | { |
| 452 | Console.Error("Failed to import symbol file '%s': %s", |
| 453 | extra_symbol_file.Path.c_str(), nocash_result.error().message.c_str()); |
| 454 | } |
| 455 | |
| 456 | if (!*nocash_result) |
nothing calls this directly
no test coverage detected