[rtems commit] libdebugger: Fix the mode on task create. Clean up warnings.

Chris Johns chrisj at rtems.org
Wed Apr 19 04:34:00 UTC 2017


Module:    rtems
Branch:    master
Commit:    7f95cc07079901693338ef565bb318f4d5ed5a7c
Changeset: http://git.rtems.org/rtems/commit/?id=7f95cc07079901693338ef565bb318f4d5ed5a7c

Author:    Chris Johns <chrisj at rtems.org>
Date:      Wed Apr 19 14:33:29 2017 +1000

libdebugger: Fix the mode on task create. Clean up warnings.

Closes #2976.

---

 cpukit/libdebugger/rtems-debugger-server.c | 35 ++++++++++++++++++------------
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/cpukit/libdebugger/rtems-debugger-server.c b/cpukit/libdebugger/rtems-debugger-server.c
index 8c20cf6..77b5697 100644
--- a/cpukit/libdebugger/rtems-debugger-server.c
+++ b/cpukit/libdebugger/rtems-debugger-server.c
@@ -245,8 +245,8 @@ rtems_debugger_task_create(const char*         name,
   sc = rtems_task_create (tname,
                           priority,
                           stack_size,
-                          RTEMS_FLOATING_POINT | RTEMS_LOCAL,
                           RTEMS_PREEMPT | RTEMS_NO_ASR,
+                          RTEMS_LOCAL | RTEMS_FLOATING_POINT,
                           id);
   if (sc != RTEMS_SUCCESSFUL) {
     *id = 0;
@@ -277,6 +277,7 @@ rtems_debugger_task_destroy(const char*    name,
 {
   while (timeout) {
     bool has_finished;
+
     rtems_debugger_lock();
     has_finished = *finished;
     rtems_debugger_unlock();
@@ -384,24 +385,24 @@ static int
 rtems_debugger_remote_connect(void)
 {
   rtems_debugger_remote* remote = rtems_debugger_remote_handle();
-  if (remote == NULL) {
-    errno = EIO;
-    return -1;
+  if (remote != NULL) {
+    if (!remote->isconnected(remote))
+      return remote->connect(remote);
   }
-  if (!remote->isconnected(remote))
-    return remote->connect(remote);
+  errno = EIO;
+  return -1;
 }
 
 static int
 rtems_debugger_remote_disconnect(void)
 {
   rtems_debugger_remote* remote = rtems_debugger_remote_handle();
-  if (remote == NULL) {
-    errno = EIO;
-    return -1;
+  if (remote != NULL) {
+    if (remote->isconnected(remote))
+      return remote->disconnect(remote);
   }
-  if (remote->isconnected(remote))
-    return remote->disconnect(remote);
+  errno = EIO;
+  return -1;
 }
 
 static int
@@ -1884,7 +1885,7 @@ rtems_debugger_destroy(void)
   if (rr < 0 && r == 0)
     r = rr;
 
-  rr = rtems_debugger_task_destroy("DBSr",
+  rr = rtems_debugger_task_destroy("DBSs",
                                    rtems_debugger->server_task,
                                    &rtems_debugger->server_finished,
                                    RTEMS_DEBUGGER_TIMEOUT_STOP);
@@ -1906,6 +1907,12 @@ rtems_debugger_main(rtems_task_argument arg)
 {
   int r;
 
+
+  rtems_debugger_lock();
+  rtems_debugger->server_running = true;
+  rtems_debugger->server_finished = false;
+  rtems_debugger_unlock();
+
   rtems_debugger_printf("rtems-db: remote running\n");
 
   while (rtems_debugger_server_running()) {
@@ -1940,8 +1947,8 @@ rtems_debugger_start(const char*          remote,
     return -1;
 
   rtems_debugger_lock();
-  rtems_debugger->server_running = true;
-  rtems_debugger->server_finished = false;
+  rtems_debugger->server_running = false;
+  rtems_debugger->server_finished = true;
   rtems_debugger_unlock();
 
   r = rtems_debugger_task_create("DBSs",




More information about the vc mailing list