1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-13 05:06:30 +04:00

fbt/ufbt: Ensure POSIX paths are passed to GDB on all platforms (#3360)

* fbt/ufbt: Ensure POSIX paths are passed to GDB on all platforms
  GDB heavily dislikes forward slashes from Windows paths and strips
  them internally instead of normalizing them. Account for this by
  passing POSIX paths explicitly.
* fbt: different approach for posix path handling
* fbt, ufbt: further fixes for path handling
* fbt: explicit path stringification
* linter fixes

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Silent
2024-03-20 23:36:38 +01:00
committed by GitHub
parent 0c465f7eb3
commit 4039ccbcca
6 changed files with 53 additions and 33 deletions

View File

@@ -18,7 +18,7 @@ def GetDevices(env):
def generate(env, **kw):
env.AddMethod(GetDevices)
env.SetDefault(
FBT_DEBUG_DIR="${FBT_SCRIPT_DIR}/debug",
FBT_DEBUG_DIR="${POSIXPATH('$FBT_SCRIPT_DIR')}/debug",
)
if (adapter_serial := env.subst("$SWD_TRANSPORT_SERIAL")) != "auto":
@@ -36,11 +36,11 @@ def generate(env, **kw):
env.SetDefault(
OPENOCD_GDB_PIPE=[
"|openocd -c 'gdb_port pipe; log_output ${FBT_DEBUG_DIR}/openocd.log' ${[SINGLEQUOTEFUNC(OPENOCD_OPTS)]}"
"|openocd -c 'gdb_port pipe; log_output ${POSIXPATH('$FBT_DEBUG_DIR')}/openocd.log' ${[SINGLEQUOTEFUNC(OPENOCD_OPTS)]}"
],
GDBOPTS_BASE=[
"-ex",
"source ${FBT_DEBUG_DIR}/gdbinit",
"source ${POSIXPATH('$FBT_DEBUG_DIR')}/gdbinit",
"-ex",
"target extended-remote ${GDBREMOTE}",
],
@@ -57,17 +57,17 @@ def generate(env, **kw):
],
GDBPYOPTS=[
"-ex",
"source ${FBT_DEBUG_DIR}/FreeRTOS/FreeRTOS.py",
"source ${POSIXPATH('$FBT_DEBUG_DIR')}/FreeRTOS/FreeRTOS.py",
"-ex",
"source ${FBT_DEBUG_DIR}/flipperapps.py",
"source ${POSIXPATH('$FBT_DEBUG_DIR')}/flipperapps.py",
"-ex",
"source ${FBT_DEBUG_DIR}/flipperversion.py",
"source ${POSIXPATH('$FBT_DEBUG_DIR')}/flipperversion.py",
"-ex",
"fap-set-debug-elf-root ${FBT_FAP_DEBUG_ELF_ROOT}",
"fap-set-debug-elf-root ${POSIXPATH('$FBT_FAP_DEBUG_ELF_ROOT')}",
"-ex",
"source ${FBT_DEBUG_DIR}/PyCortexMDebug/PyCortexMDebug.py",
"source ${POSIXPATH('$FBT_DEBUG_DIR')}/PyCortexMDebug/PyCortexMDebug.py",
"-ex",
"svd_load ${SVD_FILE}",
"svd_load ${POSIXPATH('$SVD_FILE')}",
"-ex",
"compare-sections",
"-ex",