diff options
author | Chris Johns <chrisj@rtems.org> | 2022-08-25 14:10:21 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2022-08-25 14:10:21 +1000 |
commit | a932829b01cb375ec9036da03bbe65e48ff82dd6 (patch) | |
tree | 378d6121a2c76b471d03454586f4d9d591dd2583 | |
parent | bsps/xilinx/versal: Add Cadence I2C driver support (diff) | |
download | rtems-a932829b01cb375ec9036da03bbe65e48ff82dd6.tar.bz2 |
libdebugger/aarch64: Set .start section to RW
- Stops the server crashing when setting breakpoints in .start
-rw-r--r-- | cpukit/libdebugger/rtems-debugger-aarch64.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/cpukit/libdebugger/rtems-debugger-aarch64.c b/cpukit/libdebugger/rtems-debugger-aarch64.c index 279c2d61ef..9a53da0de9 100644 --- a/cpukit/libdebugger/rtems-debugger-aarch64.c +++ b/cpukit/libdebugger/rtems-debugger-aarch64.c @@ -34,7 +34,9 @@ #include <inttypes.h> #include <stdlib.h> -/* Defined by linkcmds.base */ +/* Defined by linkcmds.base. This should be taken from <bsp/linker-symbols.h> */ +extern char bsp_section_start_begin[]; +extern char bsp_section_start_end[]; extern char bsp_section_text_begin[]; extern char bsp_section_text_end[]; extern char bsp_section_fast_text_begin[]; @@ -1231,6 +1233,8 @@ static rtems_status_code rtems_debugger_target_set_text_writable( bool writable ) { + uintptr_t start_begin = (uintptr_t) bsp_section_start_begin; + uintptr_t start_end = (uintptr_t) bsp_section_start_end; uintptr_t text_begin = (uintptr_t) bsp_section_text_begin; uintptr_t text_end = (uintptr_t) bsp_section_text_end; uintptr_t fast_text_begin = (uintptr_t) bsp_section_fast_text_begin; @@ -1243,6 +1247,23 @@ static rtems_status_code rtems_debugger_target_set_text_writable( } target_printk( + "[} MMU edit: start_begin: 0x%016" PRIxPTR + " start_end: 0x%016" PRIxPTR "\n", + start_begin, + start_end + ); + sc = aarch64_mmu_map( + start_begin, + start_end - start_begin, + mmu_flags + ); + + if ( sc != RTEMS_SUCCESSFUL ) { + target_printk( "[} MMU edit failed\n" ); + return sc; + } + + target_printk( "[} MMU edit: text_begin: 0x%016" PRIxPTR " text_end: 0x%016" PRIxPTR "\n", text_begin, |