From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3508 invoked by alias); 25 Nov 2003 17:26:56 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 3500 invoked from network); 25 Nov 2003 17:26:55 -0000 Received: from unknown (HELO mailgw3a.lmco.com) (192.35.35.7) by sources.redhat.com with SMTP; 25 Nov 2003 17:26:55 -0000 Received: from emss04g01.ems.lmco.com ([166.17.13.122]) by mailgw3a.lmco.com (8.11.6p2/8.11.6) with ESMTP id hAPHQqD03419 for ; Tue, 25 Nov 2003 12:26:52 -0500 (EST) Received: from CONVERSION-DAEMON.lmco.com by lmco.com (PMDF V6.1-1X6 #30760) id <0HOX007014GSJ3@lmco.com> for gdb-patches@sources.redhat.com; Tue, 25 Nov 2003 12:26:52 -0500 (EST) Received: from EMSS04I00.us.lmco.com ([166.17.13.135]) by lmco.com (PMDF V6.1-1X6 #30760) with ESMTP id <0HOX001R64GS1Y@lmco.com> for gdb-patches@sources.redhat.com; Tue, 25 Nov 2003 12:26:52 -0500 (EST) Received: from EMSS04M11.us.lmco.com ([144.219.10.27]) by EMSS04I00.us.lmco.com with Microsoft SMTPSVC(5.0.2195.2966); Tue, 25 Nov 2003 12:26:52 -0500 Date: Tue, 25 Nov 2003 17:26:00 -0000 From: "Newman, Mark (N-Superior Technical Resource Inc)" Subject: FW: async operation To: gdb-patches@sources.redhat.com Message-id: MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft Exchange V6.0.6487.1 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT Content-Class: urn:content-classes:message X-MS-Has-Attach: X-MS-TNEF-Correlator: X-OriginalArrivalTime: 25 Nov 2003 17:26:52.0038 (UTC) FILETIME=[508DA260:01C3B379] X-SW-Source: 2003-11/txt/msg00565.txt.bz2 -----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);