This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA 2/3] Improve output of "maintenance info sol-threads" command.
- From: Joel Brobecker <brobecker at adacore dot com>
- To: gdb-patches at sourceware dot org
- Cc: Pedro Alves <palves at redhat dot com>, Joel Brobecker <brobecker at adacore dot com>
- Date: Tue, 7 May 2013 08:25:31 -0400
- Subject: [RFA 2/3] Improve output of "maintenance info sol-threads" command.
- References: <518284AF dot 5090802 at redhat dot com>
This patch does the following:
- Puts the startfunc and "Sleep func" info on the same line;
- Renames "Sleep func" into "sleepfunc" to be consistent with
"startfunc"
- Avoids the use of a '-' as a separate before the "sleepfunc"
output, because the '-' looks odd and out of place when the
"startfunc" field is not printed (ti.ti_startfunc is nul).
- Use a '=' instead of ':' and avoids the space between
the name of the value and its value, mostly to help group
the value with its name.
gdb/ChangeLog:
* sol-thread.c (info_cb): Rework the output of the "maintenance
info sol-threads" command a bit.
I could probably commit this one without approval, but someone else's
thoughts would be welcome, since this is a bit cosmetic.
---
gdb/sol-thread.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 2e76700..fb89723 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -1177,10 +1177,10 @@ info_cb (const td_thrhandle_t *th, void *s)
= lookup_minimal_symbol_by_pc (ti.ti_startfunc);
if (msym.minsym)
- printf_filtered (" startfunc: %s\n",
+ printf_filtered (" startfunc=%s",
SYMBOL_PRINT_NAME (msym.minsym));
else
- printf_filtered (" startfunc: %s\n",
+ printf_filtered (" startfunc=%s",
paddress (target_gdbarch (), ti.ti_startfunc));
}
@@ -1191,16 +1191,14 @@ info_cb (const td_thrhandle_t *th, void *s)
= lookup_minimal_symbol_by_pc (ti.ti_pc);
if (msym.minsym)
- printf_filtered (" - Sleep func: %s\n",
+ printf_filtered (" sleepfunc=%s",
SYMBOL_PRINT_NAME (msym.minsym));
else
- printf_filtered (" - Sleep func: %s\n",
+ printf_filtered (" sleepfunc=%s",
paddress (target_gdbarch (), ti.ti_pc));
}
- /* Wrap up line, if necessary. */
- if (ti.ti_state != TD_THR_SLEEP && ti.ti_startfunc == 0)
- printf_filtered ("\n"); /* don't you hate counting newlines? */
+ printf_filtered ("\n");
}
else
warning (_("info sol-thread: failed to get info for thread."));
--
1.7.0.4