--- gdb/Makefile.in | 9 ++++++-- gdb/scripting.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 2 deletions(-) Index: src/gdb/Makefile.in =================================================================== --- src.orig/gdb/Makefile.in 2007-01-16 01:56:21.000000000 -0500 +++ src/gdb/Makefile.in 2007-01-19 03:31:17.000000000 -0500 @@ -131,6 +131,11 @@ READLINE_CFLAGS = -I$(READLINE_SRC)/.. # Where is expat? This will be empty if expat was not available. LIBEXPAT = @LIBEXPAT@ +# Where is python? +# TODO: Find a way to autodetect which python to use. +INCPYTHON = -I/usr/include/python2.4 +LIBPYTHON = -lpython2.4 + WARN_CFLAGS = @WARN_CFLAGS@ WERROR_CFLAGS = @WERROR_CFLAGS@ GDB_WARN_CFLAGS = $(WARN_CFLAGS) @@ -343,7 +348,7 @@ PROFILE_CFLAGS = @PROFILE_CFLAGS@ CFLAGS = @CFLAGS@ # Set by configure, for e.g. expat. -INTERNAL_CPPFLAGS = @CPPFLAGS@ +INTERNAL_CPPFLAGS = @CPPFLAGS@ $(INCPYTON) # Need to pass this to testsuite for "make check". Probably should be # consistent with top-level Makefile.in and gdb/testsuite/Makefile.in @@ -382,7 +387,7 @@ INSTALLED_LIBS=-lbfd -lreadline -lopcode -lintl -liberty CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(INTL) $(LIBIBERTY) \ $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \ - $(LIBICONV) $(LIBEXPAT) \ + $(LIBICONV) $(LIBEXPAT) $(LIBPYTHON) \ $(LIBIBERTY) $(WIN32LIBS) CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \ $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) Index: src/gdb/scripting.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ src/gdb/scripting.h 2007-01-19 17:02:29.000000000 -0500 @@ -0,0 +1,62 @@ +/* Support for scripting GDB. + Copyright (C) 2007 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +#ifndef SCRIPTING_H +#define SCRIPTING_H + +struct type; +struct value; +struct ui_file; + +struct script_ops +{ + /* Print a description of TYPE to STREAM. */ + void (*print_type) (struct type *type, char *varstring, + struct ui_file *stream, int show); + + /* Print */ + /* FIXME: Can i avoid having to implement val_print? Trying that now. */ + int (*val_print) (struct type *type, const gdb_byte *valaddr, + int embedded_offset, CORE_ADDR address, + struct ui_file *stream, int format, + int deref_ref, int recurse, enum val_prettyprint pretty); + + int (*value_print) (struct value *val, struct ui_file *stream, int format, + enum val_prettyprint pretty); + + struct value *(*call_function) (struct value *function, int nargs, + struct value **args); +}; + +void script_print_type (struct type *type, char *varstring, + struct ui_file *stream, int show); + +int script_val_print (struct type *type, const gdb_byte *valaddr, + int embedded_offset, CORE_ADDR address, + struct ui_file *stream, int format, + int deref_ref, int recurse, enum val_prettyprint pretty); + +int script_value_print (struct value *val, struct ui_file *stream, int format, + enum val_prettyprint pretty); + +struct value *script_call_function (struct value *function, int nargs, + struct value **args); + +#endif /* SCRIPTING_H */