File: plugin.c

package info (click to toggle)
anjuta 2%3A3.34.0-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 72,440 kB
  • sloc: ansic: 207,444; sh: 47,499; cpp: 11,461; makefile: 3,586; yacc: 2,821; perl: 2,094; lex: 1,546; xml: 904; python: 149; sql: 99; javascript: 51; java: 10
file content (703 lines) | stat: -rw-r--r-- 20,567 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
    Copyright (C) 2009 Maxim Ermilov   <zaspire@rambler.ru>

    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
*/

#include <glib.h>
#include <config.h>
#include <libanjuta/anjuta-shell.h>
#include <libanjuta/anjuta-debug.h>
#include <libanjuta/interfaces/ianjuta-document-manager.h>
#include <libanjuta/interfaces/ianjuta-debugger.h>
#include <libanjuta/interfaces/ianjuta-debugger-breakpoint.h>
#include <libanjuta/interfaces/ianjuta-debugger-register.h>
#include <libanjuta/interfaces/ianjuta-debugger-memory.h>
#include <libanjuta/interfaces/ianjuta-debugger-instruction.h>
#include <libanjuta/interfaces/ianjuta-debugger-variable.h>
#include <libanjuta/interfaces/ianjuta-terminal.h>
#include <libanjuta/anjuta-plugin.h>
#include "plugin.h"
#include "debugger-js.h"

struct _JSDbg
{
	AnjutaPlugin parent;
	DebuggerJs *debugger;
};

struct _JSDbgClass
{
	AnjutaPluginClass parent_class;
};

static gpointer parent_class;

#define DEBUGGER_PORT 2234

static gboolean
js_debugger_activate (AnjutaPlugin *plugin)
{
	JSDbg *js_debugger;

	DEBUG_PRINT ("%s", "JSDbg: Activating JSDbg plugin ...");
	js_debugger = (JSDbg*) plugin;

	return TRUE;
}

static gboolean
js_debugger_deactivate (AnjutaPlugin *plugin)
{
	DEBUG_PRINT ("%s", "JSDbg: Dectivating JSDbg plugin ...");

	return TRUE;
}

static void
js_debugger_finalize (GObject *obj)
{
	/* Finalization codes here */
	G_OBJECT_CLASS (parent_class)->finalize (obj);
}

static void
js_debugger_dispose (GObject *obj)
{
	/* Disposition codes */
	G_OBJECT_CLASS (parent_class)->dispose (obj);
}

static void
js_debugger_instance_init (GObject *obj)
{
}

static void
js_debugger_class_init (GObjectClass *klass)
{
	AnjutaPluginClass *plugin_class = ANJUTA_PLUGIN_CLASS (klass);

	parent_class = g_type_class_peek_parent (klass);

	plugin_class->activate = js_debugger_activate;
	plugin_class->deactivate = js_debugger_deactivate;
	klass->finalize = js_debugger_finalize;
	klass->dispose = js_debugger_dispose;
}

/* Implementation of IAnjutaDebugger interface
 *---------------------------------------------------------------------------*/

static IAnjutaDebuggerState
idebugger_get_state (IAnjutaDebugger *plugin, GError **err)
{
	DEBUG_PRINT ("%s", "get_state: Implemented");

	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	if (self->debugger == NULL)
		return IANJUTA_DEBUGGER_STOPPED;
	return debugger_js_get_state (self->debugger);
}

static void
on_error (DebuggerJs *self, const gchar *text, gpointer user_data)
{
	JSDbg *object = ANJUTA_PLUGIN_JSDBG (user_data);

	anjuta_util_dialog_error (GTK_WINDOW (ANJUTA_PLUGIN (object)->shell),
							  _("Error: %s"), text);
	if (object->debugger != NULL)
		g_object_unref (object->debugger);
	object->debugger = NULL;
}

static gboolean
idebugger_load (IAnjutaDebugger *plugin, const gchar *file, const gchar* mime_type,
				const GList *search_dirs, GError **err)
{
	DEBUG_PRINT ("%s", "load: Implemented");

	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	if (self->debugger != NULL)
		g_object_unref (self->debugger);
	if ( (self->debugger = debugger_js_new (DEBUGGER_PORT, file, plugin)) )
	{
		g_signal_connect (self->debugger, "DebuggerError", G_CALLBACK (on_error), self);
		return TRUE;
	}
	on_error (NULL, _("Error: cant bind port"), self);
	return FALSE;
}

