bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#6420: Some enhancements to debugging


From: Lennart Borgman
Subject: bug#6420: Some enhancements to debugging
Date: Mon, 14 Jun 2010 20:02:57 +0200

On Mon, Jun 14, 2010 at 7:58 PM, Eli Zaretskii <address@hidden> wrote:
>> From: Lennart Borgman <address@hidden>
>> 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]