---

** [tickets:#158] GDB command "si" crashes OpenOCD for AArch64**

**Status:** new
**Milestone:** 0.9.0
**Created:** Fri Jul 14, 2017 01:51 PM UTC by Yao Qi
**Last Updated:** Fri Jul 14, 2017 01:51 PM UTC
**Owner:** nobody


I start OpenOCD mainline this way,

$ ./src/openocd -d -s ../openocd/tcl -f 
interface/ftdi/dp_busblaster_kt-link.cfg -c adapter_khz 500 -f 
board/lemaker_hikey.cfg

and start GDB to connect to it,

(gdb) target remote :3333
Remote debugging using :3333
_start () at 
/home/yao.qi/SourceCode/abe/build-aarch64-elf/snapshots/newlib.git~linaro-local~linaro-2.4-branch/libgloss/aarch64/crt0.S:136
136     
/home/yao.qi/SourceCode/abe/build-aarch64-elf/snapshots/newlib.git~linaro-local~linaro-2.4-branch/libgloss/aarch64/crt0.S:
 No such file or directory.
(gdb) load
Loading section .note.gnu.build-id, size 0x24 lma 0x400000
Loading section .init, size 0x34 lma 0x400024
Loading section .text, size 0x784 lma 0x400080
Loading section .fini, size 0x34 lma 0x400804
Loading section .rodata, size 0x10 lma 0x400838
Loading section .eh_frame, size 0x4 lma 0x400848
Loading section .init_array, size 0x8 lma 0x410850
Loading section .fini_array, size 0x8 lma 0x410858
Loading section .jcr, size 0x8 lma 0x410860
Loading section .data, size 0x880 lma 0x410868
Start address 0x4001b0, load size 4284
Transfer rate: 38 KB/sec, 428 bytes/write.
(gdb) disassemble 
Dump of assembler code for function _start:
=> 0x00000000004001b0 <+0>:     ldr     x1, 0x400218 <_cpu_init_hook+28>
   0x00000000004001b4 <+4>:     and     x0, x1, #0xfffffffffffffff0
   0x00000000004001b8 <+8>:     mov     sp, x0
   0x00000000004001bc <+12>:    mov     x29, #0x0                       // #0
   0x00000000004001c0 <+16>:    stp     x29, x29, [sp, #-16]!
(gdb) si

Then, OpenOCD crashes.  Here is the stack backtrace,

(gdb) bt
#0  0x00000000004c6186 in mem_ap_setup_csw (ap=ap@entry=0x0, csw=2) at 
../openocd/src/target/arm_adi_v5.c:98
#1  0x00000000004c61e0 in mem_ap_setup_transfer (ap=0x0, csw=<optimised out>, 
tar=784) at ../openocd/src/target/arm_adi_v5.c:145
#2  0x00000000004c719b in mem_ap_read_u32 (ap=0x0, address=788, 
value=0x7fff860fd27c) at ../openocd/src/target/arm_adi_v5.c:173
#3  0x00000000004c71e9 in mem_ap_read_atomic_u32 (ap=0x0, address=<optimised 
out>, value=value@entry=0x7fff860fd27c) at 
../openocd/src/target/arm_adi_v5.c:198
#4  0x00000000004a87a8 in aarch64_check_state_one 
(target=target@entry=0x1776c10, mask=mask@entry=2048, val=val@entry=2048, 
    p_result=p_result@entry=0x7fff860fd2d4, p_prsr=p_prsr@entry=0x7fff860fd2d0) 
at ../openocd/src/target/aarch64.c:266
#5  0x00000000004abe14 in aarch64_step_restart_smp (target=0x1770150) at 
../openocd/src/target/aarch64.c:773
#6  aarch64_step (target=0x1770150, current=1, address=0, 
handle_breakpoints=<optimised out>) at ../openocd/src/target/aarch64.c:1083
#7  0x000000000044c102 in gdb_step_continue_packet (packet=0x87a340 
<gdb_packet_buffer> "s", packet_size=<optimised out>, connection=<optimised 
out>)
    at ../openocd/src/server/gdb_server.c:1568
#8  gdb_input_inner (connection=<optimised out>) at 
../openocd/src/server/gdb_server.c:2914
#9  gdb_input (connection=<optimised out>) at 
../openocd/src/server/gdb_server.c:3018
#10 0x000000000044e27b in server_loop 
(command_context=command_context@entry=0x1731010) at 
../openocd/src/server/server.c:509
#11 0x0000000000405390 in openocd_thread (cmd_ctx=0x1731010, 
argv=0x7fff860fd698, argc=<optimised out>) at ../openocd/src/openocd.c:306
#12 openocd_main (argc=<optimised out>, argv=0x7fff860fd698) at 
../openocd/src/openocd.c:343
#13 0x00007fa62afdbf45 in __libc_start_main (main=0x404c70 <main>, argc=10, 
argv=0x7fff860fd698, init=<optimised out>, fini=<optimised out>, 
    rtld_fini=<optimised out>, stack_end=0x7fff860fd688) at libc-start.c:287
#14 0x0000000000404d65 in _start ()




---

Sent from sourceforge.net because openocd-devel@lists.sourceforge.net is 
subscribed to https://sourceforge.net/p/openocd/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/openocd/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to