This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA/testsuite] attach.exp: Add small delay in busy loop...


Hello,

On Tue, Nov 18, 2003 at 04:26:07PM -0800, Michael Snyder wrote:
> >2003-11-18  J. Brobecker  <brobecker@gnat.com>
> >
> >        * gdb.base/attach.c: Add small delay in busy loop.
> >        * gdb.base/attach.exp: Make some associated adjustments.
> >
> >OK to apply?
> 
> Seems to work on Linux.  I'd sure like to see that backtrace test,
> though, to confirm that we are able to build a meaningful machine
> state after we attach.

Here is a new version of the patch, with the backtraces in. I do have
two FAILs though. The first FAIL comes from the following test:

   gdb_test "backtrace" \
            ".*in nanosleep ().*in small_delay ().*in main ().*" \
            "backtrace after attach2"

The logs show:

        backtrace
        #0  0x400eb3b5 in ?? () from /lib/libc.so.6
        #1  0x08048412 in small_delay () at ./gdb.base/attach.c:18
        #2  0x08048435 in main () at ./gdb.base/attach.c:29
        (gdb) FAIL: gdb.base/attach.exp: backtrace after attach2

So the problem is that GDB is unable to find the function name for
frame $0. I think this comes from these warnings while performing
the attach command:

        attach 3671
        Attaching to process 3671
        Reading symbols from /[...]/testsuite/gdb.base/attach...done.
  -->   Symbols already loaded for /lib/libm.so.6
  -->   Symbols already loaded for /lib/libc.so.6
        Symbols already loaded for /lib/ld-linux.so.2
        0x400eb3b5 in ?? () from /lib/libc.so.6^M 
        (gdb) PASS: gdb.base/attach.exp: attach2

The second FAIL is identical.

I am not sure what's best to do. Normally, the first purpose when I
wrote the test was to make sure that we were able to see a frame
for procedure main(), and then got overzealous by checking that we
could see at least main(), small_delay() and nanosleep(). But then
this problem came up. In my opinion, we should still keep my zealous
version of the expected output for the "backtrace" commands and either
leave with the fail, or make them as KFAILS (or whatever proper state
it should be, I didn't much follow that discussion).

There is another thing that I think needs mentioning. I noticed I am
the first one to introduce the use of nanosleep(). I think it's pretty
portable, but I am having doubts. Does anybody know if it's not available
on any platform. How about cygwin for instance?

Otherwise, is there another function that I could use instead? Sleep is
used in several of the tests - although the timer resolution is much
coarser, it would probably be fine to use sleep() in this test too.
There is also select, but I'm not sure it's available on cygwin. It's
already been used in one of the pthread examples, though...

-- 
Joel

Attachment: attach.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]