[RTEMS Project] #3733: Add general reg support to libdebugger

RTEMS trac trac at rtems.org
Sat Apr 6 00:43:24 UTC 2019


#3733: Add general reg support to libdebugger
--------------------------+--------------------------
 Reporter:  Chris Johns   |       Owner:  Chris Johns
     Type:  enhancement   |      Status:  accepted
 Priority:  normal        |   Milestone:  5.1
Component:  lib/debugger  |     Version:  5
 Severity:  normal        |  Resolution:
 Keywords:                |  Blocked By:
 Blocking:                |
--------------------------+--------------------------

Comment (by Chris Johns):

 Adding support for offsets to the ARM backend has things working. The
 following is with master RSB, kernel and libbsd:
 {{{
  $ /opt/work/rtems/5/bin/arm-rtems5-gdb ./build/arm-rtems5
 -xilinx_zynq_zedboard-default/debugger01.exe
 GNU gdb (GDB) 8.2.1
 Copyright (C) 2018 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=x86_64-freebsd11.2 --target=arm-
 rtems5".
 Type "show configuration" for configuration details.
 For bug reporting instructions, please see:
 <http://www.gnu.org/software/gdb/bugs/>.
 Find the GDB manual and other documentation resources online at:
     <http://www.gnu.org/software/gdb/documentation/>.
 For help, type "help".
 Type "apropos word" to search for commands related to "word"...
 Reading symbols from ./build/arm-rtems5-xilinx_zynq_zedboard-
 default/debugger01.exe...done.
 (gdb) target remote 10.10.5.45:1122
 Remote debugging using 10.10.5.45:1122
 0x00000030 in ?? ()
 (gdb) info threads
   Id   Target Id
 Frame
 * 1    Thread 1.167837697 (UI1  (0a010001), priority(c:508 r:508),
 stack(s: 32768 a:0x44dda0), state(TIME:SUSP:IS)) 0x00000030 in ?? ()
   2    Thread 1.167837698 (SHLL (0a010002), priority(c:  2 r:  2),
 stack(s: 32768 a:0x456590), state(SEM:SUSP))     arm_interrupt_disable ()
 at
 /opt/work/chris/rtems/kernel/rtems.git/cpukit/score/cpu/arm/include/rtems/score/cpu.h:299
 (gdb) info reg
 r0             0x2c7184            2912644
 r1             0x2c7184            2912644
 r2             0x2c7184            2912644
 r3             0x2c7184            2912644
 r4             0x30be70            3194480
 r5             0x40e660            4253280
 r6             0x7184be70          1904524912
 r7             0x7184002c          1904476204
 r8             0x7184002c          1904476204
 r9             0x7184002c          1904476204
 r10            0xbe70002c          3195011116
 r11            0xea680030          3932684336
 r12            0xbe700040          3195011136
 sp             0xc5000030          0xc5000030
 lr             0xbe6c0044          3194748996
 pc             0x30                0x30
 cpsr           0x0                 0
 (gdb) thread 2
 [Switching to thread 2 (Thread 1.167837698)]
 #0  arm_interrupt_disable () at
 /opt/work/chris/rtems/kernel/rtems.git/cpukit/score/cpu/arm/include/rtems/score/cpu.h:299
 299       __asm__ volatile (
 (gdb) bt
 #0  arm_interrupt_disable () at
 /opt/work/chris/rtems/kernel/rtems.git/cpukit/score/cpu/arm/include/rtems/score/cpu.h:299
 #1  _Thread_Do_dispatch (cpu_self=<optimized out>, level=<optimized out>)
 at
 /opt/work/chris/rtems/kernel/rtems.git/c/src/../../cpukit/score/src/threaddispatch.c:309
 #2  0x0022d09a in _Semaphore_Wait_timed_ticks (_sem=_sem at entry=0x455e38,
 ticks=ticks at entry=0) at
 /opt/work/chris/rtems/kernel/rtems.git/c/src/../../cpukit/score/src/semaphore.c:100
 #3  0x002254fa in rtems_binary_semaphore_wait_timed_ticks (ticks=0,
 binary_semaphore=0x455e38) at
 /opt/work/chris/rtems/kernel/rtems.git/cpukit/include/rtems/thread.h:263
 #4  fillBufferQueue (tty=0x455da8) at
 /opt/work/chris/rtems/kernel/rtems.git/c/src/../../cpukit/libcsupport/src/termios.c:1509
 #5  rtems_termios_read_tty (tty=tty at entry=0x455da8,
 buffer=buffer at entry=0x44c94b <__sf+67> "\r",
 initial_count=initial_count at entry=1) at
 /opt/work/chris/rtems/kernel/rtems.git/c/src/../../cpukit/libcsupport/src/termios.c:1538
 #6  0x0022562c in rtems_termios_imfs_read (iop=0x41aec8
 <rtems_libio_iops>, buffer=0x44c94b <__sf+67>, count=1) at
 /opt/work/chris/rtems/kernel/rtems.git/c/src/../../cpukit/libcsupport/src/termios.c:2052
 #7  0x00223be8 in read (fd=<optimized out>, buffer=<optimized out>,
 count=<optimized out>) at
 /opt/work/chris/rtems/kernel/rtems.git/c/src/../../cpukit/libcsupport/src/read.c:44
 #8  0x00241c12 in __sread (ptr=<optimized out>, cookie=0x44c908 <__sf>,
 buf=<optimized out>, n=<optimized out>) at
 ../../../../../../../../../gcc-7.4.0/newlib/libc/stdio/stdio.c:47
 #9  0x00241782 in __srefill_r (ptr=ptr at entry=0x40ed18
 <_RTEMS_tasks_Objects+1720>, fp=fp at entry=0x44c908 <__sf>) at
 ../../../../../../../../../gcc-7.4.0/newlib/libc/stdio/refill.c:117
 #10 0x0024188c in __srget_r (ptr=ptr at entry=0x40ed18
 <_RTEMS_tasks_Objects+1720>, fp=fp at entry=0x44c908 <__sf>) at
 ../../../../../../../../../gcc-7.4.0/newlib/libc/stdio/rget.c:42
 #11 0x0023abfc in fgetc (fp=fp at entry=0x44c908 <__sf>) at
 ../../../../../../../../../gcc-7.4.0/newlib/libc/stdio/fgetc.c:110
 #12 0x00232858 in rtems_shell_getchar (in=in at entry=0x44c908 <__sf>) at
 /opt/work/chris/rtems/kernel/rtems.git/c/src/../../cpukit/libmisc/shell/shell_getchar.c:123
 #13 0x00231704 in rtems_shell_line_editor (size=128, out=0x44c988
 <__sf+128>, in=0x44c908 <__sf>, prompt=<optimized out>, count=<optimized
 out>, cmds=0x45e360) at
 /opt/work/chris/rtems/kernel/rtems.git/c/src/../../cpukit/libmisc/shell/shell.c:225
 #14 rtems_shell_main_loop (shell_env_arg=<optimized out>) at
 /opt/work/chris/rtems/kernel/rtems.git/c/src/../../cpukit/libmisc/shell/shell.c:880
 #15 0x0023255e in rtems_shell_task (task_argument=<optimized out>) at
 /opt/work/chris/rtems/kernel/rtems.git/c/src/../../cpukit/libmisc/shell/shell.c:679
 #16 0x0022ad3a in _Thread_Handler () at
 /opt/work/chris/rtems/kernel/rtems.git/c/src/../../cpukit/score/src/threadhandler.c:135
 #17 0x0022abbc in _Thread_Do_dispatch (cpu_self=<optimized out>,
 level=<optimized out>) at
 /opt/work/chris/rtems/kernel/rtems.git/c/src/../../cpukit/score/src/threaddispatch.c:299
 #18 0x00000000 in ?? ()
 Backtrace stopped: previous frame identical to this frame (corrupt stack?)
 (gdb)
 }}}

--
Ticket URL: <http://devel.rtems.org/ticket/3733#comment:2>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list