#3766: potential patch to libbsp/shared/gdbstub/rtems-stub-glue.c for gdb NONSTOP mode ---------------------------+-------------------- Reporter: Jeffrey Hill | Owner: (none) Type: enhancement | Status: new Priority: normal | Milestone: Component: bsps | Version: Severity: minor | Keywords: Blocked By: | Blocking: ---------------------------+-------------------- FWIW, I am reviewing this change I made to the shared gdb stub, and perhaps it can be considered to be a good idea if supporting newer gdb modes where the threads are not all of them stopped when gdb is looking at the system.
This is against a pre-release RTEMS 4.11 in function rtems_gdb_stub_get_thread_regs {{{ diff --git a/c/src/lib/libbsp/shared/gdbstub/rtems-stub-glue.c b/c/src/lib/libbsp/shared/gdbstub/rtems-stub-glue.c index 06dfc8a..98fd509 100644 --- a/c/src/lib/libbsp/shared/gdbstub/rtems-stub-glue.c +++ b/c/src/lib/libbsp/shared/gdbstub/rtems-stub-glue.c @@ -278,16 +278,21 @@ int rtems_gdb_stub_get_thread_regs( unsigned int *registers ) { - Thread_Control *th; - - th= rtems_gdb_index_to_stub_id(thread); - - if( th ) - { - rtems_gdb_stub_get_registers_from_context( registers, th ); - return 1; - } - return 0; + bool success = false; + Thread_Control * const pThrUnlocked = rtems_gdb_index_to_stub_id ( thread ); + if ( pThrUnlocked ) { + Objects_Locations loc; + Thread_Control * const pThr = + _Thread_Get ( pThrUnlocked->Object.id, &loc ); + if( pThr && loc == OBJECTS_LOCAL ) { + if ( pThr != _Thread_Executing ) { + rtems_gdb_stub_get_registers_from_context( registers, pThr ); + success = true; + } + _Thread_Enable_dispatch (); + } + } + return success; } /* Set thread registers, return 0 if thread does not }}} -- Ticket URL: <http://devel.rtems.org/ticket/3766> RTEMS Project <http://www.rtems.org/> RTEMS Project
_______________________________________________ bugs mailing list bugs@rtems.org http://lists.rtems.org/mailman/listinfo/bugs