Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tristan Gingold <gingold@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Darwin/x86 port (v2 - part 2: darwin-nat.?)
Date: Fri, 14 Nov 2008 15:42:00 -0000	[thread overview]
Message-ID: <uvduqo87d.fsf@gnu.org> (raw)
In-Reply-To: <20081112101132.GA18389@ulanbator.act-europe.fr>

> Date: Wed, 12 Nov 2008 11:11:32 +0100
> From: Tristan Gingold <gingold@adacore.com>
> 
> darwin-nat.c:

Thanks.

> void
> mach_check_error (kern_return_t ret, const char *file,
>                   unsigned int line, const char *func)
> {
>   if (ret == KERN_SUCCESS)
>     return;
>   if (func == NULL)
>     func = "[UNKNOWN]";
>   
>   error ("error on line %u of \"%s\" in function \"%s\": %s (0x%lx)\n",
>          line, file, func, mach_error_string (ret), (unsigned long) ret);

Again, please enclose all user messages in _(), for future
translations.

>   if (0)
>     printf_unfiltered ("darwin_check_new_threads: old=%d new=%d\n",
> 		       old_nbr, new_nbr);

Should we delete this dead code?

>       if (0)
> 	printf_unfiltered ("  old=%x new=%x\n", old_id, new_id);

And this.

> #if 0
>       kret = mach_port_deallocate (gdb_task, exc_msg.thread_port);
>       MACH_CHECK_ERROR (kret);
> #endif

And this.

> 	res = PTRACE (PT_CONTINUE, pid, (caddr_t)1, 0);
>       if (res < 0)
> 	printf_unfiltered ("ptrace CONT: res=%d\n", res);

This looks like a debugging print-out, so perhaps it should be printed
only if some debug option is set.

>   if (kret != MACH_MSG_SUCCESS)
>     {
>       printf_unfiltered ("mach_msg: ret=%x\n", kret);

And this one as well.

>   /* Debug: display message.  */
>   if (0)
>     {
>       const unsigned long *buf = (unsigned long *) hdr;
>       unsigned int i;

More dead code to be removed?

>       printf ("Bad local-port: %x\n", hdr->msgh_local_port);

Another debug printout?

>   /* Wait until gdb is ready.  */
>   res = read (ptrace_fds[0], &c, 1);
>   if (res != 0)
>     fprintf (stderr, "unexpected read result: %d\n", res);

And another?

>     printf_unfiltered ("Unable to detach to process-id %d: %s (%d)",
                                 ^^^^^^^^^^^^
"to detach from"

>   add_setshow_zinteger_cmd ("inferior", class_obscure,
> 			    &inferior_debug_flag, _("\
> Set if printing inferior communication debugging statements."), _("\
> Show if printing inferior communication debugging statements."), NULL,
> 			    NULL, NULL,
> 			    &setdebuglist, &showdebuglist);
> 
>   add_setshow_boolean_cmd ("mach-exceptions", class_support,
> 			   &enable_mach_exceptions, _("\
> Set if mach exceptions are caught."), _("\
> Show if mach exceptions are caught."), _("\
> When this mode is on, all low level exceptions are reported before being\n\
> reported by the kernel."),
> 			   &set_enable_mach_exceptions, NULL,
> 			   &setlist, &showlist);

These options should be described in the GDB user manual.  Please
submit a suitable documentation patch.


      parent reply	other threads:[~2008-11-14 11:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-12 12:43 Tristan Gingold
2008-11-12 17:37 ` Tristan Gingold
2008-11-13 15:05 ` Tristan Gingold
2008-11-13 18:04 ` Tristan Gingold
2008-11-14 15:42 ` Eli Zaretskii [this message]

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=uvduqo87d.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=gingold@adacore.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