static gboolean
idebugger_unload (IAnjutaDebugger *plugin, GError **err)
{
	DEBUG_PRINT ("%s", "unload: Implemented");

	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	if (self->debugger != NULL)
		g_object_unref (self->debugger);

	return TRUE;
}

static gboolean
idebugger_set_working_directory (IAnjutaDebugger *plugin, const gchar *directory, GError **err)
{
	DEBUG_PRINT ("%s %s", "set_working_directory: Implemented", directory);

	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	debugger_js_set_work_dir (self->debugger, directory);
	return TRUE;
}

static gboolean
idebugger_set_environment (IAnjutaDebugger *plugin, gchar **variables, GError **err)
{
	DEBUG_PRINT ("%s", "set_environment: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_attach (IAnjutaDebugger *plugin, pid_t pid, const GList *search_dirs, GError **err)
{
	DEBUG_PRINT ("%s", "attach: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_start (IAnjutaDebugger *plugin, const gchar *argument, gboolean terminal, gboolean stop, GError **err)
{
	DEBUG_PRINT ("%s", "start: Implemented");

	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	debugger_js_start (self->debugger, argument);
	return TRUE;
}

static gboolean
idebugger_connect (IAnjutaDebugger *plugin, const gchar *server, const gchar *argument, gboolean terminal, gboolean stop, GError **err)
{
	DEBUG_PRINT ("%s", "connect: Not Implemented");
	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	gint port = DEBUGGER_PORT;

	if (server)
	{
		gint len = strlen (server), k;

		for (k = len - 1; k >= 0; k--)
		{
			if (server[k] > '9' || server[k] < '0')
				break;
			port = port * 10 + server[k] - '0';
		}
		k++;
		if (k != len - 1)
			sscanf (server + k, "%d", &port);
	}
	debugger_js_start_remote (self->debugger, port);
	return TRUE;
}

static gboolean
idebugger_quit (IAnjutaDebugger *plugin, GError **err)
{
	DEBUG_PRINT ("%s", "quit: Implemented");
	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	debugger_js_stop (self->debugger);
	return TRUE;
}

static gboolean
idebugger_abort (IAnjutaDebugger *plugin, GError **err)
{
	DEBUG_PRINT ("%s", "abort: Implemented");
	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	debugger_js_stop (self->debugger);
	return TRUE;
}

static gboolean
idebugger_run (IAnjutaDebugger *plugin, GError **err)
{
	DEBUG_PRINT ("%s", "run: Implemented");

	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	debugger_js_continue (self->debugger);
	return TRUE;
}

static gboolean
idebugger_step_in (IAnjutaDebugger *plugin, GError **err)
{
	DEBUG_PRINT ("%s", "step_in: Implemented");
	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	debugger_js_stepin (self->debugger);
	return TRUE;
}

static gboolean
idebugger_step_over (IAnjutaDebugger *plugin, GError **err)
{
	DEBUG_PRINT ("%s", "step_over: Implemented");
	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	debugger_js_stepover (self->debugger);
	return TRUE;
}

static gboolean
idebugger_run_to (IAnjutaDebugger *plugin, const gchar* file,
						   gint line, GError **err)
{
	DEBUG_PRINT ("%s", "run_to: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_step_out (IAnjutaDebugger *plugin, GError **err)
{
	DEBUG_PRINT ("%s", "step_out: Implemented");

	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	debugger_js_stepout (self->debugger);
	return TRUE;
}

static gboolean
idebugger_exit (IAnjutaDebugger *plugin, GError **err)
{
	DEBUG_PRINT ("%s", "exit: Implemented");
	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	debugger_js_stop (self->debugger);
	return TRUE;
}

static gboolean
idebugger_interrupt (IAnjutaDebugger *plugin, GError **err)
{
	DEBUG_PRINT ("%s", "interrupt: Not Implemented");

	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	debugger_js_stop (self->debugger);
	return TRUE;
}

static gboolean
idebugger_inspect (IAnjutaDebugger *plugin, const gchar *name, IAnjutaDebuggerGCharCallback callback, gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "inspect: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_evaluate (IAnjutaDebugger *plugin, const gchar *name, const gchar *value, IAnjutaDebuggerGCharCallback callback, gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "evaluate : Not Implemented");

	return FALSE;
}

static gboolean
idebugger_send_command (IAnjutaDebugger *plugin, const gchar* command, GError **err)
{
	DEBUG_PRINT ("%s", "send_command: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_print (IAnjutaDebugger *plugin, const gchar* variable, IAnjutaDebuggerGCharCallback callback, gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "print: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_list_local (IAnjutaDebugger *plugin, IAnjutaDebuggerGListCallback callback , gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "list_local: Implemented");
	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	debugger_js_list_local (self->debugger, callback, user_data);
	return TRUE;
}

static gboolean
idebugger_list_argument (IAnjutaDebugger *plugin, IAnjutaDebuggerGListCallback callback , gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "list_argument: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_info_signal (IAnjutaDebugger *plugin, IAnjutaDebuggerGListCallback callback , gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "info_signal: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_info_sharedlib (IAnjutaDebugger *plugin, IAnjutaDebuggerGListCallback callback , gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "info_sharedlib: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_handle_signal (IAnjutaDebugger *plugin, const gchar* name, gboolean stop, gboolean print, gboolean ignore, GError **err)
{
	DEBUG_PRINT ("%s", "handle_signal: Not Implemented");

	return TRUE;
}

static gboolean
idebugger_info_frame (IAnjutaDebugger *plugin, guint frame, IAnjutaDebuggerGListCallback callback , gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "info_frame: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_info_args (IAnjutaDebugger *plugin, IAnjutaDebuggerGListCallback callback , gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "info_args: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_info_target (IAnjutaDebugger *plugin, IAnjutaDebuggerGListCallback callback , gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "info_target: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_info_program (IAnjutaDebugger *plugin, IAnjutaDebuggerGListCallback callback , gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "info_program: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_info_udot (IAnjutaDebugger *plugin, IAnjutaDebuggerGListCallback callback , gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "info_udot: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_info_variables (IAnjutaDebugger *plugin, IAnjutaDebuggerGListCallback callback , gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "info_variables: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_set_frame (IAnjutaDebugger *plugin, guint frame, GError **err)
{
	DEBUG_PRINT ("%s", "set_frame: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_list_frame (IAnjutaDebugger *plugin, IAnjutaDebuggerGListCallback callback , gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "list_frame: Implemented");
	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	debugger_js_list_frame (self->debugger, callback, user_data);
	return TRUE;
}

static gboolean
idebugger_set_thread (IAnjutaDebugger *plugin, gint thread, GError **err)
{
	DEBUG_PRINT ("%s", "set_thread: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_list_thread (IAnjutaDebugger *plugin, IAnjutaDebuggerGListCallback callback , gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "list_thread: Implemented(Fake)");
	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	debugger_js_list_thread (self->debugger, callback, user_data);
	return TRUE;
}

static gboolean
idebugger_info_thread (IAnjutaDebugger *plugin, gint thread, IAnjutaDebuggerGListCallback callback , gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "info_thread: Implemented(Fake)");
	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	debugger_js_info_thread (self->debugger, callback, thread, user_data);
	return TRUE;
}

static gboolean
idebugger_run_from (IAnjutaDebugger *plugin, const gchar *file, gint line, GError **err)
{
	DEBUG_PRINT ("%s", "run_from: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_dump_stack_trace (IAnjutaDebugger *plugin, IAnjutaDebuggerGListCallback callback , gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "dump_stack_trace: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_callback (IAnjutaDebugger *plugin, IAnjutaDebuggerCallback callback , gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "callback: Implemented");
	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	debugger_js_signal (self->debugger, callback, user_data);
	return TRUE;
}

static void
idebugger_enable_log (IAnjutaDebugger *plugin, IAnjutaMessageView *log, GError **err)
{
	DEBUG_PRINT ("%s", "enable_log: Not Implemented");
}

static void
idebugger_disable_log (IAnjutaDebugger *plugin, GError **err)
{
	DEBUG_PRINT ("%s", "disable_log: Not Implemented");
}

static void
idebugger_iface_init (IAnjutaDebuggerIface *iface)
{
	iface->get_state = idebugger_get_state;
	iface->attach = idebugger_attach;
	iface->load = idebugger_load;
	iface->set_working_directory = idebugger_set_working_directory;
	iface->set_environment = idebugger_set_environment;
	iface->start = idebugger_start;
	iface->connect = idebugger_connect;
	iface->unload = idebugger_unload;
	iface->quit = idebugger_quit;
	iface->abort = idebugger_abort;
	iface->run = idebugger_run;
	iface->step_in = idebugger_step_in;
	iface->step_over = idebugger_step_over;
	iface->step_out = idebugger_step_out;
	iface->run_to = idebugger_run_to;
	iface->run_from = idebugger_run_from;
	iface->exit = idebugger_exit;
	iface->interrupt = idebugger_interrupt;

	iface->inspect = idebugger_inspect;
	iface->evaluate = idebugger_evaluate;

	iface->print = idebugger_print;
	iface->list_local = idebugger_list_local;
	iface->list_argument = idebugger_list_argument;
	iface->info_frame = idebugger_info_frame;
	iface->info_signal = idebugger_info_signal;
	iface->info_sharedlib = idebugger_info_sharedlib;
	iface->info_args = idebugger_info_args;
	iface->info_target = idebugger_info_target;
	iface->info_program = idebugger_info_program;
	iface->info_udot = idebugger_info_udot;
	iface->info_variables = idebugger_info_variables;
	iface->handle_signal = idebugger_handle_signal;
	iface->list_frame = idebugger_list_frame;
	iface->set_frame = idebugger_set_frame;
	iface->list_thread = idebugger_list_thread;
	iface->set_thread = idebugger_set_thread;
	iface->info_thread = idebugger_info_thread;
	iface->dump_stack_trace = idebugger_dump_stack_trace;

	iface->send_command = idebugger_send_command;

	iface->callback = idebugger_callback;

	iface->enable_log = idebugger_enable_log;
	iface->disable_log = idebugger_disable_log;
}

/* Implementation of IAnjutaDebuggerBreakpoint interface
 *---------------------------------------------------------------------------*/

static gint
idebugger_breakpoint_implement (IAnjutaDebuggerBreakpoint *plugin, GError **err)
{
	return IANJUTA_DEBUGGER_BREAKPOINT_ON_LINE
		| IANJUTA_DEBUGGER_BREAKPOINT_ENABLE
		| IANJUTA_DEBUGGER_BREAKPOINT_IGNORE
		| IANJUTA_DEBUGGER_BREAKPOINT_CONDITION;
}

static gboolean
idebugger_breakpoint_add_at_line (IAnjutaDebuggerBreakpoint *plugin, const gchar* file, guint line, IAnjutaDebuggerBreakpointCallback callback, gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "breakpoint_add_at_line: Implemented");
	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	debugger_js_add_breakpoint (self->debugger, file, line);
	return FALSE;
}

static gboolean
idebugger_breakpoint_enable (IAnjutaDebuggerBreakpoint *plugin, guint id, gboolean enable, IAnjutaDebuggerBreakpointCallback callback, gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "breakpoint_enable: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_breakpoint_ignore (IAnjutaDebuggerBreakpoint *plugin, guint id, guint ignore, IAnjutaDebuggerBreakpointCallback callback, gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "breakpoint_ignore: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_breakpoint_condition (IAnjutaDebuggerBreakpoint *plugin, guint id, const gchar *condition, IAnjutaDebuggerBreakpointCallback callback, gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "breakpoint_condition: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_breakpoint_remove (IAnjutaDebuggerBreakpoint *plugin, guint id, IAnjutaDebuggerBreakpointCallback callback, gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "breakpoint_remove: Not Implemented");

	return FALSE;
}

static gboolean
idebugger_breakpoint_list (IAnjutaDebuggerBreakpoint *plugin, IAnjutaDebuggerGListCallback callback, gpointer user_data, GError **err)
{
	DEBUG_PRINT ("%s", "breakpoint_list: Implemented");
	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	debugger_js_breakpoint_list (self->debugger, callback, user_data);
	return TRUE;
}

static void
idebugger_breakpoint_iface_init (IAnjutaDebuggerBreakpointIface *iface)
{
	iface->implement_breakpoint = idebugger_breakpoint_implement;
	iface->set_breakpoint_at_line = idebugger_breakpoint_add_at_line;
	iface->clear_breakpoint = idebugger_breakpoint_remove;
	iface->list_breakpoint = idebugger_breakpoint_list;
	iface->set_breakpoint_at_address = NULL;
	iface->set_breakpoint_at_function = NULL;
	iface->enable_breakpoint = idebugger_breakpoint_enable;
	iface->ignore_breakpoint = idebugger_breakpoint_ignore;
	iface->condition_breakpoint = idebugger_breakpoint_condition;
}

/* Implementation of IAnjutaDebuggerVariable interface
 *---------------------------------------------------------------------------*/

static gboolean
idebugger_variable_destroy (IAnjutaDebuggerVariable *plugin, const gchar *name, GError **error)
{
	DEBUG_PRINT ("%s", "variable_destroy: Not Implemented");
	return TRUE;
}

static gboolean
idebugger_variable_evaluate (IAnjutaDebuggerVariable *plugin, const gchar *name, IAnjutaDebuggerGCharCallback callback , gpointer user_data, GError **error)
{
	puts (name);
	DEBUG_PRINT ("%s", "variable_evaluate: Not Implemented");
	return FALSE;
}

static gboolean
idebugger_variable_assign (IAnjutaDebuggerVariable *plugin, const gchar *name, const gchar *value, GError **error)
{
	puts (name);
	DEBUG_PRINT ("%s", "variable_assign: Not Implemented");
	return FALSE;
}

static gboolean
idebugger_variable_list_children (IAnjutaDebuggerVariable *plugin, const gchar *name, guint from, IAnjutaDebuggerGListCallback callback , gpointer user_data, GError **error)
{
	puts (name);
	DEBUG_PRINT ("%s", "variable_list_children: Implemented");
	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	/* from argument is not used as this function always return all the children */
	debugger_js_variable_list_children (self->debugger, callback, name, user_data);
	return TRUE;
}

static gboolean
idebugger_variable_create (IAnjutaDebuggerVariable *plugin, const gchar *name, IAnjutaDebuggerVariableCallback callback , gpointer user_data, GError **error)
{
	puts (name);
	DEBUG_PRINT ("%s", "idebugger_variable_create: Implemented");
	JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
	debugger_js_variable_create (self->debugger, callback, name, user_data);
	return TRUE;
}

static gboolean
idebugger_variable_update (IAnjutaDebuggerVariable *plugin, IAnjutaDebuggerGListCallback callback , gpointer user_data, GError **error)
{
	DEBUG_PRINT ("%s", "idebugger_variable_update: Not Implemented");
	return FALSE;
}

static void
idebugger_variable_iface_init (IAnjutaDebuggerVariableIface *iface)
{
	iface->destroy = idebugger_variable_destroy;
	iface->evaluate = idebugger_variable_evaluate;
	iface->assign = idebugger_variable_assign;
	iface->list_children = idebugger_variable_list_children;
	iface->create = idebugger_variable_create;
	iface->update = idebugger_variable_update;
}

ANJUTA_PLUGIN_BEGIN (JSDbg, js_debugger);
ANJUTA_PLUGIN_ADD_INTERFACE(idebugger, IANJUTA_TYPE_DEBUGGER);
ANJUTA_PLUGIN_ADD_INTERFACE(idebugger_breakpoint, IANJUTA_TYPE_DEBUGGER_BREAKPOINT);
ANJUTA_PLUGIN_ADD_INTERFACE(idebugger_variable, IANJUTA_TYPE_DEBUGGER_VARIABLE);
ANJUTA_PLUGIN_END;

ANJUTA_SIMPLE_PLUGIN (JSDbg, js_debugger);