fixed display bug for multi-thread info.
[11:14:11 kunkka @ PostgreSQL ~/Working/cgdb_0.7.1_plus]$ git diff cgdb/interface.cpp
diff --git a/cgdb/interface.cpp b/cgdb/interface.cpp
index 0fcc741..3a7c1d1 100644
--- a/cgdb/interface.cpp
+++ b/cgdb/interface.cpp
@@ -2848,7 +2848,7 @@ void tabpanel_update_threads(unsigned count, int cur, struct tgdb_thread *thread
enum hl_group_kind hli = hl_index_number;
enum hl_group_kind hlf = hl_function;
- if (i + 1 == cur) {
+ if (threads[i].idx == cur) {
hli = hl_index_number_actived;
hlf = hl_function_actived;
tab_add_text(tp, TTHREADS, "*", hli);
@@ -2880,7 +2880,7 @@ void tabpanel_update_threads(unsigned count, int cur, struct tgdb_thread *thread
while(strchr(pstr, '/'))
pstr = strchr(pstr, '/') + 1;
}
- sprintf(line, "%s:%d", (pstr ? pstr : ""), threads[i].line);
+ sprintf(line, "%s:%d\n", (pstr ? pstr : ""), threads[i].line);
tab_add_text(tp, TTHREADS, line, hl_file_line);
}
@@ -2936,4 +2936,4 @@ void if_set_breakpoint_disable_hl(enum hl_group_kind hl)
void if_set_file_line_hl(enum hl_group_kind hl)
{
hl_file_line = hl;
-}
\ No newline at end of file
+}
[11:14:32 kunkka @ PostgreSQL ~/Working/cgdb_0.7.1_plus]$
[11:16:28 kunkka @ PostgreSQL ~/Working/cgdb_0.7.1_plus]$
[11:16:28 kunkka @ PostgreSQL ~/Working/cgdb_0.7.1_plus]$ git diff lib/tgdb/gdbwire.c
diff --git a/lib/tgdb/gdbwire.c b/lib/tgdb/gdbwire.c
index d9794fe..30f97c4 100644
--- a/lib/tgdb/gdbwire.c
+++ b/lib/tgdb/gdbwire.c
@@ -3501,7 +3501,7 @@ info_thread(struct gdbwire_mi_result_record *result_record,
threads = (struct gdbwire_mi_thread *)calloc(t_count, sizeof(struct gdbwire_mi_thread));
memset(threads, 0, t_count * sizeof(struct gdbwire_mi_thread));
- for (int i = 0; i < t_count && mi_thread; i++)
+ for (int i = 0; i < t_count && mi_thread; i++, mi_thread = mi_thread->next)
{
GDBWIRE_ASSERT(mi_thread->kind == GDBWIRE_MI_TUPLE);
GDBWIRE_ASSERT(!mi_thread->variable);
[11:16:49 kunkka @ PostgreSQL ~/Working/cgdb_0.7.1_plus]$