This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] new python features: gdb.GdbError, gdb.string_to_argv
- From: Eli Zaretskii <eliz at gnu dot org>
- To: dje at google dot com (Doug Evans)
- Cc: gdb-patches at sourceware dot org
- Date: Sun, 23 May 2010 20:32:06 +0300
- Subject: Re: [RFA] new python features: gdb.GdbError, gdb.string_to_argv
- References: <20100522165438.5D5A48439A@ruffy.mtv.corp.google.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Sat, 22 May 2010 09:54:38 -0700 (PDT)
> From: dje@google.com (Doug Evans)
>
> While writing some gdb commands in python I needed to be able to
> flag users errors without causing a traceback to be printed,
> and I wanted a utility to translate the argument string into an argv.
Thanks.
> +When implementing @value{GDBN} commands in Python via @code{gdb.Command},
> +it is useful to be able to throw an exception that doesn't cause a
> +traceback to be printed. For example, the user may have invoked the
> +command incorrectly. Use the @code{gdb.GdbError} exception
> +to handle this case. Example:
I suggest a @findex entry about gdb.GdbError here.
> +To break @var{argument} up into an argv-like string use
> +@code{gdb.string_to_argv}.
> +Arguments are separated by spaces and may be quoted.
and a @findex entry here about gdb.string_to_argv.
> --- NEWS 30 Apr 2010 07:04:52 -0000 1.379
> +++ NEWS 22 May 2010 16:51:50 -0000
> @@ -87,7 +87,9 @@ is now deprecated.
> set/show in the CLI.
>
> ** New functions gdb.target_charset, gdb.target_wide_charset,
> - gdb.progspaces, and gdb.current_progspace.
> + gdb.progspaces, gdb.current_progspace, and gdb.string_to_argv.
> +
> +** New exception gdb.GdbError.
This part is okay.
Thanks.