Merge pull request #109987 from van800/shakhov/dap-devices

Refactor debugging on a device with DAP - now possible with all device types
This commit is contained in:
Thaddeus Crews 2025-11-12 11:24:10 -06:00
commit afa07c1a76
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
6 changed files with 39 additions and 42 deletions

View file

@ -142,10 +142,20 @@ void EditorExport::remove_export_platform(const Ref<EditorExportPlatform> &p_pla
should_reload_presets = true;
}
int EditorExport::get_export_platform_count() {
int EditorExport::get_export_platform_count() const {
return export_platforms.size();
}
int EditorExport::get_export_platform_index_by_name(const String &p_name) {
for (int j = 0; j < get_export_platform_count(); j++) {
Ref<EditorExportPlatform> plat = get_export_platform(j);
if (!plat.is_null() && plat->get_name().nocasecmp_to(p_name) == 0) {
return j;
}
}
return -1;
}
Ref<EditorExportPlatform> EditorExport::get_export_platform(int p_idx) {
ERR_FAIL_INDEX_V(p_idx, export_platforms.size(), Ref<EditorExportPlatform>());

View file

@ -65,8 +65,14 @@ protected:
public:
static EditorExport *get_singleton() { return singleton; }
// Encodes a platform/device pair into a single menu/device id and decodes it back.
static int encode_platform_device_id(int p_platform_idx, int p_device_idx) { return p_platform_idx * 10000 + p_device_idx; }
static int decode_platform_from_id(int p_id) { return p_id / 10000; }
static int decode_device_from_id(int p_id) { return p_id % 10000; }
void add_export_platform(const Ref<EditorExportPlatform> &p_platform);
int get_export_platform_count();
int get_export_platform_count() const;
int get_export_platform_index_by_name(const String &p_name);
Ref<EditorExportPlatform> get_export_platform(int p_idx);
void remove_export_platform(const Ref<EditorExportPlatform> &p_platform);