Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Newman, Mark (N-Superior Technical Resource Inc)" <mark.newman@lmco.com>
To: gdb-patches@sources.redhat.com
Subject: FW: async operation
Date: Tue, 25 Nov 2003 17:26:00 -0000	[thread overview]
Message-ID: <F56FBA314E8E5A41895F0DA8F6716A6D010BFA8C@EMSS04M11.us.lmco.com> (raw)



-----Original Message-----
From: gdb-owner@sources.redhat.com
[mailto:gdb-owner@sources.redhat.com]On Behalf Of Newman, Mark
(N-Superior Technical Resource Inc)
Sent: Tuesday, November 25, 2003 11:06 AM
To: gdb@sources.redhat.com
Subject: async operation



I have made a set of changes that I think will improve the operation in remote async.  Among other things it will allow one to add commands like "interrupt" and "quit" to the repetoire of commands that are legal.  

I made some design decisions that could have gone another way - e.g. use of the flags field and not using a define for async_cmd.  If anyone has strong feelings about this please let me know.

Also I am looking for opinions in general about this.

None of this reflects what Apple has done.  I still am not certain that I can use that code.

The changes are:

For a total of less than 20 lines of change

/////////////////////////////////////////////////////////////////////
cli/cli-decode.h 
Is

#define CMD_DEPRECATED            0x1
#define DEPRECATED_WARN_USER      0x2
#define MALLOCED_REPLACEMENT      0x4

Should be:

#define CMD_DEPRECATED            0x1
#define DEPRECATED_WARN_USER      0x2
#define MALLOCED_REPLACEMENT      0x4
#define ASYNC_OK                  0x08
#define ASYNC_WAIT                0x10

///////////////////////////////////////////////////////////////////////
cli/cli-decode.c
add in the file

struct cmd_list_element *
async_cmd (struct cmd_list_element *cmd, int f)
{

    cmd->flags = f;

  return cmd;
}

///////////////////////////////////////////////////////////////////////
top.c 
Is

      if (event_loop_p && target_can_async_p () && target_executing) {
	if (!(strcmp (c->name, "help") == 0)
	    && !(strcmp (c->name, "pwd") == 0)
	    && !(strcmp (c->name, "show") == 0)
	    && !(strcmp (c->name, "stop") == 0)


Should be

      if (event_loop_p && target_can_async_p () && target_executing) {
	if ((c->flags & ASYNC_OK) != 0)

/////////////////////////////////////////////////////////////////////////////
top.c
Should be  (note add to the end of void execute_command (char *p, int from_tty))
      if (event_loop_p && target_can_async_p () && target_executing) {
	if ((c->flags & ASYNC_WAIT) != 0) {
	   wait_for_inferior();
	  }
      }

////////////////////////////////////////////////////////////////////////////
maint.c
Is
add_prefix_cmd ("show", class_maintenance, maintenance_show_cmd, "\
Show GDB internal variables used by the GDB maintainer.\n\
Configure variables internal to GDB that aid in GDB's maintenance",
		  &maintenance_show_cmdlist, "maintenance show ",
		  0/*allow-unknown*/,
		  &maintenancelist);

Should be
async_cmd (  add_prefix_cmd ("show", class_maintenance, maintenance_show_cmd, "\
Show GDB internal variables used by the GDB maintainer.\n\
Configure variables internal to GDB that aid in GDB's maintenance",
		  &maintenance_show_cmdlist, "maintenance show ",
		  0/*allow-unknown*/,
		  &maintenancelist);
, ASYNC_OK);

////////////////////////////////////////////////////////////////////////////
infrun.c
Is
    stop_command =
      add_cmd ("stop", class_obscure, not_just_help_class_command, "There is no `stop' command, but you can set a hook on `stop'.\n\
This allows you to set a list of commands to be run each time execution\n\
of the program stops.", &cmdlist);

Should be
#include "cli/cli-decode.h"

    stop_command =
      add_cmd ("stop", class_obscure, not_just_help_class_command, "There is no `stop' command, but you can set a hook on `stop'.\n\
This allows you to set a list of commands to be run each time execution\n\
of the program stops.", &cmdlist)
    async_cmd(stop_command , ASYNC_OK);

//////////////////////////////////////////////////////////////////////////////
cli/cli-cmds.c

Is
  c = add_com ("help", class_support, help_command, "Print list of commands.");

Should be

  c = add_com ("help", class_support, help_command, "Print list of commands.");
  async_cmd(c, ASYNC_OK);

//////////////////////////////////////////////////////////////////////////////
cli/cli-cmds.c

Is
  add_com ("pwd", class_files, pwd_command,
	"Print working directory.  This is used for your program as well.");

Should be

  async_cmd(add_com ("pwd", class_files, pwd_command,
	"Print working directory.  This is used for your program as well.")
, ASYNC_OK);


             reply	other threads:[~2003-11-25 17:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-25 17:26 Newman, Mark (N-Superior Technical Resource Inc) [this message]
2003-11-25 17:52 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F56FBA314E8E5A41895F0DA8F6716A6D010BFA8C@EMSS04M11.us.lmco.com \
    --to=mark.newman@lmco.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox