W dniu 2012-05-09 03:58, Peter Stuge pisze:
> Freddie Chopin wrote:
>> I started OpenOCD (current master) with -rtos FreeRTOS.
>
> Can you still reproduce the crash?
>
> If yes, can you please provide a backtrace of openocd on crash?

It does not crash now, but I use different GDB now (the most recent 
linaro toolchain), and now OpenOCD says:
> (gdb) target remote localhost:3333
> Remote debugging using localhost:3333
> Remote 'g' packet reply is too long: 
> 0000000000000000000000000000000000000000000
> 00000000000000000000000000000000000000000000000000000000000000000000000000000010
> 00000000000000000000000000000000000000000000000000000000000000000000000000000000
> 00000000000000000000000000000000000000000000000000000000000000000000000000000000
> 00000000000000000000000000000000000000000000000000000

It also does not crash with -rtos auto.

This GDB version:
> GNU gdb (GNU Tools for ARM Embedded Processors) 7.3.1.20120316-cvs
> Copyright (C) 2011 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "--host=i586-mingw32 --target=arm-none-eabi".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.

However I also tried with CodeSourcery's GDB (a little older) and 
OpenOCD crashes after connecting with GDB.

GDB:

> (gdb) target remote localhost:3333
> Remote debugging using localhost:3333
> 0x00000000 in vectors ()
> Ignoring packet error, continuing...
> Ignoring packet error, continuing...
> Bogus trace status reply from target: timeout
> (gdb)

OpenOCD:

> d:\VirtualBox\Ubuntu\shared\master\tcl\bin>openocd -f interface/jtagkey.cfg 
> -fta
> rget/lpc1768.cfg -c "reset_config trst_and_srst; adapter_khz 500"
> Open On-Chip Debugger 0.6.0-dev-00549-g47cf0aa (2012-05-08-22:20)
> Licensed under GNU GPL v2
> For bug reports, read
>         http://openocd.sourceforge.net/doc/doxygen/bugs.html
> Info : only one transport option; autoselect 'jtag'
> adapter_nsrst_delay: 200
> jtag_ntrst_delay: 200
> 10 kHz
> trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
> 500 kHz
> Info : clock speed 500 kHz
> Info : JTAG tap: lpc1768.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 
> 0xb
> a00, ver: 0x4)
> Info : lpc1768.cpu: hardware has 6 breakpoints, 4 watchpoints
> Info : accepting 'gdb' connection from 3333
> Warn : acknowledgment received, but no packet pending
> undefined debug reason 6 - target needs reset

OpenOCD in GDB:

> Program received signal SIGSEGV, Segmentation fault.
> __mingw_sformat (s=0x22e870, format=Unhandled dwarf expression opcode 0xf3
> )
>     at ../../../build/mingw/mingw-w64-crt/stdio/mingw_vfscanf.c:1569
> 1569    ../../../build/mingw/mingw-w64-crt/stdio/mingw_vfscanf.c: No such 
> file o
> r directory.
>         in ../../../build/mingw/mingw-w64-crt/stdio/mingw_vfscanf.c

Backtrace:

