From: Lennart Borgman <lennart.borgman@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 6420@debbugs.gnu.org
Subject: bug#6420: Some enhancements to debugging
Date: Mon, 14 Jun 2010 20:02:57 +0200 [thread overview]
Message-ID: <AANLkTin_dKrVuN4HjIZ_SYOeJyy3dxxHZTVPgCj9R34e@mail.gmail.com> (raw)
In-Reply-To: <83y6ehijhy.fsf@gnu.org>
On Mon, Jun 14, 2010 at 7:58 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> 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.
OK, I thought it maybe was used by the ms-dos port too.
> Also, why do you use magic constants such as 10, instead of the value
> returned by `sprintf'?
Eh, because my C fu is low. Of course the return value should be used instead.
>> - 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?
Yes, I was not very specific there. I did not think it was that important.
next prev parent reply other threads:[~2010-06-14 18:02 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
2010-06-14 18:02 ` Lennart Borgman [this message]
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=AANLkTin_dKrVuN4HjIZ_SYOeJyy3dxxHZTVPgCj9R34e@mail.gmail.com \
--to=lennart.borgman@gmail.com \
--cc=6420@debbugs.gnu.org \
--cc=eliz@gnu.org \
/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).