1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 Copyright (C) 2007 Sébastien Granjoux
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
24 /*---------------------------------------------------------------------------*/
28 #include <libanjuta/interfaces/ianjuta-debugger.h>
29 #include <libanjuta/interfaces/ianjuta-debugger-register.h>
33 typedef struct _DmaQueueCommand DmaQueueCommand
;
35 #define STATE_TO_CHANGE 8 /* To convert IAnjutaDebuggerStatus to command go to */
36 #define STATE_TO_NEED 16 /* To convert IAnjutaDebuggerStatus to command need */
42 CHANGE_MASK
= 0x3F << STATE_TO_CHANGE
,
43 STOP_DEBUGGER
= 1 << (IANJUTA_DEBUGGER_STOPPED
+ STATE_TO_CHANGE
- 1),
44 START_DEBUGGER
= 1 << (IANJUTA_DEBUGGER_STARTED
+ STATE_TO_CHANGE
- 1),
45 LOAD_PROGRAM
= 1 << (IANJUTA_DEBUGGER_PROGRAM_LOADED
+ STATE_TO_CHANGE
- 1),
46 STOP_PROGRAM
= 1 << (IANJUTA_DEBUGGER_PROGRAM_STOPPED
+ STATE_TO_CHANGE
- 1),
47 RUN_PROGRAM
= 1 << (IANJUTA_DEBUGGER_PROGRAM_RUNNING
+ STATE_TO_CHANGE
- 1),
48 NEED_DEBUGGER_STOPPED
= STOP_DEBUGGER
<< (STATE_TO_NEED
- STATE_TO_CHANGE
),
49 NEED_DEBUGGER_STARTED
= START_DEBUGGER
<< (STATE_TO_NEED
- STATE_TO_CHANGE
),
50 NEED_PROGRAM_LOADED
= LOAD_PROGRAM
<< (STATE_TO_NEED
- STATE_TO_CHANGE
),
51 NEED_PROGRAM_STOPPED
= STOP_PROGRAM
<< (STATE_TO_NEED
- STATE_TO_CHANGE
),
52 NEED_PROGRAM_RUNNING
= RUN_PROGRAM
<< (STATE_TO_NEED
- STATE_TO_CHANGE
),
53 CANCEL_IF_PROGRAM_RUNNING
= 1 << 21,
54 CANCEL_ALL_COMMAND
= 1 << 22,
55 ASYNCHRONOUS
= 1 << 23,
56 HIGH_PRIORITY
= 1 << 24
59 /* Create a new command structure and append to command queue */
60 gboolean
dma_queue_initialize (DmaDebuggerQueue
*self
);
61 gboolean
dma_queue_load (DmaDebuggerQueue
*self
, const gchar
*file
, const gchar
* mime_type
, const GList
*search_dirs
);
62 gboolean
dma_queue_set_working_directory (DmaDebuggerQueue
*self
, const gchar
*directory
);
63 gboolean
dma_queue_set_environment (DmaDebuggerQueue
*self
, gchar
**variables
);
64 gboolean
dma_queue_attach (DmaDebuggerQueue
*self
, pid_t pid
, const GList
*search_dirs
);
65 gboolean
dma_queue_start (DmaDebuggerQueue
*self
, const gchar
*args
, gboolean terminal
, gboolean stop
);
66 gboolean
dma_queue_connect (DmaDebuggerQueue
*self
, const gchar
*server
, const gchar
*args
, gboolean terminal
, gboolean stop
);
67 gboolean
dma_queue_unload (DmaDebuggerQueue
*self
);
68 gboolean
dma_queue_quit (DmaDebuggerQueue
*self
);
69 gboolean
dma_queue_abort (DmaDebuggerQueue
*self
);
70 gboolean
dma_queue_run (DmaDebuggerQueue
*self
);
71 gboolean
dma_queue_step_in (DmaDebuggerQueue
*self
);
72 gboolean
dma_queue_step_over (DmaDebuggerQueue
*self
);
73 gboolean
dma_queue_run_to (DmaDebuggerQueue
*self
, const gchar
*file
, gint line
);
74 gboolean
dma_queue_run_from (DmaDebuggerQueue
*self
, const gchar
*file
, gint line
);
75 gboolean
dma_queue_stepi_in (DmaDebuggerQueue
*self
);
76 gboolean
dma_queue_stepi_over (DmaDebuggerQueue
*self
);
77 gboolean
dma_queue_run_to_address (DmaDebuggerQueue
*self
, gulong address
);
78 gboolean
dma_queue_run_from_address (DmaDebuggerQueue
*self
, gulong address
);
79 gboolean
dma_queue_step_out (DmaDebuggerQueue
*self
);
80 gboolean
dma_queue_exit (DmaDebuggerQueue
*self
);
81 gboolean
dma_queue_interrupt (DmaDebuggerQueue
*self
);
82 gboolean
dma_queue_inspect (DmaDebuggerQueue
*self
, const gchar
*expression
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
83 gboolean
dma_queue_evaluate (DmaDebuggerQueue
*self
, const gchar
*name
, const gchar
* value
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
84 gboolean
dma_queue_send_command (DmaDebuggerQueue
*self
, const gchar
* command
);
85 gboolean
dma_queue_print (DmaDebuggerQueue
*self
, const gchar
* variable
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
86 gboolean
dma_queue_list_local (DmaDebuggerQueue
*self
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
87 gboolean
dma_queue_list_argument (DmaDebuggerQueue
*self
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
88 gboolean
dma_queue_list_thread (DmaDebuggerQueue
*self
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
89 gboolean
dma_queue_set_thread (DmaDebuggerQueue
*self
, gint thread
);
90 gboolean
dma_queue_info_thread (DmaDebuggerQueue
*self
, gint thread
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
91 gboolean
dma_queue_info_signal (DmaDebuggerQueue
*self
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
92 gboolean
dma_queue_info_sharedlib (DmaDebuggerQueue
*self
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
93 gboolean
dma_queue_handle_signal (DmaDebuggerQueue
*self
, const gchar
* name
, gboolean stop
, gboolean print
, gboolean ignore
);
94 gboolean
dma_queue_set_frame (DmaDebuggerQueue
*self
, guint frame
);
95 gboolean
dma_queue_list_frame (DmaDebuggerQueue
*self
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
96 gboolean
dma_queue_dump_stack_trace (DmaDebuggerQueue
*self
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
97 gboolean
dma_queue_list_register (DmaDebuggerQueue
*self
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
98 gboolean
dma_queue_callback (DmaDebuggerQueue
*self
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
99 void dma_queue_enable_log (DmaDebuggerQueue
*self
, IAnjutaMessageView
*log
);
100 void dma_queue_disable_log (DmaDebuggerQueue
*self
);
101 gboolean
dma_queue_add_breakpoint_at_line (DmaDebuggerQueue
*self
, guint
*id
, const gchar
* file
, guint line
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
102 gboolean
dma_queue_add_breakpoint_at_function (DmaDebuggerQueue
*self
, guint
*id
, const gchar
* file
, const gchar
* function
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
103 gboolean
dma_queue_add_breakpoint_at_address (DmaDebuggerQueue
*self
, guint
*id
, gulong address
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
104 gboolean
dma_queue_enable_breakpoint (DmaDebuggerQueue
*self
, guint id
, gboolean enable
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
105 gboolean
dma_queue_ignore_breakpoint (DmaDebuggerQueue
*self
, guint id
, guint ignore
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
106 gboolean
dma_queue_condition_breakpoint (DmaDebuggerQueue
*self
, guint id
, const gchar
*condition
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
107 gboolean
dma_queue_remove_breakpoint (DmaDebuggerQueue
*self
, guint id
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
108 gboolean
dma_queue_list_breakpoint (DmaDebuggerQueue
*self
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
109 gboolean
dma_queue_list_register (DmaDebuggerQueue
*self
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
110 gboolean
dma_queue_update_register (DmaDebuggerQueue
*self
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
111 gboolean
dma_queue_write_register (DmaDebuggerQueue
*self
, IAnjutaDebuggerRegisterData
*value
);
112 gboolean
dma_queue_inspect_memory (DmaDebuggerQueue
*self
, gulong address
, guint length
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
113 gboolean
dma_queue_disassemble (DmaDebuggerQueue
*self
, gulong address
, guint length
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
114 gboolean
dma_queue_delete_variable (DmaDebuggerQueue
*self
, const gchar
*name
);
115 gboolean
dma_queue_evaluate_variable (DmaDebuggerQueue
*self
, const gchar
*name
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
116 gboolean
dma_queue_assign_variable (DmaDebuggerQueue
*self
, const gchar
*name
, const gchar
*value
);
117 gboolean
dma_queue_list_children (DmaDebuggerQueue
*self
, const gchar
*name
, guint from
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
118 gboolean
dma_queue_create_variable (DmaDebuggerQueue
*self
, const gchar
*name
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
119 gboolean
dma_queue_update_variable (DmaDebuggerQueue
*self
, IAnjutaDebuggerCallback callback
, gpointer user_data
);
121 void dma_command_free (DmaQueueCommand
*cmd
);
123 void dma_command_cancel (DmaQueueCommand
*cmd
);
124 gboolean
dma_command_run (DmaQueueCommand
*cmd
, IAnjutaDebugger
*debugger
, DmaDebuggerQueue
* queue
, GError
**error
);
125 void dma_command_callback (DmaQueueCommand
*cmd
, const gpointer data
, GError
* err
);
127 gboolean
dma_command_is_valid_in_state (DmaQueueCommand
*cmd
, IAnjutaDebuggerState state
);
128 IAnjutaDebuggerState
dma_command_is_going_to_state (DmaQueueCommand
*cmd
);
129 gboolean
dma_command_has_flag (DmaQueueCommand
*cmd
, DmaCommandFlag flag
);
131 int dma_command_get_type (DmaQueueCommand
*cmd
);