Hi,
I'm trying to create a simple debug plugin for Geany and I want to work with the markers. In fact, I tried to create a marker in the plugin_init and delete it in the plugin_cleanup:
#define SSM(m, w, l) scintilla_send_message(sci, m, w, l) ... void plugin_init(GeanyData *data) { ScintillaObject* sci = document_get_current()->editor->sci; SSM(SCI_MARKERDEFINE, 0, SC_MARK_CIRCLE); markerHandle = SSM(SCI_MARKERADD, 28, 0); }
void plugin_cleanup(void) { SSM(SCI_MARKERDELETEHANDLE, markerHandle, 0); }
and the result is that the marker is created successfully but when the plugin is unloaded, Geany is exited immediately. I have tried to remove the marker with the other messages (SCI_MARKERDELETE, SCI_MARKERDELETEALL) but that error still exists and I don't know why.
Thank you very much for your help!
On 6 April 2010 09:26, Lai Hoang Nam laihoangnam@gmail.com wrote:
Hi,
I'm trying to create a simple debug plugin for Geany and I want to work with the markers. In fact, I tried to create a marker in the plugin_init and delete it in the plugin_cleanup:
#define SSM(m, w, l) scintilla_send_message(sci, m, w, l) ... void plugin_init(GeanyData *data) { ScintillaObject* sci = document_get_current()->editor->sci; SSM(SCI_MARKERDEFINE, 0, SC_MARK_CIRCLE); markerHandle = SSM(SCI_MARKERADD, 28, 0); }
void plugin_cleanup(void) { SSM(SCI_MARKERDELETEHANDLE, markerHandle, 0); }
and the result is that the marker is created successfully but when the plugin is unloaded, Geany is exited immediately. I have tried to remove the marker with the other messages (SCI_MARKERDELETE, SCI_MARKERDELETEALL) but that error still exists and I don't know why.
Thank you very much for your help!
Hi,
You don't say which language you are creating the debugger for, but note that there is already a plugin front end for gdb which supports C,C++, Pascal, Ada, Fortran etc.
Looking at the source of that plugin may help provide you with a known working outline of a debugger plugin (or save the effort if its a gdb supported language)
Cheers Lex
Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
On Tue, 6 Apr 2010 01:26:06 +0200, Lai Hoang Nam laihoangnam@gmail.com wrote:
Hi,
I'm trying to create a simple debug plugin for Geany and I want to work with the markers.
Additionally to what Lex said, your code is slightly wrong which explains the crashes. Why it works on startup is probably just luck. The idea of using markers is a good addition to the existing geanygdb plugin.
In fact, I tried to create a marker in the plugin_init and delete it in
the
plugin_cleanup:
#define SSM(m, w, l) scintilla_send_message(sci, m, w, l) ... void plugin_init(GeanyData *data) { ScintillaObject* sci = document_get_current()->editor->sci; SSM(SCI_MARKERDEFINE, 0, SC_MARK_CIRCLE);
must be: SSM(sci, SCI_MARKERDEFINE, 0, SC_MARK_CIRCLE);
Note the first argument.
void plugin_cleanup(void) { SSM(SCI_MARKERDELETEHANDLE, markerHandle, 0);
same here: SSM(sci, SCI_MARKERDELETEHANDLE, markerHandle, 0);
Regards, Enrico