Hi,
Since the end of the world is coming soon [1], here [2] is a little something to play with. Note that it currently reads data/scope.glade on startup (no "make install" yet), so geany must be started from the directory where you unpacked scope. Please read scope.html, TODO and notes before asking questions. Of course, there are two questions that I must answer properly first:
1. Why do we need another gdb front-end?
Don't know about you. I needed something that runs under win~1, has decent Locale support and the abilities to change values and execute gdb commands at any time.
2. Is it possible to merge debugger and Scope?
No more that we can merge SciTE and Geany. They are both editors, based on Scintilla and using gtk+ under *nix, but that's about it.
--
Now about the plugin symbols etc.
"project-before-save" signal: highly recommended. When a program is started, Scope marks all source files as read-only (unless they are already). When saving a Geany session (file list) while a program is running, Scope temporarily re-marks the source files as read-write, to avoid them being saved in the session with read-only mark. For the default session, "save-settings" does the job, but for project session, an extra signal is required. The signal can also be used for plugin project preferences which are not part of the project dialog. Currentry, no such preferences can be created.
ui_setup_open_button_callback() - recommended. Several plugins define their own version of this, and we had a short discussion in the ML, which ended with the "conclusion" that the button/entry must be properly g-objectified, which nobody is willing to do.
[3] - recommended. Without it, the toolbar looks funny.
editor_get_default_selection() - optional. There should be other plugins defining their own version, but I haven't checked.
utils_str_replace_all() - optional. utils_string_replace_all() and several utils_str_*() functions are accessible, so why not this one?
ui_add_config_file_menu_item() - maybe unnecessary. Used to add scope.conf to Tools -> Configuration files. Must be modified to return the menu item created, so the plugin can remove it on plugin_cleanup().
stash_tree_{setup,display,update}() - maybe unnecessary. Used to create a stash tree with the global Scope preferences (except for colors etc.) in Plugin Preferences. Not sufficient, since the color and alpha definitions are missing, but looks nice. :)
Note that Scope _will_ run on unmodified Geany 1.22 or later. 2012-08-07 or later is recommended due to changes in scintilla. scope.glade was created with 3.6.7, but mostly edited manually.
--
[1] http://www.greatdreams.com/end-world.htm
[2] http://sourceforge.net/tracker/?func=detail&aid=3593744&group_id=222...
[3] http://sourceforge.net/tracker/?func=detail&aid=3522755&group_id=153...
Le 07/12/2012 19:56, Dimitar Zhekov a écrit :
Hi,
Since the end of the world is coming soon [1], here [2] is a little something to play with. Note that it currently reads data/scope.glade on startup (no "make install" yet), so geany must be started from the directory where you unpacked scope. Please read scope.html, TODO and notes before asking questions. Of course, there are two questions that I must answer properly first:
- Why do we need another gdb front-end?
Don't know about you. I needed something that runs under win~1, has decent Locale support and the abilities to change values and execute gdb commands at any time.
I saw the next point, but couldn't this have been done in the other debugger plugin? It looks a little bit like a duplicate :)
- Is it possible to merge debugger and Scope?
No more that we can merge SciTE and Geany. They are both editors, based on Scintilla and using gtk+ under *nix, but that's about it.
--
[...]
Anyway, I had some spare time so I decided to test your plugin. Unfortunately, I couldn't build it :(
First:
$ make gcc -O2 -Wall -W '-DLOCALEDIR="/tmp"' '-DGETTEXT_PACKAGE="package"' -c break.c -fPIC `pkg-config --cflags geany` gcc -O2 -Wall -W '-DLOCALEDIR="/tmp"' '-DGETTEXT_PACKAGE="package"' -c conterm.c -fPIC `pkg-config --cflags geany` conterm.c:42:21: fatal error: vte/vte.h: Aucun fichier ou dossier de ce type compilation terminated. make: *** [conterm.o] Erreur 1
OK, that's problematic but easy to solve. I modified the Makefile as follows to fix this:
$ git diff diff --git a/Makefile b/Makefile index f817f6f..3e62e63 100644 --- a/Makefile +++ b/Makefile @@ -11,13 +11,13 @@ COMMON = break.h conterm.h debug.h gtk216.h inspect.h local.h menu.h parse.h plu $(OBJS): $(COMMON)
$(OBJS) main.o: %.o : %.c - gcc $(CFLAGS) -c $< -fPIC `pkg-config --cflags geany` + gcc $(CFLAGS) -c $< -fPIC `pkg-config --cflags geany vte`
debug.i : debug.c gcc -E $< `pkg-config --cflags geany` > $@
scope.so: $(OBJS) main.o - gcc -g -o scope.so $(OBJS) -shared `pkg-config --libs geany` -lvte -lutil + gcc -g -o scope.so $(OBJS) -shared `pkg-config --libs geany vte` -lutil
check: main.o scope.so gcc main.o scope.so
But now I get:
$ make gcc -O2 -Wall -W '-DLOCALEDIR="/tmp"' '-DGETTEXT_PACKAGE="package"' -c break.c -fPIC `pkg-config --cflags geany vte` gcc -O2 -Wall -W '-DLOCALEDIR="/tmp"' '-DGETTEXT_PACKAGE="package"' -c conterm.c -fPIC `pkg-config --cflags geany vte` conterm.c: In function ‘conterm_init’: conterm.c:439:37: error: ‘program_pty_master’ undeclared (first use in this function) conterm.c:439:37: note: each undeclared identifier is reported only once for each function it appears in make: *** [conterm.o] Erreur 1
and I can't find anywhere this program_pty_master, and the Web doesn't seem to know about it either. Ah and yes, I have -Werror-implicit-function-declaration enabled, but everything should build with it -- and it removing it wouldn't make that function appear magically I think :)
Also, in scope.c:debug_menu_keys[] you should use the `N_()` macro to mark the second column as translatable, simply adding a comment is not enough for translation extractor to find them.
Regards, Colomban
On Fri, 07 Dec 2012 21:43:27 +0100 Colomban Wendling lists.ban@herbesfolles.org wrote:
Le 07/12/2012 19:56, Dimitar Zhekov a écrit :
- Why do we need another gdb front-end?
Don't know about you. I needed something that runs under win~1, has decent Locale support and the abilities to change values and execute gdb commands at any time.
I saw the next point, but couldn't this have been done in the other debugger plugin? It looks a little bit like a duplicate :)
Yes, having 2 gdb plugins is a duplicate. No, I coundn't do it inside debugger. The communication with gdb is async, which requires very different code, and the UI is not very similar either, except for having a debug page with subpages...
Anyway, I had some spare time so I decided to test your plugin. Unfortunately, I couldn't build it :(
conterm.c:42:21: fatal error: vte/vte.h: Aucun fichier ou dossier de ce type compilation terminated. make: *** [conterm.o] Erreur 1
OK, that's problematic but easy to solve. I modified the Makefile as follows to fix this:
$(OBJS) main.o: %.o : %.c
gcc $(CFLAGS) -c $< -fPIC `pkg-config --cflags geany`
gcc $(CFLAGS) -c $< -fPIC `pkg-config --cflags geany vte`
scope.so: $(OBJS) main.o
gcc -g -o scope.so $(OBJS) -shared `pkg-config --libs geany`
-lvte -lutil
gcc -g -o scope.so $(OBJS) -shared `pkg-config --libs geany vte`
-lutil
Thanks.
But now I get:
conterm.c:439:37: error: ‘program_pty_master’ undeclared (first use in this function)
That's "pty_master" only. I haven't checked with vte 0.25+ recently, and never with 0.30+.
Also, in scope.c:debug_menu_keys[] you should use the `N_()` macro to mark the second column as translatable, simply adding a comment is not enough for translation extractor to find them.
From what I've seen, it extracts anything in ""... but yes, I should
do that. There are other arrays like this one.
Le 07/12/2012 22:53, Dimitar Zhekov a écrit :
On Fri, 07 Dec 2012 21:43:27 +0100 Colomban Wendling lists.ban@herbesfolles.org wrote:
Le 07/12/2012 19:56, Dimitar Zhekov a écrit :
- Why do we need another gdb front-end?
Don't know about you. I needed something that runs under win~1, has decent Locale support and the abilities to change values and execute gdb commands at any time.
I saw the next point, but couldn't this have been done in the other debugger plugin? It looks a little bit like a duplicate :)
Yes, having 2 gdb plugins is a duplicate. No, I coundn't do it inside debugger. The communication with gdb is async, which requires very different code, and the UI is not very similar either, except for having a debug page with subpages...
OK.
[...]
conterm.c:439:37: error: ‘program_pty_master’ undeclared (first use in this function)
That's "pty_master" only. I haven't checked with vte 0.25+ recently, and never with 0.30+.
OK, works better indeed, it's now built :) FTR, I'm building with VTE 0.28.2.
Also, in scope.c:debug_menu_keys[] you should use the `N_()` macro to mark the second column as translatable, simply adding a comment is not enough for translation extractor to find them.
From what I've seen, it extracts anything in ""... but yes, I should do that. There are other arrays like this one.
It must be wrongly configured then, extracting every string doesn't make sense.
Regards, Colomban
Hi,
As you can see, I commited an initial version of scope, with some fixes. The autotools configure and make should work under *nix. BTW, do we expect the plugins to be build under win~1 with autotools?
waf configure/build may have errors - I just snatched pieces from a few other waf files. So, whoever has experience with the waf build system, please help me a bit. I need:
1. Check for vte under *nix only. 2. -lvte -lutil under *nix only. 3. Properly defined $plugindatadir and $pluginhtmldocdir. 4. -DPLUGINDATADIR="$(plugindatadir)" \ -DPLUGINHTMLDOCDIR="$(pluginhtmldocdir)" \ -Wno-shadow 5. cp docs/{codes.html,scope.html} $pluginhtmldocdir. 6. cp data/{*.png,scope.glade} $plugindatadir.
Thanks in advance.