bug-ddd
[Top][All Lists]
Advanced

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

patch to improve threads window


From: Patrick Pelletier
Subject: patch to improve threads window
Date: Tue, 23 Oct 2001 16:18:38 -0700

Hi,

I'd like to suggest the following patch to DDD:

*** SourceView.C~       Thu Apr 26 04:08:06 2001
--- SourceView.C        Tue Oct 23 15:41:07 2001
***************
*** 6962,6966 ****
        static regex rxarglist("[(][^0-9][^)]*[)]");
  #endif
!       int start = index(line, rxarglist, "(");
        if (start > 0)
        {
--- 6962,6966 ----
        static regex rxarglist("[(][^0-9][^)]*[)]");
  #endif
!       int start = index(line, rxarglist, "(", -1);
        if (start > 0)
        {

I feel that the original version was in error, because it deletes
everything on the line between the first '(' and the last ')', even if
there are multiple pairs of parentheses.  So, for example, if the
output of "info threads" from GDB was:

* 2 thread 2 (MIPS CPU 1)  0xa00249d0 in __sprint (fp=0x801ff8c0, uio=0x0) at 
../../../../../newlib-1.9.0/newlib/libc/stdio/vfprintf.c:193
  1 thread 1 (MIPS CPU 0)  0xa0024c44 in _vfprintf_r (data=0xa002b2b8, 
fp=0x800ff8c0, fmt0=0x1 "\b\200", ap=0x800fffcc) at 
../../../../../newlib-1.9.0/newlib/libc/stdio/vfprintf.c:441

then the threads window displayed:

2 thread 2 () at vfprintf.c:193
1 thread 1 () at vfprintf.c:441

which not only loses the "extra thread info" (between the first pair
of parentheses), but also loses the function name (which is between
the first close-paren and the second open-paren).  With my suggested
patch, DDD displays:

2 thread 2 (MIPS CPU 1)  0xa00249d0 in __sprint () at vfprintf.c:193
1 thread 1 (MIPS CPU 0)  0xa0024c44 in _vfprintf_r () at vfprintf.c:441

which only cuts out the function arguments, which I believe is what
the code was originally intended to do.  (And certainly seems more
useful to me.)

Thanks!

--Patrick



reply via email to

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