| 397 | } |
| 398 | |
| 399 | std::unique_ptr<rcx::Provider> WinDbgMemoryPlugin::createProvider(const QString& target, QString* errorMsg) |
| 400 | { |
| 401 | auto provider = std::make_unique<WinDbgMemoryProvider>(target); |
| 402 | if (!provider->isValid()) |
| 403 | { |
| 404 | if (errorMsg) { |
| 405 | if (target.startsWith("tcp:", Qt::CaseInsensitive) |
| 406 | || target.startsWith("npipe:", Qt::CaseInsensitive)) |
| 407 | *errorMsg = QString("Failed to connect to debug server.\n\n" |
| 408 | "Target: %1\n\n" |
| 409 | "Make sure WinDbg is running with a matching .server command\n" |
| 410 | "(e.g. .server tcp:port=5055) and the port/pipe is reachable.") |
| 411 | .arg(target); |
| 412 | else if (target.startsWith("pid:", Qt::CaseInsensitive)) |
| 413 | *errorMsg = QString("Failed to attach to process.\n\n" |
| 414 | "Target: %1\n\n" |
| 415 | "Make sure the process is running and you have " |
| 416 | "sufficient privileges (try Run as Administrator).") |
| 417 | .arg(target); |
| 418 | else |
| 419 | *errorMsg = QString("Failed to open dump file.\n\n" |
| 420 | "Target: %1\n\n" |
| 421 | "Make sure the file exists and is a valid dump.") |
| 422 | .arg(target); |
| 423 | } |
| 424 | return nullptr; |
| 425 | } |
| 426 | return provider; |
| 427 | } |
| 428 | |
| 429 | uint64_t WinDbgMemoryPlugin::getInitialBaseAddress(const QString& target) const |
| 430 | { |