This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: FYI: copy/paste error in sol-thread.c ?
- From: Pedro Alves <palves at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 02 May 2013 16:22:23 +0100
- Subject: Re: FYI: copy/paste error in sol-thread.c ?
- References: <20130430110928 dot GF3525 at adacore dot com>
On 04/30/2013 12:09 PM, Joel Brobecker wrote:
> ... while working on fixing the few compilation errors in that file,
> I noticed:
>
> /* If thread is asleep, print function that went to sleep. */
> if (ti.ti_state == TD_THR_SLEEP)
> {
> const struct bound_minimal_symbol msym
> = lookup_minimal_symbol_by_pc (ti.ti_pc);
>
> if (msym.minsym)
> printf_filtered (" - Sleep func: %s\n",
> SYMBOL_PRINT_NAME (msym.minsym));
> else
> printf_filtered (" - Sleep func: %s\n",
> paddress (target_gdbarch (), ti.ti_startfunc));
> ^^^^^^^^^^^^^^^
> |||||||||||||||
> }
>
> I find the use of ti.ti_startfunc looks suspiciously like a copy/paste
> of the code right above:
I agree it looks like a copy/paste.
Very very very minor, but the prints look a little odd to me:
> printf_filtered (" startfunc: %s\n",
> printf_filtered (" - Sleep func: %s\n"
The first is lowercase, and doesn't start with '-', while the
other line is uppercase, and has a '-'... Looks odd.
It reads to me as if the original intention was to put this all
in the same line, but then the startfunc print includes \n,
breaking it...
--
Pedro Alves