From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5174 invoked by alias); 14 Nov 2008 11:32:20 -0000 Received: (qmail 4993 invoked by uid 22791); 14 Nov 2008 11:32:07 -0000 X-Spam-Check-By: sourceware.org Received: from mtaout7.012.net.il (HELO mtaout7.012.net.il) (84.95.2.19) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 14 Nov 2008 11:31:26 +0000 Received: from conversion-daemon.i-mtaout7.012.net.il by i-mtaout7.012.net.il (HyperSendmail v2007.08) id <0KAB00300MQ4ZF00@i-mtaout7.012.net.il> for gdb-patches@sourceware.org; Fri, 14 Nov 2008 13:32:55 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.126.205.49]) by i-mtaout7.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KAB008TUMQUYM70@i-mtaout7.012.net.il>; Fri, 14 Nov 2008 13:32:55 +0200 (IST) Date: Fri, 14 Nov 2008 15:42:00 -0000 From: Eli Zaretskii Subject: Re: [RFA] Darwin/x86 port (v2 - part 2: darwin-nat.?) In-reply-to: <20081112101132.GA18389@ulanbator.act-europe.fr> X-012-Sender: halo1@inter.net.il To: Tristan Gingold Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: References: <20081112101132.GA18389@ulanbator.act-europe.fr> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-11/txt/msg00328.txt.bz2 > Date: Wed, 12 Nov 2008 11:11:32 +0100 > From: Tristan Gingold > > 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.