From 8b68b39198105dd78c81c23ad62ecff6ab58b953 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 aa17627066..df7cc55a61 100644 --- a/tools/idf_py_actions/debug_ext.py +++ b/tools/idf_py_actions/debug_ext.py @@ -307,7 +307,7 @@ def action_extensions(base_actions: Dict, project_path: str) -> 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): @@ -315,7 +315,7 @@ def action_extensions(base_actions: Dict, project_path: str) -> 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)) @@ -323,7 +323,7 @@ def action_extensions(base_actions: Dict, project_path: str) -> 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): @@ -335,7 +335,7 @@ def action_extensions(base_actions: Dict, project_path: str) -> 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)