Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* FW: async operation
@ 2003-11-25 17:26 Newman, Mark (N-Superior Technical Resource Inc)
  2003-11-25 17:52 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Newman, Mark (N-Superior Technical Resource Inc) @ 2003-11-25 17:26 UTC (permalink / raw)
  To: gdb-patches



-----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);


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

* Re: FW: async operation
  2003-11-25 17:26 FW: async operation Newman, Mark (N-Superior Technical Resource Inc)
@ 2003-11-25 17:52 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2003-11-25 17:52 UTC (permalink / raw)
  To: Newman, Mark (N-Superior Technical Resource Inc); +Cc: gdb-patches

On Tue, Nov 25, 2003 at 12:26:51PM -0500, Newman, Mark (N-Superior Technical Resource Inc) wrote:
> The changes are:

I really, really, really recommend that you learn how to use diff or cvs
diff.  It's extremely hard to read these sorts of change descriptions.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

end of thread, other threads:[~2003-11-25 17:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-25 17:26 FW: async operation Newman, Mark (N-Superior Technical Resource Inc)
2003-11-25 17:52 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox