From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20033 invoked by alias); 24 Dec 2005 08:07:38 -0000 Received: (qmail 20025 invoked by uid 22791); 24 Dec 2005 08:07:37 -0000 X-Spam-Check-By: sourceware.org Received: from gandalf.inter.net.il (HELO gandalf.inter.net.il) (192.114.186.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 24 Dec 2005 08:07:36 +0000 Received: from nitzan.inter.net.il (nitzan.inter.net.il [192.114.186.20]) by gandalf.inter.net.il (MOS 3.7.1-GA) with ESMTP id HIY07418; Sat, 24 Dec 2005 10:07:18 +0200 (IST) Received: from HOME-C4E4A596F7 (IGLD-80-230-32-253.inter.net.il [80.230.32.253]) by nitzan.inter.net.il (MOS 3.7.2-GA) with ESMTP id CGX36034 (AUTH halo1); Sat, 24 Dec 2005 10:07:11 +0200 (IST) Date: Sat, 24 Dec 2005 17:02:00 -0000 Message-Id: From: Eli Zaretskii To: Michael Snyder CC: gdb-patches@sources.redhat.com, drow@false.org, mark.kettenis@xs4all.nl In-reply-to: <43AC7D2E.6020609@redhat.com> (message from Michael Snyder on Fri, 23 Dec 2005 14:41:50 -0800) Subject: Re: [RFA] Linux Checkpoints, take 3 Reply-to: Eli Zaretskii References: <43AC7D2E.6020609@redhat.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-12/txt/msg00285.txt.bz2 > Date: Fri, 23 Dec 2005 14:41:50 -0800 > From: Michael Snyder > > Fixups per Daniel and Eli. Thanks. I have a few comments, below. > + for (fp = fork_list; fp; fp = fp->next) > + { > + if (ptid_equal (fp->ptid, inferior_ptid)) > + { > + printf_filtered ("* "); > + pc = read_pc (); > + } > + else > + { > + printf_filtered (" "); > + pc = fp->pc; > + } > + printf_filtered ("%d %s", fp->num, target_pid_to_str (fp->ptid)); > + if (fp->num == 0) > + printf_filtered (_(" (main process)")); > + printf_filtered (_(" at ")); > + deprecated_print_address_numeric (pc, 1, gdb_stdout); > + > + sal = find_pc_line (pc, 0); > + if (sal.symtab) > + { > + char *tmp = strrchr (sal.symtab->filename, '/'); > + > + if (tmp) > + printf_filtered (_(", file %s"), tmp + 1); > + else > + printf_filtered (_(", file %s"), sal.symtab->filename); > + } > + if (sal.line) > + printf_filtered (_(", line %d"), sal.line); > + if (!sal.symtab && !sal.line) > + { > + struct minimal_symbol *msym; > + > + msym = lookup_minimal_symbol_by_pc (pc); > + if (msym) > + printf_filtered (", <%s>", SYMBOL_LINKAGE_NAME (msym)); > + } > + > + putchar_filtered ('\n'); > + } > + } This function produces text in chunks, which is bad for translation (since each partial string will be a separate string in the message catalog, and the translators will have no easy way of finding out that they all are parts of the same phrase). The solution to this is either (1) to rewrite the code so that it uses complete phrases, even if that means have several strings that are partially identical; or (2) have an i18n comment before each line that shows the full phrase (this comment will then be shown in the message catalog, where the translators will see it when they translate the parts). I prefer solution (1), unless it makes the code really monstrously complex/ugly/unmaintainable. For a suggestion how to use technique (1) see: http://sourceware.org/ml/gdb-patches/2004-12/msg00135.html. For an example of (2), see the function aix-thread.c:state2str. > *************** child_follow_fork (struct target_ops *op > *** 363,377 **** > also, but they'll be reinserted below. */ > detach_breakpoints (child_pid); > > ! if (debug_linux_nat) > { > ! target_terminal_ours (); > ! fprintf_unfiltered (gdb_stdlog, > ! "Detaching after fork from child process %d.\n", > ! child_pid); > ! } > > ! ptrace (PTRACE_DETACH, child_pid, 0, 0); > > if (has_vforked) > { > --- 370,397 ---- > also, but they'll be reinserted below. */ > detach_breakpoints (child_pid); > > ! /* Detach new forked process? */ > ! if (detach_fork) > { > ! if (debug_linux_nat) > ! { > ! target_terminal_ours (); > ! fprintf_filtered (gdb_stdlog, > ! "Detaching after fork from child process %d.\n", > ! child_pid); > ! } Might as well mark strings with _(), as long as we are changing the code. > + @cindex debugging multiple processes > + On Linux, if you want to debug both the parent and child processes, use the GNU/Linux, please.