gdb_interface.h 1.57 KB
/*
 * Copyright (C) 1996-1998 by the Board of Trustees
 *    of Leland Stanford Junior University.
 * 
 * This file is part of the SimOS distribution. 
 * See LICENSE file for terms of the license. 
 *
 */

/*
 * simdebug.h - Interface to debugger  
 */

#ifndef SIMDEBUG_H
#define SIMDEBUG_H

typedef enum Simdebug_result {
   SD_CONTINUE = -2,
   SD_NEXTI_ANYCPU = -1
} Simdebug_result;

/*
 * Return values from Simdebug_run:
 *    SD_CONTINUE      run free
 *    SD_NEXTI_ANYCPU  execute one instruction, stop before next instruction
 *                     on any cpu is executed
 *    val >= 0         execute one instruction, stop before next inst
 *                     on cpu <returnval> is executed
 *
 * the 'sig' argument specifies what signal you stopped on.  If this
 * doesn't make sense for a given CPU simulator, use SIGTRAP for a breakpoint
 * or singlestep completion and SIGUSR2 for a interrupt that knocked you
 * into the debugger.
 *
 * the 'cpunum' argument indicates which cpu to focus the debugger on
 * when it starts up 
 */

extern Simdebug_result Simdebug_run(int sig, int cpunum);

extern void Simdebug_init(void);

/*
 * someone needs to poll the gdb connection if it is open in case
 * the user types ^C.  This is currently piggy-backed onto the
 * select polling done by the Visual control subsystem.
 */

extern int Simdebug_pollfd(void);  /* returns fd number or -1 */
extern void Simdebug_fdactive(void); /* call this if select() on that fd
                                      * shows data available
                                      */

#endif /* SIMDEBUG_H */