This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [OBV PATCH 1/4] Add a newline in output messages
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 5 Mar 2014 06:22:36 -0800
- Subject: Re: [OBV PATCH 1/4] Add a newline in output messages
- Authentication-results: sourceware.org; auth=none
- References: <1394023608-10761-1-git-send-email-yao at codesourcery dot com> <1394023608-10761-2-git-send-email-yao at codesourcery dot com>
> 2014-03-05 Yao Qi <yao@codesourcery.com>
>
> * cli/cli-utils.c (get_number_trailer): Add '\n' at the end of
> message.
Obvious indeed.
The error handling is a little different from the usual, where error
would typically be used; especially since zero can be a valid number.
And this leads to this sort of odd behavior:
(gdb) set $v := 1.1
(gdb) b a
Breakpoint 1 at 0x401558: file a.adb, line 3.
(gdb) cond $v 1 = 1
Convenience variable must have integer value.
Bad breakpoint argument: '$v 1 = 1'
Probably for a rainy day...
> ---
> gdb/cli/cli-utils.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/gdb/cli/cli-utils.c b/gdb/cli/cli-utils.c
> index e18e357..a0ebc11 100644
> --- a/gdb/cli/cli-utils.c
> +++ b/gdb/cli/cli-utils.c
> @@ -50,7 +50,7 @@ get_number_trailer (char **pp, int trailer)
> retval = value_as_long (val);
> else
> {
> - printf_filtered (_("History value must have integer type."));
> + printf_filtered (_("History value must have integer type.\n"));
> retval = 0;
> }
> }
> --
> 1.7.7.6
--
Joel