Summary ======= This document descripts MI extension to support debugging several executables. Design ====== The local thread groups of type 'process' are redefined to mean inferior. In particular: - They may exist when the process does not exist. - They might not have any contained threads. - The following notifications are added: - 'thread-group-added' - 'thread-group-removed' Those are emitted when an inferior is added or removed to the inferior list, as output by 'info inferior'. - The following notifcation is also added: - 'thread-group-started' This is emitted when a thread group is connected to something really running. - The existing notification: - 'thread-group-created' is removed. If we retain the current meaning of 'process was created' it will be extra confusing, given that no new thread group is actually created, but rather an existing thread group gets a live process. It is believed that those notifications were only used for DICOS multiprocess implementation, and IDE for DICOS can be easily modified to handle both old and new notifications. - a new field, 'executable' is added to report the executable that is being debugged. Note: executable, not symbol files. There can be several symbol files, and queried via separate command. [Note: this means that if '-list-thread-groups --available' reports a thread group 345 and we attach to it, we don't get a thread group with id of 345. Rather, whatever thread group we attached is associated to that pid] Two additional commands will be required -- '-add-inferior' and '-remove-inferior'. The CLI 'clone-inferior' is more like a convenience for a human being, and will not get a MI counterpart. Changes to existing commands ============================ Global changes. New option --thread-group will be introduced. Current, this option is available for a couple of commands only. Breakpoint commands break-after break-condition break-commands break-delete break-disable break-enable break-info break-insert break-list break-watch The changes outlined above don't require any command changes. Data commands. data-disassemble data-evaluate-expression data-list-changed-registers data-list-register-names data-list-register-values data-read-memory data-write-memory data-write-register-values These operate on the current thread. No change at all. Program context commands. environment-cd environment-directory environment-path environment-pwd Will be made per-inferior. Not planned originally, but already requested by Pedro. inferior-tty-set inferior-tty-show exec-arguments Made to be per-inferior. Execution commands exec-finish exec-jump exec-next exec-next-instruction exec-return exec-step exec-step-instruction exec-until These all operate on specific thread. No change needed. exec-continue. Need to make --all option resume all inferiors, and special-case explicit --thread-group to resume all threads in the specified inferior. exec-interrupt. Need to make --all and --thread-group option behave similarly to exec-continue. exec-run. This is directly routed to CLI, so MI wrapper should be introduced. Support for --all should be added. File commands file-exec-and-symbols file-exec-file file-symbol-file file-list-exec-source-file file-list-exec-source-files symbol-list-lines. These operate on inferior, and are typically used when there are no threads. Generic --thread-group option will handle them fine. Stack commands stack-info-depth stack-info-frame stack-list-arguments stack-list-frames stack-list-locals stack-list-variables stack-select-frame These always operate on specific thread. No change needed. Target commands target-attach target-detach Should be per-inferior. target-disconnect This, in theory, should be just like target-detach. In practice, it pops the target and therefore need not care about inferiors. target-download target-file-delete target-file-get target-file-put target-select At present, all inferiors should use the same target, so these commands are 'global'. Thread commands thread-info thread-list-ids thread-select Except for the fact that thread group may now be empty, no change. Variable objects var-assign var-create var-delete var-evaluate-expression var-info-path-expression var-info-expression var-info-num-children var-info-type var-list-children var-set-format var-set-frozen var-set-update-range var-set-visualizer var-show-attributes var-show-format var-update These operate on specific thread. No change needed. Misc. enable-timings enable-pretty-printing gdb-exit gdb-set gdb-show gdb-version interpreter-exec list-features list-thread-groups Nothing to change. list-target-features Will have to handle --thread-group when/if inferiors have different targets with different feature. I imagine that mixing sync and async targets will be just impossible.