This is an automated email from Gerrit.

Jon Burgess ([email protected]) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/2303

-- gerrit

commit 8b9c1d4f53adfeaf579049a5b0a671c8f7b95bb1
Author: Jon Burgess <[email protected]>
Date:   Thu Sep 18 19:57:34 2014 +0100

    gdb_server: Include current RTOS thread in signal packets
    
    This allows GDB to automatically switch to the thread that has
    been interrupted and show you where it has stopped.
    
    Change-Id: Icb9500dc42a61eb977e9fac55ce9503c9926bf5d
    Signed-off-by: Jon Burgess <[email protected]>

diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index 2912c74..152a06c 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -714,11 +714,14 @@ static int gdb_output(struct command_context *context, 
const char *line)
 static void gdb_signal_reply(struct target *target, struct connection 
*connection)
 {
        struct gdb_connection *gdb_connection = connection->priv;
-       char sig_reply[20];
+       char sig_reply[45];
        char stop_reason[20];
+       char current_thread[25];
        int sig_reply_len;
        int signal_var;
 
+       rtos_update_threads(target);
+
        if (target->debug_reason == DBG_REASON_EXIT) {
                sig_reply_len = snprintf(sig_reply, sizeof(sig_reply), "W00");
        } else {
@@ -754,13 +757,18 @@ static void gdb_signal_reply(struct target *target, 
struct connection *connectio
                        }
                }
 
-               sig_reply_len = snprintf(sig_reply, sizeof(sig_reply), 
"T%2.2x%s",
-                               signal_var, stop_reason);
+               current_thread[0] = '\0';
+               if (target->rtos != NULL) {
+                       snprintf(current_thread, sizeof(current_thread), 
"thread:%016" PRIx64 ";", target->rtos->current_thread);
+                       target->rtos->current_threadid = 
target->rtos->current_thread;
+               }
+
+               sig_reply_len = snprintf(sig_reply, sizeof(sig_reply), 
"T%2.2x%s%s",
+                               signal_var, stop_reason, current_thread);
        }
 
        gdb_put_packet(connection, sig_reply, sig_reply_len);
        gdb_connection->frontend_state = TARGET_HALTED;
-       rtos_update_threads(target);
 }
 
 static void gdb_fileio_reply(struct target *target, struct connection 
*connection)

-- 

------------------------------------------------------------------------------
Slashdot TV.  Video for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to