From 293bd9a0df3e0d6b5dc928d79b8261d0adebaac1 Mon Sep 17 00:00:00 2001 From: GuyBrush Date: Tue, 28 Nov 2023 11:26:29 +0100 Subject: [PATCH] fix(tools): fix path delimiter in gdbinit for Windows Merges https://github.com/espressif/esp-idf/pull/12683 Signed-off-by: Alexey Lapshin --- tools/idf_py_actions/debug_ext.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/idf_py_actions/debug_ext.py b/tools/idf_py_actions/debug_ext.py index 3209ba3f243..f319d023fae 100644 --- a/tools/idf_py_actions/debug_ext.py +++ b/tools/idf_py_actions/debug_ext.py @@ -256,7 +256,7 @@ def generate_gdbinit_files(gdb: str, gdbinit: Optional[str], project_desc: Dict[ raise FatalError('ELF file not found. You need to build & flash the project before running debug targets') # Recreate empty 'gdbinit' directory - gdbinit_dir = os.path.join(project_desc['build_dir'], 'gdbinit') + gdbinit_dir = '/'.join([project_desc['build_dir'], 'gdbinit']) if os.path.isfile(gdbinit_dir): os.remove(gdbinit_dir) elif os.path.isdir(gdbinit_dir): @@ -264,7 +264,7 @@ def generate_gdbinit_files(gdb: str, gdbinit: Optional[str], project_desc: Dict[ os.mkdir(gdbinit_dir) # Prepare gdbinit for Python GDB extensions import - py_extensions = os.path.join(gdbinit_dir, 'py_extensions') + py_extensions = '/'.join([gdbinit_dir, 'py_extensions']) with open(py_extensions, 'w') as f: if is_gdb_with_python(gdb): f.write(GDBINIT_PYTHON_TEMPLATE.format(sys_path=sys.path)) @@ -272,7 +272,7 @@ def generate_gdbinit_files(gdb: str, gdbinit: Optional[str], project_desc: Dict[ f.write(GDBINIT_PYTHON_NOT_SUPPORTED) # Prepare gdbinit for related ELFs symbols load - symbols = os.path.join(gdbinit_dir, 'symbols') + symbols = '/'.join([gdbinit_dir, 'symbols']) with open(symbols, 'w') as f: boot_elf = get_normalized_path(project_desc['bootloader_elf']) if 'bootloader_elf' in project_desc else None if boot_elf and os.path.exists(boot_elf): @@ -284,7 +284,7 @@ def generate_gdbinit_files(gdb: str, gdbinit: Optional[str], project_desc: Dict[ # Generate the gdbinit for target connect if no custom gdbinit is present if not gdbinit: - gdbinit = os.path.join(gdbinit_dir, 'connect') + gdbinit = '/'.join([gdbinit_dir, 'connect']) with open(gdbinit, 'w') as f: f.write(GDBINIT_CONNECT)