mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-16 09:02:22 -07:00
sketch out simple old-config-loader to just preserve targets/file_path_maps/etc. from 0.9.15 and before
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -292,8 +292,8 @@ RD_VocabTable:
|
||||
//- rjf: visualizers
|
||||
@display_name('Use Default C++ STL Type Visualizers') @description("Enables the built-in type views for C++ STL types.")
|
||||
@default(1) use_default_stl_type_views: bool,
|
||||
@display_name('Use Default Unreal Engine Type Visualizers') @description("Enables the built-in type views for Unreal Engine types.")
|
||||
@default(1) use_default_ue_type_views: bool,
|
||||
// @display_name('Use Default Unreal Engine Type Visualizers') @description("Enables the built-in type views for Unreal Engine types.")
|
||||
// @default(1) use_default_ue_type_views: bool,
|
||||
|
||||
//- rjf: theme
|
||||
@default("None") @display_name('Project Theme') @description("The project's theme, which describes all colors used throughout the UI, and can override the user's theme.")
|
||||
|
||||
@@ -12414,13 +12414,6 @@ rd_frame(void)
|
||||
U64 first_space = str8_find_needle(file_version, 0, str8_lit(" "), 0);
|
||||
file_version = str8_prefix(file_version, first_space);
|
||||
file_version = str8_skip_chop_whitespace(file_version);
|
||||
String8 current_version = str8_lit(BUILD_VERSION_STRING_LITERAL);
|
||||
if(!str8_match(file_version, current_version, 0))
|
||||
{
|
||||
String8 msg = push_str8f(scratch.arena, "You are trying to run a new development version of RADDBG (%S) with old configuration files. This would overwrite your old configuration files, since the code to appropriately handle old configuration files hasn't been written yet. Out of caution, the program will now exit. If you want to use this new version anyway, delete or rename your configuration file at %S, so that the new development version can begin safely saving to it.", current_version, file_path);
|
||||
os_graphical_message(1, str8_lit("Unsupported Configuration File Version"), msg);
|
||||
os_abort(1);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: bad file -> alert user
|
||||
@@ -12439,7 +12432,16 @@ rd_frame(void)
|
||||
RD_CfgList file_cfg_list = {0};
|
||||
if(file_is_okay)
|
||||
{
|
||||
file_cfg_list = rd_cfg_tree_list_from_string(scratch.arena, file_path, file_data);
|
||||
String8 current_version = str8_lit(BUILD_VERSION_STRING_LITERAL);
|
||||
if(!str8_match(file_version, current_version, 0))
|
||||
{
|
||||
RD_CfgList (*legacy_parse_function)(Arena *arena, String8 file_path, String8 data) = rd_cfg_tree_list_from_string__pre_0_9_16;
|
||||
file_cfg_list = legacy_parse_function(scratch.arena, file_path, file_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
file_cfg_list = rd_cfg_tree_list_from_string(scratch.arena, file_path, file_data);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: store path
|
||||
|
||||
@@ -5,3 +5,4 @@
|
||||
#include "raddbg_eval.c"
|
||||
#include "raddbg_widgets.c"
|
||||
#include "raddbg_views.c"
|
||||
#include "raddbg_legacy_config.c"
|
||||
|
||||
@@ -8,5 +8,6 @@
|
||||
#include "raddbg_eval.h"
|
||||
#include "raddbg_widgets.h"
|
||||
#include "raddbg_views.h"
|
||||
#include "raddbg_legacy_config.h"
|
||||
|
||||
#endif // RADDBG_INC_H
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
internal RD_CfgList
|
||||
rd_cfg_tree_list_from_string__pre_0_9_16(Arena *arena, String8 file_path, String8 data)
|
||||
{
|
||||
RD_CfgList result = {0};
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
MD_Node *src_root = md_parse_from_text(scratch.arena, file_path, data).root;
|
||||
{
|
||||
for MD_EachNode(tln, src_root->first)
|
||||
{
|
||||
//- rjf: targets
|
||||
if(str8_match(tln->string, str8_lit("target"), 0))
|
||||
{
|
||||
String8 disabled_string = md_child_from_string(tln, str8_lit("disabled"), 0)->first->string;
|
||||
String8 executable = md_child_from_string(tln, str8_lit("executable"), 0)->first->string;
|
||||
String8 arguments = md_child_from_string(tln, str8_lit("arguments"), 0)->first->string;
|
||||
String8 working_directory = md_child_from_string(tln, str8_lit("working_directory"), 0)->first->string;
|
||||
String8 entry_point = md_child_from_string(tln, str8_lit("entry_point"), 0)->first->string;
|
||||
String8 stdout_path = md_child_from_string(tln, str8_lit("stdout_path"), 0)->first->string;
|
||||
String8 stderr_path = md_child_from_string(tln, str8_lit("stderr_path"), 0)->first->string;
|
||||
String8 stdin_path = md_child_from_string(tln, str8_lit("stdin_path"), 0)->first->string;
|
||||
String8 debug_subprocesses= md_child_from_string(tln, str8_lit("debug_subprocesses"), 0)->first->string;
|
||||
RD_Cfg *dst_root = rd_cfg_new(&rd_nil_cfg, str8_lit("target"));
|
||||
rd_cfg_list_push(arena, &result, dst_root);
|
||||
{
|
||||
if(executable.size != 0) { rd_cfg_new(rd_cfg_new(dst_root, str8_lit("executable")), path_absolute_dst_from_relative_dst_src(scratch.arena, executable, file_path)); }
|
||||
if(arguments.size != 0) { rd_cfg_new(rd_cfg_new(dst_root, str8_lit("arguments")), raw_from_escaped_str8(scratch.arena, arguments)); }
|
||||
if(working_directory.size != 0) { rd_cfg_new(rd_cfg_new(dst_root, str8_lit("working_directory")), path_absolute_dst_from_relative_dst_src(scratch.arena, working_directory, file_path)); }
|
||||
if(entry_point.size != 0) { rd_cfg_new(rd_cfg_new(dst_root, str8_lit("entry_point")), raw_from_escaped_str8(scratch.arena, entry_point)); }
|
||||
if(stdout_path.size != 0) { rd_cfg_new(rd_cfg_new(dst_root, str8_lit("stdout_path")), path_absolute_dst_from_relative_dst_src(scratch.arena, stdout_path, file_path)); }
|
||||
if(stderr_path.size != 0) { rd_cfg_new(rd_cfg_new(dst_root, str8_lit("stderr_path")), path_absolute_dst_from_relative_dst_src(scratch.arena, stderr_path, file_path)); }
|
||||
if(stdin_path.size != 0) { rd_cfg_new(rd_cfg_new(dst_root, str8_lit("stdin_path")), path_absolute_dst_from_relative_dst_src(scratch.arena, stdin_path, file_path)); }
|
||||
if(debug_subprocesses.size != 0) { rd_cfg_new(rd_cfg_new(dst_root, str8_lit("debug_subprocesses")), raw_from_escaped_str8(scratch.arena, debug_subprocesses)); }
|
||||
if(!str8_match(disabled_string, str8_lit("1"), 0))
|
||||
{
|
||||
rd_cfg_new(rd_cfg_new(dst_root, str8_lit("enabled")), str8_lit("1"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: recent files / projects
|
||||
if(str8_match(tln->string, str8_lit("recent_file"), 0) ||
|
||||
str8_match(tln->string, str8_lit("recent_project"), 0))
|
||||
{
|
||||
RD_Cfg *dst_root = rd_cfg_new(&rd_nil_cfg, tln->string);
|
||||
rd_cfg_list_push(arena, &result, dst_root);
|
||||
rd_cfg_new(rd_cfg_new(dst_root, str8_lit("path")), path_absolute_dst_from_relative_dst_src(scratch.arena, tln->first->string, file_path));
|
||||
}
|
||||
|
||||
//- rjf: file path maps
|
||||
if(str8_match(tln->string, str8_lit("file_path_map"), 0))
|
||||
{
|
||||
String8 source = md_child_from_string(tln, str8_lit("source"), 0)->first->string;
|
||||
String8 dest = md_child_from_string(tln, str8_lit("dest"), 0)->first->string;
|
||||
RD_Cfg *dst_root = rd_cfg_new(&rd_nil_cfg, tln->string);
|
||||
rd_cfg_list_push(arena, &result, dst_root);
|
||||
rd_cfg_new(rd_cfg_new(dst_root, str8_lit("source")), path_absolute_dst_from_relative_dst_src(scratch.arena, source, file_path));
|
||||
rd_cfg_new(rd_cfg_new(dst_root, str8_lit("dest")), path_absolute_dst_from_relative_dst_src(scratch.arena, dest, file_path));
|
||||
}
|
||||
}
|
||||
}
|
||||
scratch_end(scratch);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#ifndef RADDBG_LEGACY_CONFIG_H
|
||||
#define RADDBG_LEGACY_CONFIG_H
|
||||
|
||||
internal RD_CfgList rd_cfg_tree_list_from_string__pre_0_9_16(Arena *arena, String8 file_path, String8 data);
|
||||
|
||||
#endif // RADDBG_LEGACY_CONFIG_H
|
||||
Reference in New Issue
Block a user