mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-07 12:07:09 +03:00
JTAG debugging script work now. - release
under the build directory, a number of new files will be written with prefixes like flash_dbg_* and dbg_*. These can be used to debug using jtag. the flash_dbg* files will flash the binaries to the dbg target and, if necessary, set the offset for debugging (e.g. when running squeezelite, the debugger needs to know that it's running in an offset that's not the same as recovery). These files can be used in a command like : xtensa-esp32-elf-gdb.exe --command=build/flash_dbg_squeezelite
This commit is contained in:
@@ -30,7 +30,7 @@ function(___output_debug_target bin_name )
|
||||
if( ${CMAKE_MATCH_COUNT} GREATER 0 )
|
||||
set(found_offset "${CMAKE_MATCH_1}")
|
||||
set(found_bin "${CMAKE_MATCH_2}")
|
||||
if( ( "${bin_name}" MATCHES "${found_bin}" ) OR ( "${bin_name}" STREQUAL "_" ) )
|
||||
if( ( "${found_bin}" MATCHES "${bin_name}" ) OR ( "${bin_name}" STREQUAL "_" ) )
|
||||
list(APPEND flash_dbg_cmds "${line_prefix}${found_bin} ${found_offset}")
|
||||
endif()
|
||||
if( ( "${bin_name}" MATCHES "recovery" ) AND ( "${found_bin}" MATCHES "ota_data_initial" ) )
|
||||
@@ -38,7 +38,7 @@ function(___output_debug_target bin_name )
|
||||
list(APPEND flash_dbg_cmds "${line_prefix}${found_bin} ${found_offset}")
|
||||
endif()
|
||||
|
||||
if( ( "${bin_name}" MATCHES "${found_bin}" ) )
|
||||
if( ( "${found_bin}" MATCHES "${bin_name}" ) )
|
||||
list(APPEND dbg_cmds "mon esp32 appoffset ${found_offset}")
|
||||
endif()
|
||||
endif()
|
||||
@@ -58,12 +58,13 @@ function(___output_debug_target bin_name )
|
||||
STRING(REGEX REPLACE ";" "\n" full_flash_dbg_cmds "${full_flash_dbg_cmds}")
|
||||
|
||||
message("Writing: ${debug_file} with ${full_dbg_cmds}")
|
||||
file(GENERATE OUTPUT "${debug_file}" CONTENT "${full_dbg_cmds}")
|
||||
file(WRITE "${debug_file}" "${full_dbg_cmds}")
|
||||
message("Writing: ${flash_debug_file} with : ${full_flash_dbg_cmds}")
|
||||
file(GENERATE OUTPUT "${flash_debug_file}" CONTENT "${full_flash_dbg_cmds}")
|
||||
file(WRITE "${flash_debug_file}" "${full_flash_dbg_cmds}")
|
||||
|
||||
|
||||
endfunction()
|
||||
|
||||
message("Generating debug script files")
|
||||
___output_debug_target("_")
|
||||
___output_debug_target("squeezelite")
|
||||
|
||||
Reference in New Issue
Block a user