This is an automated email from Gerrit.

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

-- gerrit

commit 9c3c33a2e2bb5b05c171b51d055c503bd86ba896
Author: Antonio Borneo <[email protected]>
Date:   Mon Jul 2 18:47:34 2018 +0200

    gdb_server: set current_target from connection's one
    
    In a multi-target environment we are supposed to have a single
    gdb server for each target (or for each group of targets within
    a SMP node).
    By default, the gdb attached to a server sends its command to
    the target (or to the SMP node targets) linked to that server.
    
    This is working fine for the normal gdb commands, but it is
    broken for the native OpenOCD commands executed through gdb
    "monitor" command. In the latter case, gdb "monitor" commands
    will be executed on the current target of OpenOCD configuration
    script (that is either the last target created or the target
    specified in a "targets" command).
    
    Fixed in gdb_new_connection() by replacing the current target
    in the connection's copy of command context.
    
    Change-Id: If7c8f2dce4a3138f0907d3000dd0b15e670cfa80
    Signed-off-by: Antonio Borneo <[email protected]>

diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index f0b552d..2270aff 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -936,6 +936,7 @@ static int gdb_new_connection(struct connection *connection)
 
        target = get_target_from_connection(connection);
        connection->priv = gdb_connection;
+       connection->cmd_ctx->current_target = target;
 
        /* initialize gdb connection information */
        gdb_connection->buf_p = gdb_connection->buffer;

-- 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to