summaryrefslogtreecommitdiff
path: root/gdb/sol-thread.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2013-05-08 06:25:21 +0000
committerJoel Brobecker <brobecker@gnat.com>2013-05-08 06:25:21 +0000
commit17e760ae36d72e21c04aa52f2e5655502a35d705 (patch)
treef85a52ffe9b300ed489c16113af505889e2a19a0 /gdb/sol-thread.c
parentc0f5f490449dcb8de9f22facc0c4dd8d6a442dca (diff)
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.
Diffstat (limited to 'gdb/sol-thread.c')
-rw-r--r--gdb/sol-thread.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index c16ad98705..cccb935a4c 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");