First of all, I'd like to thank you guys for making CGDB: Finally
I have a good debugger with a source view and syntax highlighting
without a bloated and buggy GUI interface! :-)
Moving onward, I have one small bug report and a suggested
enhancement (patch included).
First the bug: When doing 'make install DESTDIR=/foo', the
installer also creates the directory /foo.. and copies
gdbmi_driver into /foo../progs/. Looking at the makefiles in
lib/gdbmi/src/, I see that the problem comes from
noinst_bindir = $(top_builddir)/progs
$(top_builddir) is '..', and appended to $(DESTDIR), this
gives the described result. I haven't included a fix since
I don't know if gdbmi_driver should be installed in the bin
directory along with cgdb.
As for my enhancement, I was wondering if you'd consider making
it an option to highlight the entire current line when scrolling
around in the source window. The current behavior is to make the
current line number bold, but I find it much easier to identify the
current line when the highlighting extends all the way across the
screen.
I've included a patch below that implements this feature. Currently,
it just replaces the old behavior, since that's all I need for my own
personal use. If you'd like to push this upstream, but not in its
current state, let me know -- I'll gladly make the required changes.
--- cgdb-0.6.3/cgdb/src/highlight_groups.c.orig 2006-06-03 20:09:06.000000000 +0200
+++ cgdb-0.6.3/cgdb/src/highlight_groups.c 2006-10-03 09:28:58.000000000 +0200
@@ -93,6 +93,7 @@
{HLG_ENABLED_BREAKPOINT, A_BOLD, A_BOLD, COLOR_RED, COLOR_BLACK},
{HLG_DISABLED_BREAKPOINT, A_BOLD, A_BOLD, COLOR_YELLOW, COLOR_BLACK},
{HLG_LOGO, A_BOLD, A_BOLD, COLOR_BLUE, COLOR_BLACK},
+ {HLG_CURRENT_LINE, A_NORMAL, A_NORMAL, COLOR_BLACK, COLOR_WHITE},
{HLG_LAST, A_NORMAL, A_NORMAL, -1, -1}
};
@@ -115,6 +116,7 @@
{HLG_ENABLED_BREAKPOINT, A_BOLD, A_BOLD, COLOR_RED, -1},
{HLG_DISABLED_BREAKPOINT, A_BOLD, A_BOLD, COLOR_YELLOW, -1},
{HLG_LOGO, A_BOLD, A_BOLD, COLOR_BLUE, -1},
+ {HLG_CURRENT_LINE, A_REVERSE, A_REVERSE, -1, -1},
{HLG_LAST, A_NORMAL, A_NORMAL, -1, -1}
};
@@ -140,6 +142,7 @@
{HLG_ENABLED_BREAKPOINT, "Breakpoint"},
{HLG_DISABLED_BREAKPOINT, "DisabledBreakpoint"},
{HLG_LOGO, "Logo"},
+ {HLG_CURRENT_LINE, "CurrentLine"},
{HLG_LAST, "NULL"}
};
--- cgdb-0.6.3/cgdb/src/sources.c.orig 2006-06-03 20:09:06.000000000 +0200
+++ cgdb-0.6.3/cgdb/src/sources.c 2006-10-03 09:24:47.000000000 +0200
@@ -675,22 +675,22 @@
/* Ordinary lines */
else{
if ( focus && sview->cur->sel_line == line )
- wattron(sview->win, A_BOLD);
-
+ {
+ if (hl_groups_get_attr (hl_groups_instance, HLG_CURRENT_LINE, &attr) == -1)
+ return -1;
+ wattron(sview->win, attr);
+ }
wprintw(sview->win, fmt, line+1);
-
- if ( focus && sview->cur->sel_line == line )
- wattroff(sview->win, A_BOLD);
- if (focus)
+ if (focus && sview->cur->sel_line != line)
wattron(sview->win, A_BOLD);
waddch(sview->win, VERT_LINE);
- if (focus)
+ if (focus && sview->cur->sel_line != line)
wattroff(sview->win, A_BOLD);
waddch(sview->win, ' ');
/* I know this is rediculous, it needs to be reimplemented */
- if ( sources_syntax_on ) {
+ if (!(focus && sview->cur->sel_line == line) && sources_syntax_on) {
/* No special line information */
if (line == sview->cur->sel_line &&
sview->cur->buf.cur_line != NULL) {
@@ -714,6 +714,9 @@
width-lwidth-2, sview->cur->sel_col);
}
}
+
+ if (focus && sview->cur->sel_line == line)
+ wattroff(sview->win, attr);
}
} else {
wprintw(sview->win, "%s\n", sview->cur->buf.tlines[line]);
--- cgdb-0.6.3/cgdb/include/highlight_groups.h.orig 2006-06-03 20:09:05.000000000 +0200
+++ cgdb-0.6.3/cgdb/include/highlight_groups.h 2006-10-03 09:17:10.000000000 +0200
@@ -41,6 +41,7 @@
HLG_ENABLED_BREAKPOINT,
HLG_DISABLED_BREAKPOINT,
HLG_LOGO,
+ HLG_CURRENT_LINE,
HLG_LAST
};
--
Haakon
|