gdb.h revision 131899
1131899Smarcel/* 2131899Smarcel * Copyright (c) 2004 Marcel Moolenaar 3131899Smarcel * All rights reserved. 4131899Smarcel * 5131899Smarcel * Redistribution and use in source and binary forms, with or without 6131899Smarcel * modification, are permitted provided that the following conditions 7131899Smarcel * are met: 8131899Smarcel * 9131899Smarcel * 1. Redistributions of source code must retain the above copyright 10131899Smarcel * notice, this list of conditions and the following disclaimer. 11131899Smarcel * 2. Redistributions in binary form must reproduce the above copyright 12131899Smarcel * notice, this list of conditions and the following disclaimer in the 13131899Smarcel * documentation and/or other materials provided with the distribution. 14131899Smarcel * 15131899Smarcel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16131899Smarcel * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17131899Smarcel * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18131899Smarcel * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19131899Smarcel * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20131899Smarcel * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21131899Smarcel * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22131899Smarcel * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23131899Smarcel * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24131899Smarcel * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25131899Smarcel * 26131899Smarcel * $FreeBSD: head/sys/gdb/gdb.h 131899 2004-07-10 17:47:22Z marcel $ 27131899Smarcel */ 28131899Smarcel 29131899Smarcel#ifndef _GDB_GDB_H_ 30131899Smarcel#define _GDB_GDB_H_ 31131899Smarcel 32131899Smarceltypedef int gdb_checkc_f(void); 33131899Smarceltypedef int gdb_getc_f(void); 34131899Smarceltypedef void gdb_init_f(void); 35131899Smarceltypedef int gdb_probe_f(void); 36131899Smarceltypedef void gdb_putc_f(int); 37131899Smarceltypedef void gdb_term_f(void); 38131899Smarcel 39131899Smarcelstruct gdb_dbgport { 40131899Smarcel const char *gdb_name; 41131899Smarcel gdb_checkc_f *gdb_checkc; 42131899Smarcel gdb_getc_f *gdb_getc; 43131899Smarcel gdb_init_f *gdb_init; 44131899Smarcel gdb_probe_f *gdb_probe; 45131899Smarcel gdb_putc_f *gdb_putc; 46131899Smarcel gdb_term_f *gdb_term; 47131899Smarcel int gdb_active; 48131899Smarcel}; 49131899Smarcel 50131899Smarcel#define GDB_DBGPORT(name, probe, init, term, checkc, getc, putc) \ 51131899Smarcel static struct gdb_dbgport name##_gdb_dbgport = { \ 52131899Smarcel .gdb_name = #name, \ 53131899Smarcel .gdb_checkc = checkc, \ 54131899Smarcel .gdb_getc = getc, \ 55131899Smarcel .gdb_init = init, \ 56131899Smarcel .gdb_probe = probe, \ 57131899Smarcel .gdb_putc = putc, \ 58131899Smarcel .gdb_term = term \ 59131899Smarcel }; \ 60131899Smarcel DATA_SET(gdb_dbgport_set, name##_gdb_dbgport) 61131899Smarcel 62131899Smarcel#endif /* !_GDB_GDB_H_ */ 63