aboutsummaryrefslogtreecommitdiff
path: root/gdbstub.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-10-21 23:44:44 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2017-01-27 18:07:59 +0100
commit41ac54b253f41df924c350ef63564df8e1d8ad88 (patch)
treea6d8fdcb913b558c4f5ecc698bd82ae1a195705c /gdbstub.c
parent5ebd67030c4e4bc702d07a3e10c909be4520f170 (diff)
char: allocate CharDriverState as a single object
Use a single allocation for CharDriverState, this avoids extra allocations & pointers, and is a step towards more object-oriented CharDriver. Gtk console is a bit peculiar, gd_vc_chr_set_echo() used to have a temporary VirtualConsole to save the echo bit. Instead now, we consider whether vcd->console is set or not, and restore the echo bit saved in VCDriverState when calling gd_vc_vte_init(). The casts added are temporary, they are replaced with QOM type-safe macros in a later patch in this series. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'gdbstub.c')
-rw-r--r--gdbstub.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gdbstub.c b/gdbstub.c
index f4e36a9cd3..1a30f5ab58 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1733,6 +1733,7 @@ int gdbserver_start(const char *device)
CharDriverState *mon_chr;
ChardevCommon common = { 0 };
static const CharDriver driver = {
+ .instance_size = sizeof(CharDriverState),
.kind = -1,
.chr_write = gdb_monitor_write,
};