diff options
author | Joel Brobecker <brobecker@gnat.com> | 2013-05-08 06:25:20 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2013-05-08 06:25:20 +0000 |
commit | 17e668f7b1ca5ce96a51886433cb751a0e6a2a2e (patch) | |
tree | 9c2f89f12f4dced8178f8bde6401947c90540bfd | |
parent | cd402a50a7be87d91aa0b0b6e4aa09da6527bbd2 (diff) | |
download | gdb-17e668f7b1ca5ce96a51886433cb751a0e6a2a2e.tar.gz |
Avoid duplicating text in sol-thread.c:info_cb
This is a minor cleanup that helps avoiding duplicating the output
of a command when handling alternative situations.
gdb/ChangeLog:
* sol-thread.c (info_cb): Factorize the code a little.
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/sol-thread.c | 20 |
2 files changed, 12 insertions, 12 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1b5da8d28e6..62cc127e92f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2013-05-08 Joel Brobecker <brobecker@adacore.com> + * sol-thread.c (info_cb): Factorize the code a little. + +2013-05-08 Joel Brobecker <brobecker@adacore.com> + * sol-thread.c (info_cb): Rework the output of the "maintenance info sol-threads" command a bit. diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index c16ad987056..cccb935a4c8 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -1118,12 +1118,10 @@ info_cb (const td_thrhandle_t *th, void *s) const struct bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (ti.ti_startfunc); - if (msym.minsym) - printf_filtered (" startfunc=%s", - SYMBOL_PRINT_NAME (msym.minsym)); - else - printf_filtered (" startfunc=%s", - paddress (target_gdbarch (), ti.ti_startfunc)); + printf_filtered (" startfunc=%s", + msym.minsym + ? SYMBOL_PRINT_NAME (msym.minsym) + : paddress (target_gdbarch (), ti.ti_startfunc)); } /* If thread is asleep, print function that went to sleep. */ @@ -1132,12 +1130,10 @@ info_cb (const td_thrhandle_t *th, void *s) const struct bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (ti.ti_pc); - if (msym.minsym) - printf_filtered (" sleepfunc=%s", - SYMBOL_PRINT_NAME (msym.minsym)); - else - printf_filtered (" sleepfunc=%s", - paddress (target_gdbarch (), ti.ti_pc)); + printf_filtered (" sleepfunc=%s", + msym.minsym + ? SYMBOL_PRINT_NAME (msym.minsym) + : paddress (target_gdbarch (), ti.ti_pc)); } printf_filtered ("\n"); |