On Tue, Sep 26, 2017 at 4:04 AM, Mihail Abakumov <mikhail.abaku...@ispras.ru> wrote: > Added definition of the WindbgState struct and its initialization. > > Signed-off-by: Mihail Abakumov <mikhail.abaku...@ispras.ru> > Signed-off-by: Pavel Dovgalyuk <dovga...@ispras.ru> > Signed-off-by: Dmitriy Koltunov <koltu...@ispras.ru> > --- > windbgstub.c | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > > diff --git a/windbgstub.c b/windbgstub.c > index 3830446988..60a380c213 100755 > --- a/windbgstub.c > +++ b/windbgstub.c > @@ -10,10 +10,36 @@ > */ > > #include "qemu/osdep.h" > +#include "chardev/char.h" > +#include "chardev/char-fe.h" > #include "exec/windbgstub.h" > #include "exec/windbgstub-utils.h" > > +typedef struct WindbgState { > + bool is_loaded; > + > + uint32_t ctrl_packet_id; > + uint32_t data_packet_id; > +} WindbgState; > + > +static WindbgState *windbg_state; > + > +static void windbg_exit(void) > +{ > + g_free(windbg_state); > +} > + > int windbg_server_start(const char *device) > { > + if (windbg_state) { > + WINDBG_ERROR("Multiple instances are not supported");
Use error_report() to report errors. Thanks, Alistair > + exit(1); > + } > + > + windbg_state = g_new0(WindbgState, 1); > + windbg_state->ctrl_packet_id = RESET_PACKET_ID; > + windbg_state->data_packet_id = INITIAL_PACKET_ID; > + > + atexit(windbg_exit); I don't think you need this. Thanks, Alistair > return 0; > } > >