This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdbserver, check for success on start_inferior


On Thu, Jul 19, 2007 at 05:03:16PM -0700, Michael Snyder wrote:
>   
>     signal_pid = create_inferior (argv[0], argv);
>   
> +   /* FIXME: we don't actually know at this point that the create
> +      actually succeeded.  We won't know that until we wait.  I'm not
> +      sure how wait and all this SIGTTOU stuff play together.  */
>     fprintf (stderr, "Process %s created; pid = %ld\n", argv[0],
>   	   signal_pid);
>     fflush (stderr);

Please don't add comments saying you don't understand things :-) They
don't add value.  If you have questions about the job control stuff,
ask me about it sometime.

If you want to fix up the message for failure cases, we could delay it
until after waiting.

> *************** main (int argc, char *argv[])
> *** 899,905 ****
>         /* Wait till we are at first instruction in program.  */
>         signal = start_inferior (&argv[2], &status);
>   
> !       /* We are now stopped at the first instruction of the target process */
>   
>         /* Don't report shared library events on the initial connection,
>   	 even if some libraries are preloaded.  */
> --- 903,911 ----
>         /* Wait till we are at first instruction in program.  */
>         signal = start_inferior (&argv[2], &status);
>   
> !       /* We are now (hopefully) stopped at the first instruction of
> ! 	 the target process.  This assumes that the target process was
> ! 	 successfully created.  */
>   
>         /* Don't report shared library events on the initial connection,
>   	 even if some libraries are preloaded.  */
> *************** main (int argc, char *argv[])
> *** 925,930 ****
> --- 931,942 ----
>         exit (1);
>       }
>   
> +   if (status == 'W' || status == 'X')
> +     {
> +       fprintf (stderr, "No inferior, GDBserver exiting.\n");
> +       exit (1);
> +     }
> + 
>     while (1)
>       {
>         remote_open (argv[1]);

These parts are OK though.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]