idf.py: gdb action incorrectly generated EOL gdbinit scripts

GDB on Windows incorrectly reads EOL in the script files causing 'gdb'
action to fail.

(gdb) source .../build/gdbinit/py_extensions
(gdb) source .../build\gdbinit\symbols
add symbol table from file "...\build\bootloader\bootloader.elf"
.../build\gdbinit\symbols:6: Error in sourced command file:
Undefined command: "".  Try "help".

Forcing line separator to '\n' resolved the issue

Signed-off-by: Michal Jenikovsky <jendo@jmsystems.sk>
This commit is contained in:
Michal Jenikovsky 2023-08-10 11:52:24 +02:00 committed by Adam Múdry
parent 6b1f40b9bf
commit 31b4b0a8d4

View File

@ -270,7 +270,7 @@ def action_extensions(base_actions: Dict, project_path: str) -> Dict:
r.append('set confirm on')
r.append('end')
r.append('')
return os.linesep.join(r)
return '\n'.join(r)
raise FatalError(f'{ESP_ROM_INFO_FILE} file not found. Please check IDF integrity.')
def generate_gdbinit_files(gdb: str, gdbinit: Optional[str], project_desc: Dict[str, Any]) -> None: