This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] new python features: gdb.GdbError, gdb.string_to_argv


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]