unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lennart Borgman <lennart.borgman@gmail.com>
Cc: 6420@debbugs.gnu.org
Subject: bug#6420: Some enhancements to debugging
Date: Mon, 14 Jun 2010 20:58:33 +0300	[thread overview]
Message-ID: <83y6ehijhy.fsf@gnu.org> (raw)
In-Reply-To: <AANLkTik99WC9EFutx_OApcCx6ATeMVmqhdsZ73AFrzGk@mail.gmail.com>

> From: Lennart Borgman <lennart.borgman@gmail.com>
> Date: Mon, 14 Jun 2010 08:11:59 +0200
> Cc: 
> 
> === modified file 'src/w32proc.c'
> --- trunk/src/w32proc.c	2010-06-04 14:13:35 +0000
> +++ patched/src/w32proc.c	2010-06-14 05:53:50 +0000
> @@ -121,9 +121,17 @@
>  {
>    char buf[1024];
>    va_list args;
> +  char *buf_pos = buf;
> +
> +  /* On NT add thread id */
> +#ifdef WINDOWSNT
> +  DWORD thread_id = GetCurrentThreadId ();
> +  sprintf (buf_pos, "[Th%04x]  ", thread_id);
> +  buf_pos = buf_pos + 10;
> +#endif

The above #ifdef is unnecessary: all the platforms that compile this
file have WINDOWSNT defined by definition.

Also, why do you use magic constants such as 10, instead of the value
returned by `sprintf'?

> -	  DebPrint (("reader_thread.SetEvent failed with %lu for fd %ld\n",
> -		     GetLastError (), cp->fd));
> +	  DebPrint (("reader_thread.SetEvent failed with %lu for fd %ld, pid %ld\n",
> +		     GetLastError (), cp->fd, cp->pid));

cp->fd and cp->pid are both `int', so no need for `l' in `%ld'.  Just
use `%d'.

> +If the message is longer than 1000 chars it will be split in several
> +lines.

Not really 1000, since you are prepending a thread ID, no?





  reply	other threads:[~2010-06-14 17:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14  6:11 bug#6420: Some enhancements to debugging Lennart Borgman
2010-06-14 17:58 ` Eli Zaretskii [this message]
2010-06-14 18:02   ` Lennart Borgman
2020-09-19 21:17 ` Lars Ingebrigtsen
2021-05-10 11:11   ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83y6ehijhy.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=6420@debbugs.gnu.org \
    --cc=lennart.borgman@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).