#2879 closed defect (fixed)

src/cpukit/libdebugger/rtems-debugger-server.c: four problems

Reported by: David Binderman Owned by: Chris Johns
Priority: normal Milestone: 5.1
Component: score Version: 5
Severity: normal Keywords:
Cc: Blocked By:

Description (last modified by Chris Johns)


src/cpukit/libdebugger/rtems-debugger-server.c:1306]: (style) Redundant condition: extended. '!extended || (extended && check_pid(pid))' is equivalent to '!extended || check_pid(pid)'

Suggest simplify.


src/cpukit/libdebugger/rtems-debugger-server.c:1858]: (warning) Possible null pointer dereference: rtems_debugger

Source code is

  if (r < 0) {
    rtems_printf(printer, "error: rtems-db: remote begin: %s: %s\n",
                 rtems_debugger->remote->name, strerror(errno));
    rtems_debugger = NULL;

   * Reset at the end of the session.
  rtems_debugger->flags = 0;

Suggest adding return -1 inside the if.


src/cpukit/libdebugger/rtems-debugger-server.c:906]: (style) Redundant condition: extended. '!extended || (extended && check_pid(pid))' is equivalent to '!extended || check_pid(pid)'



src/cpukit/libdebugger/rtems-debugger-server.c:956]: (warning) Char literal compared with pointer 'p'. Did you intend to dereference it?

Source code is

  while (p != NULL && p != '\0') {

Maybe better code

  while (p != NULL && *p != '\0') {

Change History (6)

comment:1 Changed on Jan 23, 2017 at 11:05:49 PM by Chris Johns

Owner: set to Chris Johns
Status: newaccepted

comment:2 Changed on May 11, 2017 at 7:31:02 AM by Sebastian Huber


comment:3 Changed on Jul 16, 2017 at 11:41:37 PM by Chris Johns

Description: modified (diff)

Update formatting to show the code fragments.

comment:4 Changed on Aug 7, 2017 at 11:34:21 PM by Chris Johns

Component: Generalcpukit
Version: 4.114.12

comment:5 Changed on Aug 15, 2017 at 1:40:37 AM by Chris Johns <chrisj@…>

Resolution: fixed
Status: acceptedclosed

In b2353ed9/rtems:

libdebugger: Fixes to debugging, ARM support, locking, and gcc-7.1 warnings.

  • Add printk support to aid multi-core debugging.
  • Add lock trace to aid lock debugging.
  • Fixes to gcc-7.1 warnings.
  • Fixes from ticket #2879.
  • Add verbose command controls.
  • Change using the RTEMS sys/lock.h API to manage exception threads.
  • ARM hardware breakpoint fixes. Support for SMP stepping is not implemented, this requires use of the context id register.

Closes #2879.

comment:6 Changed on Nov 9, 2017 at 6:27:14 AM by Sebastian Huber


Milestone renamed

Note: See TracTickets for help on using tickets.