public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Use std::hashmap and MI commands classes in mi-cmds.c
@ 2017-02-03  5:46 didier.nadeau
  2017-02-03  5:46 ` [PATCH 2/2] Use classes to represent MI Command instead of structures didier.nadeau
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: didier.nadeau @ 2017-02-03  5:46 UTC (permalink / raw)
  To: gdb-patches; +Cc: didier.nadeau

From: Didier Nadeau <didier.nadeau@gmail.com>

This is a serie of two patches in preparation to a next patch that will allows
users to define custom MI commands using Python, similarly to what is currently
possible for Python CLI commands. 

The first patch modify mi-cmds.c to use an std::hashmap to store MI commands 
instead of the custom structure. It allows to insert new MI commands at runtime
as it does not use a fixed size array anymore.

The second patch removes structures mi_cli and mi_cmd from mi-cmds.c and replace
them with a hierarchy of classes. This way, each subtype of MI command inherits
from the base virtual class and register itself into the hashmap. Classes 
mi_command_mi for pure MI commands and mi_command_cli for MI commands over CLI
commands have been implemented. MI commands are now all called from a common
invoke virtual function. Logic for suppress_notification and ARGV/ARGC parsing 
has been moved to the classes implementation.

Didier Nadeau (2):
  Use std::map for MI commands in mi-cmds.c
  Use classes to represent MI Command instead of structures

 gdb/mi/mi-cmd-info.c |   4 +-
 gdb/mi/mi-cmds.c     | 490 ++++++++++++++++++++++++++-------------------------
 gdb/mi/mi-cmds.h     |  70 +++++---
 gdb/mi/mi-main.c     |  21 +--
 gdb/mi/mi-main.h     |   2 +
 gdb/mi/mi-parse.c    |  20 +--
 gdb/mi/mi-parse.h    |   6 +-
 7 files changed, 316 insertions(+), 297 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-03-17 15:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-03  5:46 [PATCH 0/2] Use std::hashmap and MI commands classes in mi-cmds.c didier.nadeau
2017-02-03  5:46 ` [PATCH 2/2] Use classes to represent MI Command instead of structures didier.nadeau
2017-02-03  5:46 ` [PATCH 1/2] Use std::map for MI commands in mi-cmds.c didier.nadeau
2017-02-06 15:58 ` [PATCH 0/2] Use std::hashmap and MI commands classes " Pedro Alves
     [not found]   ` <CAK0EQJEOg0PA2xghH+89JvQr7ikf=nUBYJ9LvUvRY1RTkWGB_A@mail.gmail.com>
2017-02-06 18:23     ` Pedro Alves
2017-02-10 18:19       ` Didier Nadeau
2017-02-10 20:41         ` [PATCH] Create MI commands using python Didier Nadeau
2017-03-17 15:38           ` Pedro Alves
2017-02-11  5:01         ` [PATCH 0/2] Use std::hashmap and MI commands classes in mi-cmds.c Didier Nadeau
2017-03-08 17:36           ` Didier Nadeau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).