This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[rfc] New file src/gdb/gdb.h
- To: gdb-patches at sources dot redhat dot com
- Subject: [rfc] New file src/gdb/gdb.h
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Thu, 26 Jul 2001 23:02:48 -0400
Hello,
This patch moves the ``libgdb'' library declarations to a separate file
- gdb.h. This brings the source code into line with the documentation!
In the process I delete a two year old FIXME :-)
I intend committing this tweek befor the 5.1 branch.
thoughts,
Andrew
Index: ChangeLog
2001-07-26 Andrew Cagney <ac131313@redhat.com>
* thread.c, breakpoint.c: Include "gdb.h".
* Makefile.in (gdb_h): Define.
(HFILES_NO_SRCDIR): Add gdb.h.
(mi-cmd-break.o, mi-main.o, thread.o)
(breakpoint.o): Add dependency on $(gdb_h).
* defs.h (enum gdb_rc, gdb_breakpoint_query)
(gdb_breakpoint, gdb_thread_select)
(gdb_list_thread_ids): Move declaration from here ...
* gdb.h: To here. New file.
Index: mi/ChangeLog
2001-07-26 Andrew Cagney <ac131313@redhat.com>
* mi-main.c: Include "gdb.h".
* mi-cmd-break.c: Include "gdb.h".
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.104
diff -p -r1.104 Makefile.in
*** Makefile.in 2001/07/22 12:41:49 1.104
--- Makefile.in 2001/07/27 02:58:42
*************** xm_h = @xm_h@
*** 596,601 ****
--- 596,602 ----
tm_h = @tm_h@
nm_h = @nm_h@
defs_h = defs.h $(xm_h) $(tm_h) $(nm_h) config.status config.h gdbarch.h ui-file.h
+ gdb_h = gdb.h
top_h = top.h
inferior_h = inferior.h $(breakpoint_h)
*************** cp_abi_h = cp-abi.h
*** 629,635 ****
# right, it is probably easiest just to list .h files here directly.
HFILES_NO_SRCDIR = bcache.h buildsym.h call-cmds.h coff-solib.h defs.h \
! dst.h environ.h $(gdbcmd_h) gdbcore.h \
gdb-stabs.h hpread.h $(inferior_h) language.h minimon.h monitor.h \
objfiles.h parser-defs.h partial-stab.h serial.h solib.h \
symfile.h stabsread.h target.h terminal.h typeprint.h xcoffsolib.h \
--- 630,636 ----
# right, it is probably easiest just to list .h files here directly.
HFILES_NO_SRCDIR = bcache.h buildsym.h call-cmds.h coff-solib.h defs.h \
! dst.h environ.h $(gdbcmd_h) gdb.h gdbcore.h \
gdb-stabs.h hpread.h $(inferior_h) language.h minimon.h monitor.h \
objfiles.h parser-defs.h partial-stab.h serial.h solib.h \
symfile.h stabsread.h target.h terminal.h typeprint.h xcoffsolib.h \
*************** blockframe.o: blockframe.c $(defs_h) $(g
*** 1225,1231 ****
breakpoint.o: breakpoint.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
$(inferior_h) language.h target.h gdbthread.h $(gdb_string_h) \
! gdb-events.h linespec.h $(ui_out_h) $(completer_h)
buildsym.o: buildsym.c $(bfd_h) buildsym.h complaints.h $(defs_h) \
objfiles.h symfile.h $(symtab_h) $(gdb_string_h)
--- 1226,1232 ----
breakpoint.o: breakpoint.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
$(inferior_h) language.h target.h gdbthread.h $(gdb_string_h) \
! gdb-events.h linespec.h $(ui_out_h) $(completer_h) $(gdb_h)
buildsym.o: buildsym.c $(bfd_h) buildsym.h complaints.h $(defs_h) \
objfiles.h symfile.h $(symtab_h) $(gdb_string_h)
*************** target.o: target.c $(bfd_h) $(defs_h) $(
*** 2043,2049 ****
objfiles.h symfile.h target.h $(gdb_string_h) $(regcache_h)
thread.o: thread.c $(defs_h) gdbthread.h $(gdbcmd_h) target.h \
! $(regcache_h) $(ui_out_h)
completer.o: completer.c $(completer_h) $(gdbtypes_h) $(symtab_h) \
$(defs_h) $(gdbcmd_h) $(expression_h) $(readline_headers)
--- 2044,2050 ----
objfiles.h symfile.h target.h $(gdb_string_h) $(regcache_h)
thread.o: thread.c $(defs_h) gdbthread.h $(gdbcmd_h) target.h \
! $(regcache_h) $(ui_out_h) $(gdb_h)
completer.o: completer.c $(completer_h) $(gdbtypes_h) $(symtab_h) \
$(defs_h) $(gdbcmd_h) $(expression_h) $(readline_headers)
*************** mi-cmd-stack.o: $(srcdir)/mi/mi-cmd-stac
*** 2199,2212 ****
$(ui_out_h) $(frame_h) $(value_h) $(target_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-stack.c
mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c $(defs_h) $(mi_cmds_h) \
! $(ui_out_h) $(mi_getopt_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-break.c
mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(mi_cmds_h) \
$(ui_out_h) $(value_h) $(target_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-disas.c
mi-main.o: $(srcdir)/mi/mi-main.c $(defs_h) $(top_h) $(mi_cmds_h) $(ui_out_h) \
$(mi_console_h) $(mi_getopt_h) $(event_loop_h) $(event_top_h) \
! $(mi_getopt_h) $(regcache_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-main.c
mi-out.o: $(srcdir)/mi/mi-out.c $(defs_h) $(mi_out_h) $(ui_out_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-out.c
--- 2200,2213 ----
$(ui_out_h) $(frame_h) $(value_h) $(target_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-stack.c
mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c $(defs_h) $(mi_cmds_h) \
! $(ui_out_h) $(mi_getopt_h) $(gdb_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-break.c
mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(mi_cmds_h) \
$(ui_out_h) $(value_h) $(target_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-disas.c
mi-main.o: $(srcdir)/mi/mi-main.c $(defs_h) $(top_h) $(mi_cmds_h) $(ui_out_h) \
$(mi_console_h) $(mi_getopt_h) $(event_loop_h) $(event_top_h) \
! $(mi_getopt_h) $(regcache_h) $(gdb_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-main.c
mi-out.o: $(srcdir)/mi/mi-out.c $(defs_h) $(mi_out_h) $(ui_out_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-out.c
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.50
diff -p -r1.50 breakpoint.c
*** breakpoint.c 2001/07/14 18:59:07 1.50
--- breakpoint.c 2001/07/27 02:59:00
***************
*** 41,46 ****
--- 41,47 ----
#include "objfiles.h"
#include "linespec.h"
#include "completer.h"
+ #include "gdb.h"
#ifdef UI_OUT
#include "ui-out.h"
#endif
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.59
diff -p -r1.59 defs.h
*** defs.h 2001/07/16 14:13:05 1.59
--- defs.h 2001/07/27 02:59:03
*************** extern int use_windows;
*** 1437,1481 ****
#define ISATTY(FP) (isatty (fileno (FP)))
#endif
-
- /* FIXME: cagney/1999-12-13: The following will be moved to gdb.h /
- libgdb.h or gdblib.h. */
-
- /* Return-code (RC) from a gdb library call. (The abreviation RC is
- taken from the sim/common directory.) */
-
- enum gdb_rc {
- /* The operation failed. The failure message can be fetched by
- calling ``char *error_last_message(void)''. The value is
- determined by the catch_errors() interface. */
- /* NOTE: Since ``defs.h:catch_errors()'' does not return an error /
- internal / quit indication it is not possible to return that
- here. */
- GDB_RC_FAIL = 0,
- /* No error occured but nothing happened. Due to the catch_errors()
- interface, this must be non-zero. */
- GDB_RC_NONE = 1,
- /* The operation was successful. Due to the catch_errors()
- interface, this must be non-zero. */
- GDB_RC_OK = 2
- };
-
-
- /* Print the specified breakpoint on GDB_STDOUT. (Eventually this
- function will ``print'' the object on ``output''). */
- enum gdb_rc gdb_breakpoint_query (/* struct {ui,gdb}_out *output, */ int bnum);
-
- /* Create a breakpoint at ADDRESS (a GDB source and line). */
- enum gdb_rc gdb_breakpoint (char *address, char *condition,
- int hardwareflag, int tempflag,
- int thread, int ignore_count);
- enum gdb_rc gdb_thread_select (/* output object */ char *tidstr);
-
- #ifdef UI_OUT
- /* Print a list of known thread ids. */
- enum gdb_rc gdb_list_thread_ids (/* output object */);
-
- /* Switch thread and print notification. */
- #endif
-
#endif /* #ifndef DEFS_H */
--- 1437,1440 ----
Index: gdb.h
===================================================================
RCS file: gdb.h
diff -N gdb.h
*** /dev/null Tue May 5 13:32:27 1998
--- gdb.h Thu Jul 26 19:59:03 2001
***************
*** 0 ****
--- 1,60 ----
+ /* Library interface into GDB.
+ Copyright 1999, 2001
+ 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+ #ifndef GDB_H
+ #define GDB_H
+
+ /* Return-code (RC) from a gdb library call. (The abreviation RC is
+ taken from the sim/common directory.) */
+
+ enum gdb_rc {
+ /* The operation failed. The failure message can be fetched by
+ calling ``char *error_last_message(void)''. The value is
+ determined by the catch_errors() interface. */
+ /* NOTE: Since ``defs.h:catch_errors()'' does not return an error /
+ internal / quit indication it is not possible to return that
+ here. */
+ GDB_RC_FAIL = 0,
+ /* No error occured but nothing happened. Due to the catch_errors()
+ interface, this must be non-zero. */
+ GDB_RC_NONE = 1,
+ /* The operation was successful. Due to the catch_errors()
+ interface, this must be non-zero. */
+ GDB_RC_OK = 2
+ };
+
+
+ /* Print the specified breakpoint on GDB_STDOUT. (Eventually this
+ function will ``print'' the object on ``output''). */
+ enum gdb_rc gdb_breakpoint_query (/* struct {ui,gdb}_out *output, */ int bnum);
+
+ /* Create a breakpoint at ADDRESS (a GDB source and line). */
+ enum gdb_rc gdb_breakpoint (char *address, char *condition,
+ int hardwareflag, int tempflag,
+ int thread, int ignore_count);
+
+ /* Switch thread and print notification. */
+ enum gdb_rc gdb_thread_select (/* output object */ char *tidstr);
+
+ /* Print a list of known thread ids. */
+ enum gdb_rc gdb_list_thread_ids (/* output object */);
+
+ #endif
Index: thread.c
===================================================================
RCS file: /cvs/src/src/gdb/thread.c,v
retrieving revision 1.17
diff -p -r1.17 thread.c
*** thread.c 2001/06/13 22:56:16 1.17
--- thread.c 2001/07/27 02:59:06
***************
*** 33,38 ****
--- 33,39 ----
#include "command.h"
#include "gdbcmd.h"
#include "regcache.h"
+ #include "gdb.h"
#include <ctype.h>
#include <sys/types.h>
Index: mi/mi-cmd-break.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmd-break.c,v
retrieving revision 1.4
diff -p -r1.4 mi-cmd-break.c
*** mi-cmd-break.c 2001/02/08 06:03:54 1.4
--- mi-cmd-break.c 2001/07/27 02:59:13
***************
*** 27,32 ****
--- 27,33 ----
#include "gdb_string.h"
#include "mi-getopt.h"
#include "gdb-events.h"
+ #include "gdb.h"
/* Convenience macro for allocting typesafe memory. */
Index: mi/mi-main.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-main.c,v
retrieving revision 1.22
diff -p -r1.22 mi-main.c
*** mi-main.c 2001/07/12 05:54:48 1.22
--- mi-main.c 2001/07/27 02:59:16
***************
*** 38,43 ****
--- 38,44 ----
#include "gdbcore.h" /* for write_memory() */
#include "value.h" /* for write_register_bytes() */
#include "regcache.h"
+ #include "gdb.h"
#include <ctype.h>
#include <sys/time.h>