Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Michael Snyder <msnyder@redhat.com>
Cc: gdb-patches@sources.redhat.com, drow@false.org, mark.kettenis@xs4all.nl
Subject: Re: [RFA] Linux Checkpoints, take 3
Date: Sat, 24 Dec 2005 17:02:00 -0000	[thread overview]
Message-ID: <u4q4yj4ul.fsf@gnu.org> (raw)
In-Reply-To: <43AC7D2E.6020609@redhat.com> (message from Michael Snyder on 	Fri, 23 Dec 2005 14:41:50 -0800)

> Date: Fri, 23 Dec 2005 14:41:50 -0800
> From: Michael Snyder <msnyder@redhat.com>
> 
> 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.


  reply	other threads:[~2005-12-24  8:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-24 16:32 Michael Snyder
2005-12-24 17:02 ` Eli Zaretskii [this message]
2005-12-26 18:58   ` Daniel Jacobowitz
2005-12-26 19:27     ` Eli Zaretskii
2005-12-27 15:38 ` Mark Kettenis
2005-12-27 15:40   ` Eli Zaretskii
2006-01-03 23:54   ` Michael Snyder
2006-01-04 19:16     ` Mark Kettenis
2006-01-04 19:36       ` Michael Snyder
2006-01-04  1:49   ` Michael Snyder

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=u4q4yj4ul.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mark.kettenis@xs4all.nl \
    --cc=msnyder@redhat.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