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 0/4] More flexible user-defined commands prefixing and naming.


Ping ?
Thanks
Philippe
(patch attached rebased on current master)

On Sun, 2019-09-29 at 22:54 +0200, Philippe Waroquiers wrote:
> This patch series improves the way a user can define user commands
> using CLI sequences of commands.
> 
> Currently, a user can define a command after an existing command prefix
> e.g.  define target mycommand
> but cannot define a prefix to define command such as:
>       define mytargetprefix mycommand.
> 
> This patch series adds the command 'prefix-define' to allow
> user commands to be prefix commands.
> 
> Also, this patch series adds . as an allowed character for user
> defined commands.
> This can e.g. be used to define a set of Valgrind specific user command
> corresponding to the Valgrind monitor commands.
> This then allows to use GDB completion and expression evaluation
> for sending monitor commands e.g. to Valgrind;
> 
> For example, for the Valgrind monitor 'check_memory' command:
>   check_memory [addressable|defined] <addr> [<len>]
>         check that <len> (or 1) bytes at <addr> have the given accessibility
>             and outputs a description of <addr>
> we can now define some new GDB commands such as:
> (gdb) prefix-define Vmonitor
> (gdb) prefix-define Vmonitor check_memory
> (gdb) define Vmonitor check_memory addressable
> eval "monitor check_memory addressable %#lx %d", $arg0, $arg1
> end
> (gdb) define Vmonitor check_memory defined
> eval "monitor check_memory defined %#lx %d", $arg0, $arg1
> end
> (gdb)
> 
> Compared to the 'raw' monitor command, the new GDB commands provide completion
> and evaluation of expressions.
> 

Attachment: patch_ping.txt
Description: Text document


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