> (gdb) bt full
> #0  __mingw_sformat (s=0x22e870, format=Unhandled dwarf expression opcode 0xf3
> )
>     at ../../../build/mingw/mingw-w64-crt/stdio/mingw_vfscanf.c:1569
>         f = <value optimized out>
>         gcollect = 0x0
>         read_in = 53
>         wbuf_max_sz = 0
>         cnt = <value optimized out>
>         str_sz = 0
>         str = 0xda029d "đ­ş\rđ­şî", '«' <repeats 16 times>, 
> "ţîţîţîţîţîţîţîţîţîţ
> îţîţîţîţ"
>         pstr = 0x0
>         wbuf = 0x0
>         wstr = 0x0
>         rval = 0
>         c = -1
>         ignore_ws = 0
>         arg = 0x22f8f8 "JŹ\004"
>         fc = <value optimized out>
>         npos = <value optimized out>
>         width = <value optimized out>
>         flags = <value optimized out>
>         base = 0
>         errno_sv = <value optimized out>
>         wbuf_cur_sz = 0
>         read_in_sv = <value optimized out>
>         new_sz = <value optimized out>
>         n = <value optimized out>
>         seen_dot = <value optimized out>
>         seen_exp = <value optimized out>
>         is_neg = <value optimized out>
>         not_in = <value optimized out>
>         tmp_wbuf_ptr = 0x200000000007f <Address 0x200000000007f out of bounds>
>         buf = "ŕ\033Ë\002"
>         lc_decimal_point = 0x7fefe882590 "."
>         lc_thousands_sep = 0x0
>         state = 0
>         cstate = 0
>         cv_val = {ull = 4294967296, ul = 0, ll = 4294967296, l = 0}
> #1  0x0000000000505b18 in __mingw_vsscanf (s=Unhandled dwarf expression 
> opcode 0
> xf3
> )
>     at ../../../build/mingw/mingw-w64-crt/stdio/mingw_vfscanf.c:1606
>         ifp = {{fp = 0x5841d5, str = 0x5841d5 ""}, bch = {53,
>             0 <repeats 1023 times>}, is_string = -1, back_top = 0,
>           seen_eof = -1}
> #2  0x00000000004ff13d in __mingw_sscanf (buf=Unhandled dwarf expression 
> opcode
> 0xf3
> )
>     at ../../../build/mingw/mingw-w64-crt/stdio/mingw_sscanf.c:15
>         argp = 0x22f8f0 "p\002Ú"
>         r = 14287517
> #3  0x000000000044e642 in rtos_qsymbol (connection=0xda4870,
>     packet=<value optimized out>, packet_size=Unhandled dwarf expression 
> opcode
> 0xf3
> )
>     at ../../../src/rtos/rtos.c:160
>         value = 0
>         hex_name_str = 0xda0270 "5f74785f7468726561645f63757272656e745f707472"
>         name_str = <value optimized out>
>         symbol_num = <value optimized out>
>         found = <value optimized out>
>         next_symbol_num = -1
>         symbols_done = <value optimized out>
>         target = 0xda49d0
>         __func__ = "rtos_qsymbol"
> #4  0x000000000044ec02 in rtos_thread_packet (connection=0xda4870,
>     packet=0x5841a0 "qSymbol::5f74785f7468726561645f63757272656e745f707472",
>     packet_size=53) at ../../../src/rtos/rtos.c:288
>         target = 0xda49d0
> #5  0x0000000000413817 in gdb_input_inner (connection=Unhandled dwarf 
> expression
>  opcode 0xf3
> )
>     at ../../../src/server/gdb_server.c:2064
>         gdb_service = 0xd8bb90
>         packet = 0x5841a0 
> "qSymbol::5f74785f7468726561645f63757272656e745f707472
> "
>         retval = 0
>         gdb_packet_buffer = 
> "qSymbol::5f74785f7468726561645f63757272656e745f7074
> 72", '\000' <repeats 16330 times>
>         target = 0xda49d0
>         packet_size = 53
>         gdb_con = 0xdf1250
>         extended_protocol = 0
> #6  gdb_input (connection=Unhandled dwarf expression opcode 0xf3
> ) at ../../../src/server/gdb_server.c:2241
>         gdb_con = <value optimized out>
> #7  0x0000000000415e66 in server_loop (command_context=0x374c00)
>     at ../../../src/server/server.c:462
>         c = <value optimized out>
>         tv = {tv_sec = 0, tv_usec = 100000}
>         msg = {hwnd = 0x2, message = 5081861, wParam = 0, lParam = 3624032,
>           time = 0, pt = {x = 0, y = -25227064}}
>         service = 0xdd8050
>         poll_ok = true
>         read_fds = {fd_count = 1, fd_array = {172, 156, 168, 164, 172,
>             3624032, 0, 0, 5069405, 0, 14012144, 3624032, 5138403, 3624032,
>             5079385, 3624344, 14204928, 46863984, 0, 3624032, 0, 5394997,
>             3613824, 3624032, 4247135, 0, 0, 4294967296, 0, 0, 0, 156,
>             4294967292, 0, 4572624, 1, 8791763616503, 42097936, 1, 0,
>             15339936, 0, 4283109, 14299648, 8791763639600, 0, 4572624, 4,
>             3613824, 8, 19086834663425, 4295098368, 14205652, 14129344,
>             14129345, 5502023, 5432661, 3613824, 4573227, 14129344, 14129345,
>             0, 3613824, 4570240}}
>         fd_max = <value optimized out>
>         retval = <value optimized out>
>         __func__ = "server_loop"
> #8  0x0000000000401ab7 in openocd_thread (argc=5, argv=0x372480)
>     at ../../src/openocd.c:295
>         ret = 0
> #9  openocd_main (argc=5, argv=0x372480) at ../../src/openocd.c:328
>         cmd_ctx = 0x374c00
>         __func__ = "openocd_main"
> #10 0x00000000004013e0 in __tmainCRTStartup ()
>     at ../../../build/mingw/mingw-w64-crt/crt/crtexe.c:305
>         lock_free = <value optimized out>
>         fiberid = <value optimized out>
>         nested = <value optimized out>
>         lpszCommandLine = <value optimized out>
>         StartupInfo = {cb = 0, lpReserved = 0x0, lpDesktop = 0x0,
>           lpTitle = 0x0, dwX = 0, dwY = 0, dwXSize = 0, dwYSize = 0,
>           dwXCountChars = 0, dwYCountChars = 0, dwFillAttribute = 0,
>           dwFlags = 0, wShowWindow = 0, cbReserved2 = 0, lpReserved2 = 0x0,
>           hStdInput = 0x0, hStdOutput = 0x0, hStdError = 0x0}
>         inDoubleQuote = <value optimized out>
> #11 0x0000000000401548 in mainCRTStartup ()
>     at ../../../build/mingw/mingw-w64-crt/crt/crtexe.c:193
>         ret = 255

The option of "-rtos" switch does not matter at all, but the problem is 
RTOS related, because when I remove "-rtos ..." it works without problems...

This GDB is:

> GNU gdb (Sourcery CodeBench Lite 2011.09-69) 7.2.50.20100908-cvs
> Copyright (C) 2010 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "--host=i686-mingw32 --target=arm-none-eabi".
> For bug reporting instructions, please see:
> <https://support.codesourcery.com/GNUToolchain/>.

I hope that it helps a bit to make RTOS support work for me too...

BTW I see that OpenOCD does not want to work with GDB new via command 
line, but it works perfectly fine via Eclipse's GDB Hardware Debugging...

4\/3!!

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to