qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Unable to set register on qemu-system-sparc64 via gdbstub


From: Mark Cave-Ayland
Subject: [Qemu-devel] Unable to set register on qemu-system-sparc64 via gdbstub
Date: Fri, 5 Jul 2019 12:50:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2

Hi all,

It looks as if the recent gdbstub code rework has broken the ability to set 
registers
under qemu-system-sparc64:

$ sparc64-linux-gdb obj-sparc64/openbios-builtin.elf.nostrip
GNU gdb (GDB) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-pc-linux-gnu --target=sparc64-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from obj-sparc64/openbios-builtin.elf.nostrip...done.
(gdb) target remote :1234
Remote debugging using :1234
0x000001fff0000020 in ?? ()
(gdb) info regi $g1
g1             0x0      0
(gdb) set $g1 = 0x55
Could not write register "g1"; remote failure reply 'E00'
(gdb)

I managed to narrow this down to the recent gdbstub rework, and in particular 
to this
patch:

commit 62b3320bddd79c050553ea7f81f20c6d3b401ce3
Author: Jon Doron <address@hidden>
Date:   Wed May 29 09:41:36 2019 +0300

    gdbstub: Implement set register (P pkt) with new infra

    Signed-off-by: Jon Doron <address@hidden>
    Message-Id: <address@hidden>
    Signed-off-by: Alex Bennée <address@hidden>

Tracing through I see that the problem occurs because of this code in gdbstub's
handle_set_reg:

static void handle_set_reg(GdbCmdContext *gdb_ctx, void *user_ctx)
{
    int reg_size;

    if (!gdb_has_xml) {
        put_packet(gdb_ctx->s, "E00");
        return;
    }

    ...
    ...
}

Because SPARC doesn't have any GDB XML files then this check always fails which 
is
why the E00 error code is being returned.

In fact if I simply comment out the above check then everything appears to work
again, however I'm not sure that this is the correct fix because there are 
several
other references to gdb_has_xml remaining in the file?


ATB,

Mark.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]