Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.41 KB | None | 0 0
  1. diff --git a/src/plugins/debugger/gdb/gdboptionspage.cpp b/src/plugins/debugger/gdb/gdboptionspage.cpp
  2. index 353a6f2..8f64c46 100644
  3. --- a/src/plugins/debugger/gdb/gdboptionspage.cpp
  4. +++ b/src/plugins/debugger/gdb/gdboptionspage.cpp
  5. @@ -74,6 +74,95 @@ void GdbOptionsPage::readGdbSettings() /* static */
  6.          abiToGdbMap.insert(abi.toString(), binary);
  7.      }
  8.      settings->endArray();
  9. +
  10. +    // Map old settings (pre 2.2):
  11. +    const QChar separator = QLatin1Char(',');
  12. +    const QString keyRoot = QLatin1String("GdbBinaries/GdbBinaries");
  13. +    for (int i = 1; ; i++) {
  14. +        const QString value = settings->value(keyRoot + QString::number(i)).toString();
  15. +        if (value.isEmpty())
  16. +            break;
  17. +        // Split apart comma-separated binary and its numerical toolchains.
  18. +        QStringList tokens = value.split(separator);
  19. +        if (tokens.size() < 2)
  20. +            break;
  21. +
  22. +        const QString binary = tokens.front();
  23. +        // Skip non-existent absolute binaries allowing for upgrades by the installer.
  24. +        // Force a rewrite of the settings file.
  25. +        const QFileInfo binaryInfo(binary);
  26. +        if (binaryInfo.isAbsolute() && !binaryInfo.isExecutable()) {
  27. +            const QString msg = QString::fromLatin1("Warning: The gdb binary '%1' does not exist, skipping.\n").arg(binary);
  28. +            qWarning("%s", qPrintable(msg));
  29. +            continue;
  30. +        }
  31. +
  32. +        // Create entries for all toolchains.
  33. +        tokens.pop_front();
  34. +        foreach (const QString &t, tokens) {
  35. +            // Paranoia: Check if the there is already a binary configured for the toolchain.
  36. +            QString abi;
  37. +            switch (t.toInt())
  38. +            {
  39. +            case 0: // GCC
  40. +            case 1: // Linux ICC
  41. +#ifndef Q_OS_WIN
  42. +                abi = ProjectExplorer::Abi::hostAbi().toString();
  43. +#endif
  44. +                break;
  45. +            case 2: // MinGW
  46. +            case 3: // MSVC
  47. +            case 4: // WINCE
  48. +#ifdef Q_OS_WIN
  49. +                abi = ProjectExplorer::Abi::hostAbi().toString();
  50. +#endif
  51. +                break;
  52. +            case 5: // WINSCW
  53. +                abi = ProjectExplorer::Abi(ProjectExplorer::Abi::ARM, ProjectExplorer::Abi::Symbian,
  54. +                                           ProjectExplorer::Abi::Symbian_emulator,
  55. +                                           ProjectExplorer::Abi::Format_ELF,
  56. +                                           32).toString();
  57. +                break;
  58. +            case 6: // GCCE
  59. +            case 7: // RVCT 2, ARM v5
  60. +            case 8: // RVCT 2, ARM v6
  61. +            case 11: // RVCT GNUPOC
  62. +            case 12: // RVCT 4, ARM v5
  63. +            case 13: // RVCT 4, ARM v6
  64. +                abi = ProjectExplorer::Abi(ProjectExplorer::Abi::ARM, ProjectExplorer::Abi::Symbian,
  65. +                                           ProjectExplorer::Abi::Symbian_device,
  66. +                                           ProjectExplorer::Abi::Format_ELF,
  67. +                                           32).toString();
  68. +                break;
  69. +            case 9: // GCC Maemo5
  70. +                abi = ProjectExplorer::Abi(ProjectExplorer::Abi::ARM, ProjectExplorer::Abi::Linux,
  71. +                                           ProjectExplorer::Abi::Linux_maemo,
  72. +                                           ProjectExplorer::Abi::Format_ELF,
  73. +                                           32).toString();
  74. +
  75. +                break;
  76. +            case 14: // GCC Harmattan
  77. +                abi = ProjectExplorer::Abi(ProjectExplorer::Abi::ARM, ProjectExplorer::Abi::Linux,
  78. +                                           ProjectExplorer::Abi::Linux_harmattan,
  79. +                                           ProjectExplorer::Abi::Format_ELF,
  80. +                                           32).toString();
  81. +                break;
  82. +            case 15: // GCC Meego
  83. +                abi = ProjectExplorer::Abi(ProjectExplorer::Abi::ARM, ProjectExplorer::Abi::Linux,
  84. +                                           ProjectExplorer::Abi::Linux_meego,
  85. +                                           ProjectExplorer::Abi::Format_ELF,
  86. +                                           32).toString();
  87. +                break;
  88. +            default:
  89. +                break;
  90. +            }
  91. +            if (abi.isEmpty() || abiToGdbMap.contains(abi))
  92. +                continue;
  93. +
  94. +            abiToGdbMap.insert(abi, binary);
  95. +        }
  96. +    }
  97. +
  98.      gdbMappingChanged = false;
  99.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement