/* %Z%%M% %I% %E% */

/*
 * Copyright (c) 1991-2005 by Wayne C. Gramlich.
 * All rights reserved.
 */

/* this file contains the data structure declarations for the debugger: */

#ifndef RUN_TIME_DEFS_H
#define RUN_TIME_DEFS_H

#ifndef RUN_TIME_EXPORTS_H
#include "run_time_exports.h"
#endif

#ifndef STRVEC_EXPORTS_H
#include "strvec_exports.h"
#endif

#ifndef STHEADERS_H
#include "stheaders.h"
#endif

#ifndef TABLE_EXPORTS_H
#include "table_exports.h"
#endif

struct Alias_struct {
	Str		name;		/* Alias name */
	Str		command;	/* Alias command substitution */
};

struct Event_struct {
	Event_kind	event_kind;	/* Kind of event */
	Str		file_name;	/* File name */
	Str		type_name;	/* Name of type or "global__" */
	Str		routine_name;	/* Routine name */
	int		line_number;	/* Line number or -1 for stop_in */
};

struct Routine_value_struct {
	void		*routine;
	void		*parameter;
};

struct Routine_variable_struct {
	void	*(*routine)(void);
	void	*params;
};

/* Stuff all of the debugger state in to single structure: */
struct Run_time_struct {
	Vec(Alias)	aliases;	/* Alias table */
	int		breakpoints_size;	/* Size in bytes of... */
	char		*breakpoints_none; /* Vector of 0's to force run */
	char		*breakpoints_stop; /* Vector of 1's to force stop */
	Str		coverage_file;	/* Coverage file name */
	activation___object *current_activation; /* Current activation */
	Str		*debug_cmds;	/* List of debugger commands */
	Str		*debug_help;	/* List of associated help */
	int		depth;		/* Stack depth */
	Str		directory;	/* Current directory */
	int		echo;		/* 1=>echo arguments */
	int		eol_chr;	/* End-of-line character */
	int		error;		/* 1=>argument read error */
	Vec(Event)	events;		/* List of events */
	Vec(activation___object *) faults; /* List of fault records */
	Heap		heap;
	File		in_file;	/* Input file */
	Vec(File)	in_file_stack;	/* Inclusion stack */
	File		in_string;	/* File for reading strings */
	Str		last_file_name;	/* Last file name displayed */
	Stdio		last_in_file;	/* Last input file opened */
	module___object *last_module;	/* Last line displayed from here */
	activation___object *leaf_activation; /* Deepest routine called */
	Vec(module___object *) modules;	/* List of modules */
	Table(object___object *, object___object *) object_table;
	activation___object *out_activation; /* Activation to step out of */
	activation___object *over_activation; /* Activation stepped over from */
	int		pipe_fd;
	Run_mode	run_mode;	/* What mode are we in */
	Table(routine___object *, routine___object *) routine_table;
	Std_state	std_state;	/* Debugger state */
	Strvec		strvec;		/* Temporary string vector */
};

#endif /* RUN_TIME_DEFS_H */
