[RFA] async changes; Was: Re: regarding transparent data ranges (in tracepoint support)

Mark Newman markn_46@yahoo.com
Thu Dec 4 22:16:00 GMT 2003


I will change as you requested and resubmit today.

ASYNC_WAIT would be added to commands like "interrupt"
and "quit" when they are issued in async mode.  It
causes gdb to wait for the target to respond before
going on.

When the select for target and the select for async
are combined this should go away.

I certify that all of these changes are original to me
at Lockheed and no one else's code was used.

                          Mark Newman

--- Elena Zannoni <ezannoni@redhat.com> wrote:
> Mark Newman writes:
>  > I looked at gdb/CONTRIBUTE.  I hope that this
> meets
>  > the requirements:
>  > 
> 
> It is usually a good idea to change the subject to
> something relevant
> to the patch. Here you are not dealing with
> tracepoints at all.
> 
> [redirected to gdb-patches only, specified subject]
> 
>  > Change Log:
>  > 
>  > 2003-11-28 Mark Newman <markn_46@yahoo.com>
>  > 
>  >    * provide a better method for filtering of
> asyn
>  > commands
>  > 
> 
> In the Changelog you need an entry for each file,
> and for each file an
> entry for each function you have touched.
> 
> see below for more comments.
> 
> 
>  > 
>  > 
>  > 
>  >
>
===================================================================
>  > RCS file: /cvs/src/src/gdb/infrun.c,v
>  > retrieving revision 1.122
>  > diff -c -p -r1.122 infrun.c
>  > *** gdb/infrun.c	25 Nov 2003 16:01:36 -0000	1.122
>  > --- gdb/infrun.c	29 Nov 2003 02:00:15 -0000
>  > ***************
>  > *** 44,49 ****
>  > --- 44,51 ----
>  >   #include "value.h"
>  >   #include "observer.h"
>  >   #include "language.h"
>  > + #include "cli/cli-decode.h"
>  > + 
>  >   
>  >   /* Prototypes for local functions */
>  >   
>  > *************** Pass and Stop may be combined.",
>  > NULL));
>  > *** 4005,4010 ****
>  > --- 4007,4014 ----
>  >         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);
>  > + 
>  >   
>  >     numsigs = (int) TARGET_SIGNAL_LAST;
>  >     signal_stop = (unsigned char *) xmalloc
> (sizeof
>  > (signal_stop[0]) * numsigs);
>  > Index: gdb/maint.c
>  >
>
===================================================================
>  > RCS file: /cvs/src/src/gdb/maint.c,v
>  > retrieving revision 1.40
>  > diff -c -p -r1.40 maint.c
>  > *** gdb/maint.c	21 Sep 2003 01:26:45 -0000	1.40
>  > --- gdb/maint.c	29 Nov 2003 02:00:15 -0000
>  > *************** Configure variables internal to
> GDB
>  > that
>  > *** 734,745 ****
>  >   		  0/*allow-unknown*/,
>  >   		  &maintenancelist);
>  >   
>  > !   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);
>  >   
>  >   #ifndef _WIN32
>  >     add_cmd ("dump-me", class_maintenance,
>  > maintenance_dump_me,
>  > --- 734,746 ----
>  >   		  0/*allow-unknown*/,
>  >   		  &maintenancelist);
>  >   
>  > ! 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);
>  >   
> 
> 
> Instead of nesting calls like that, could you
> declare a variable 'c'
> to be used to store the return value of
> add_prefix_cmd and then call
> async_cmd with that parameter?
> 
>  >   #ifndef _WIN32
>  >     add_cmd ("dump-me", class_maintenance,
>  > maintenance_dump_me,
>  > Index: gdb/top.c
>  >
>
===================================================================
>  > RCS file: /cvs/src/src/gdb/top.c,v
>  > retrieving revision 1.85
>  > diff -c -p -r1.85 top.c
>  > *** gdb/top.c	8 Nov 2003 00:13:03 -0000	1.85
>  > --- gdb/top.c	29 Nov 2003 02:00:19 -0000
>  > *************** execute_command (char *p, int
>  > from_tty)
>  > *** 668,679 ****
>  >   
>  >         /* If the target is running, we allow
> only a
>  > limited set of
>  >            commands. */
>  > !       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)
>  > ! 	  error ("Cannot execute this command while
> the
>  > target is running.");
>  >   
>  >         /* Pass null arg rather than an empty
> one.  */
>  >         arg = *p ? p : 0;
>  > --- 668,676 ----
>  >   
>  >         /* If the target is running, we allow
> only a
>  > limited set of
>  >            commands. */
>  > !       if (event_loop_p && target_can_async_p ()
> &&
>  > target_executing) 
>  > ! 	     if ((c->flags & ASYNC_OK) != 0)
>  > ! 	        error ("Cannot execute this command
> while
>  > the target is running.");
>  >   
>  >         /* Pass null arg rather than an empty
> one.  */
>  >         arg = *p ? p : 0;
>  > *************** execute_command (char *p, int
>  > from_tty)
>  > *** 747,752 ****
>  > --- 744,757 ----
>  >   	  warned = 1;
>  >   	}
>  >       }
>  > +     
>  > +     if (event_loop_p && target_can_async_p ()
> &&
>  > target_executing) {
>  > + 	if ((c->flags & ASYNC_WAIT) != 0) {
>  > + 	   wait_for_inferior();
>  > + 	  }
>  > +       }
>  > + 
> 
> I don't get this. You never set ASYNC_WAIT. What are
> you trying to do?
> 
> 
>  > + 
>  >   }
>  >   
>  >   /* Read commands from `instream' and execute
> them
>  > Index: gdb/cli/cli-cmds.c
>  >
>
===================================================================
>  > RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
> 
=== message truncated ===



More information about the Gdb-patches mailing list