Fix a Gtk warning when checking path input in the log viewer.
[anjuta-git-plugin.git] / plugins / gdb / debugger.h
blob012a21e509eda10bdbc262c74459922bb90dba1e
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 debugger.h
4 Copyright (C) Naba Kumar <naba@gnome.org>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef __DEBUGGER_H__
21 #define __DEBUGGER_H__
23 #include <sys/types.h>
24 #include <glib-object.h>
25 #include <gtk/gtkwindow.h>
26 #include "gdbmi.h"
28 #include <libanjuta/interfaces/ianjuta-message-view.h>
29 #include <libanjuta/interfaces/ianjuta-debugger.h>
31 G_BEGIN_DECLS
33 typedef struct _Debugger Debugger;
34 typedef struct _DebuggerClass DebuggerClass;
35 typedef struct _DebuggerPriv DebuggerPriv;
36 typedef struct _DebuggerCommand DebuggerCommand;
38 #define DEBUGGER_TYPE (debugger_get_type ())
39 #define DEBUGGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEBUGGER_TYPE, Debugger))
40 #define DEBUGGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEBUGGER_TYPE, DebuggerClass))
41 #define IS_DEBUGGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEBUGGER_TYPE))
42 #define IS_DEBUGGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEBUGGER_TYPE))
44 typedef enum
46 DEBUGGER_BREAKPOINT,
47 } DebuggerBreakpointType;
49 typedef void (*DebuggerParserFunc) (Debugger *debugger,
50 const GDBMIValue *mi_result,
51 const GList *cli_result,
52 GError* error);
54 struct _DebuggerCommand
56 gchar *cmd;
57 gboolean suppress_error;
58 gboolean keep_result;
59 DebuggerParserFunc parser;
60 IAnjutaDebuggerCallback callback;
61 gpointer user_data;
64 struct _Debugger
66 GObject parent;
67 DebuggerPriv *priv;
70 struct _DebuggerClass
72 GObjectClass parent_class;
75 GType debugger_get_type (void);
77 Debugger* debugger_new (GtkWindow *parent_win, GObject* instance);
78 void debugger_free (Debugger *debugger);
80 gboolean debugger_start (Debugger *debugger, const GList *search_dirs,
81 const gchar *prog, gboolean is_libtool_prog);
83 gboolean debugger_stop (Debugger *debugger);
84 gboolean debugger_abort (Debugger *debugger);
86 void debugger_set_output_callback (Debugger *debugger, IAnjutaDebuggerOutputCallback callback, gpointer user_data);
88 /* Status */
89 gboolean debugger_is_ready (Debugger *debugger);
90 gboolean debugger_program_is_running (Debugger *debugger);
91 gboolean debugger_program_is_attached (Debugger *debugger);
92 gboolean debugger_program_is_loaded (Debugger *debugger);
93 IAnjutaDebuggerState debugger_get_state (Debugger *debugger);
95 /* Send standard gdb MI2 or CLI commands */
96 void debugger_command (Debugger *debugger, const gchar *command,
97 gboolean suppress_error, DebuggerParserFunc parser,
98 gpointer user_data);
100 void debugger_program_moved (Debugger *debugger, const gchar *file,
101 gint line, gulong address);
102 gchar* debugger_get_source_path (Debugger *debugger, const gchar *file);
104 /* Program loading */
105 void debugger_load_executable (Debugger *debugger, const gchar *prog);
106 void debugger_load_core (Debugger *debugger, const gchar *core);
107 void debugger_attach_process (Debugger *debugger, pid_t pid);
108 void debugger_detach_process (Debugger *debugger);
110 /* Environment */
111 gboolean debugger_set_working_directory (Debugger *debugger, const gchar *directory);
112 gboolean debugger_set_environment (Debugger *debugger, gchar **variables);
114 /* Execution */
115 void debugger_start_program (Debugger *debugger, const gchar* args, const gchar* tty, gboolean stop);
116 void debugger_stop_program (Debugger *debugger);
117 void debugger_restart_program (Debugger *debugger);
118 void debugger_interrupt (Debugger *debugger);
119 void debugger_run (Debugger *debugger);
120 void debugger_step_in (Debugger *debugger);
121 void debugger_step_over (Debugger *debugger);
122 void debugger_step_out (Debugger *debugger);
123 void debugger_stepi_in (Debugger *debugger);
124 void debugger_stepi_over (Debugger *debugger);
125 void debugger_run_to_location (Debugger *debugger, const gchar *loc);
126 void debugger_run_to_position (Debugger *debugger, const gchar *file, guint line);
127 void debugger_run_to_address (Debugger *debugger, gulong address);
129 /* Breakpoint */
130 void debugger_add_breakpoint_at_line (Debugger *debugger, const gchar* file, guint line, IAnjutaDebuggerCallback callback, gpointer user_data);
131 void debugger_add_breakpoint_at_function (Debugger *debugger, const gchar* file, const gchar* function, IAnjutaDebuggerCallback callback, gpointer user_data);
132 void debugger_add_breakpoint_at_address (Debugger *debugger, gulong address, IAnjutaDebuggerCallback callback, gpointer user_data);
133 void debugger_remove_breakpoint (Debugger *debugger, guint id, IAnjutaDebuggerCallback callback, gpointer user_data);
134 void debugger_list_breakpoint (Debugger *debugger, IAnjutaDebuggerCallback callback, gpointer user_data);
135 void debugger_enable_breakpoint (Debugger *debugger, guint id, gboolean enable, IAnjutaDebuggerCallback callback, gpointer user_data);
136 void debugger_ignore_breakpoint (Debugger *debugger, guint id, guint ignore, IAnjutaDebuggerCallback callback, gpointer user_data);
137 void debugger_condition_breakpoint (Debugger *debugger, guint id, const gchar* condition, IAnjutaDebuggerCallback callback, gpointer user_data);
139 /* Variable */
140 void debugger_print (Debugger *debugger, const gchar* variable, IAnjutaDebuggerCallback callback, gpointer user_data);
141 void debugger_evaluate (Debugger *debugger, const gchar* name, IAnjutaDebuggerCallback callback, gpointer user_data);
143 /* Info */
144 void debugger_list_local (Debugger *debugger, IAnjutaDebuggerCallback func, gpointer user_data);
145 void debugger_list_argument (Debugger *debugger, IAnjutaDebuggerCallback func, gpointer user_data);
146 void debugger_info_signal (Debugger *debugger, IAnjutaDebuggerCallback func, gpointer user_data);
147 void debugger_info_frame (Debugger *debugger, guint frame, IAnjutaDebuggerCallback func, gpointer user_data);
148 void debugger_info_sharedlib (Debugger *debugger, IAnjutaDebuggerCallback func, gpointer user_data);
149 void debugger_info_args (Debugger *debugger, IAnjutaDebuggerCallback func, gpointer user_data);
150 void debugger_info_target (Debugger *debugger, IAnjutaDebuggerCallback func, gpointer user_data);
151 void debugger_info_program (Debugger *debugger, IAnjutaDebuggerCallback func, gpointer user_data);
152 void debugger_info_udot (Debugger *debugger, IAnjutaDebuggerCallback func, gpointer user_data);
153 void debugger_info_variables (Debugger *debugger, IAnjutaDebuggerCallback func, gpointer user_data);
154 void debugger_inspect_memory (Debugger *debugger, gulong address, guint length, IAnjutaDebuggerCallback func, gpointer user_data);
155 void debugger_disassemble (Debugger *debugger, gulong address, guint length, IAnjutaDebuggerCallback func, gpointer user_data);
157 /* Register */
159 void debugger_list_register (Debugger *debugger, IAnjutaDebuggerCallback func, gpointer user_data);
160 void debugger_update_register (Debugger *debugger, IAnjutaDebuggerCallback func, gpointer user_data);
161 void debugger_write_register (Debugger *debugger, const gchar *name, const gchar *value);
163 /* Stack */
164 void debugger_list_argument (Debugger *debugger, IAnjutaDebuggerCallback func, gpointer user_data);
165 void debugger_list_frame (Debugger *debugger, IAnjutaDebuggerCallback func, gpointer user_data);
166 void debugger_set_frame (Debugger *debugger, guint frame);
168 /* Thread */
169 void debugger_list_thread (Debugger *debugger, IAnjutaDebuggerCallback func, gpointer user_data);
170 void debugger_set_thread (Debugger *debugger, gint thread);
171 void debugger_info_thread (Debugger *debugger, gint thread, IAnjutaDebuggerCallback func, gpointer user_data);
173 /* Log */
174 void debugger_set_log (Debugger *debugger, IAnjutaMessageView *view);
176 /* Variable object */
177 void debugger_delete_variable (Debugger *debugger, const gchar *name);
178 void debugger_evaluate_variable (Debugger *debugger, const gchar *name, IAnjutaDebuggerCallback callback, gpointer user_data);
179 void debugger_assign_variable (Debugger *debugger, const gchar *name, const gchar *value);
180 void debugger_list_variable_children (Debugger *debugger, const gchar* name, IAnjutaDebuggerCallback callback, gpointer user_data);
181 void debugger_create_variable (Debugger *debugger, const gchar *name, IAnjutaDebuggerCallback callback, gpointer user_data);
182 void debugger_update_variable (Debugger *debugger, IAnjutaDebuggerCallback callback, gpointer user_data);
184 #if 0
186 /* Evaluations */
187 void debugger_query_execute (void);
188 void debugger_query_evaluate_expr_tip (const gchar *expr,
189 DebuggerFunc parser,
190 gpointer data);
191 void debugger_query_evaluate_expr (const gchar *expr,
192 DebuggerFunc parser,
193 gpointer data);
194 #endif
196 G_END_DECLS
198 #endif