/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2004 Marcel Moolenaar4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9*10* 1. Redistributions of source code must retain the above copyright11* notice, this list of conditions and the following disclaimer.12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15*16* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR17* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES18* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.19* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,20* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT21* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,22* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY23* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF25* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.26*/2728#ifndef _GDB_GDB_H_29#define _GDB_GDB_H_3031typedef int gdb_checkc_f(void);32typedef int gdb_getc_f(void);33typedef void gdb_init_f(void);34typedef int gdb_probe_f(void);35typedef void gdb_putc_f(int);36typedef void gdb_term_f(void);3738struct gdb_dbgport {39const char *gdb_name;40gdb_getc_f *gdb_getc;41gdb_init_f *gdb_init;42gdb_probe_f *gdb_probe;43gdb_putc_f *gdb_putc;44gdb_term_f *gdb_term;45int gdb_active;46void (*gdb_sendpacket)(const void *, size_t);47int gdb_dbfeatures;48};4950#define GDB_DBGP_FEAT_WANTTERM 0x1 /* Want gdb_term() invocation when51leaving GDB. gdb_term has been52deadcode and never invoked for so53long I don't want to just blindly54start invoking it without opt-in. */55#define GDB_DBGP_FEAT_RELIABLE 0x2 /* The debugport promises it is a56reliable transport, which allows GDB57acks to be turned off. */5859#define GDB_DBGPORT(name, probe, init, term, getc, putc) \60static struct gdb_dbgport name##_gdb_dbgport = { \61.gdb_name = #name, \62.gdb_probe = probe, \63.gdb_init = init, \64.gdb_term = term, \65.gdb_getc = getc, \66.gdb_putc = putc, \67}; \68DATA_SET(gdb_dbgport_set, name##_gdb_dbgport)6970#endif /* !_GDB_GDB_H_ */717273