This is the mail archive of the gdb-patches@sourceware.org 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]

[RFA/commit] Add support for DEC threads on alpha-osf


Hello,

This is something I implemented a few months ago, and so far, it has
been working well for us.  It is based on the OSF pthreaddebug library.
I did the minimal amount of work to be able to switch from thread
to thread. In terms of execution, I just re-route the target queries
down to the lower layer.

Pedro, is there something I should be doing for the always-a-thread
thing? I tested with a program that doesn't use threads, and the
good news is that I do see a "process" thread. Perhaps that was
thanks to you.  On the other hand, I still see that process thread
when debugging programs that use threads, and I wonder if this is
a problem or not.

Before my patch, the output looked like:

    (gdb) info threads
      4 LWP 3  task_switch.break_me () at task_switch.adb:43
      3 LWP 9  0x0000000000000000 in ?? ()
      2 LWP 8  0x00000300000408e8 in __nxm_thread_block ()
       from /usr/shlib/libpthread.so
    * 1 process 256360  task_switch.break_me () at task_switch.adb:43

(the LWPs come from procfs but they don't relate to user-level threads;
notice how LWP 3 is the same as process 256360)

After the patch, the real threads now start appearing:

    (gdb) info threads
      7 LWP 3  task_switch.break_me () at task_switch.adb:43
      6 LWP 9  0x0000000000000000 in ?? ()
      5 LWP 8  0x00000300000408e8 in __nxm_thread_block ()
       from /usr/shlib/libpthread.so
    * 4 Thread 3  task_switch.break_me () at task_switch.adb:43
      3 Thread 2  0x000003000004067c in __hstTransferRegistersPC ()
       from /usr/shlib/libpthread.so
      2 Thread 1  0x000003000004067c in __hstTransferRegistersPC ()
       from /usr/shlib/libpthread.so
      1 process 269190  task_switch.break_me () at task_switch.adb:43

(notice how now we have 3 thread entries that seem to be the same
actual thread)

Personally, I think it's fine.

2008-10-07  Joel Brobecker  <brobecker@adacore.com>

        * dec-thread.c: New file.
        * config/alpha/alpha-osf3.mh (NATDEPFILES): Add dec-thread.o.
        (NAT_CLIBS): Define.

I'd like to commit in a week, if there are no objections.  In terms
of testing, I tried running the testsuite again, but one more time
I failed miserably.  I had hoped that the fixes to the terminal issues
might have explained the timeouts, but to no avail.  So I can only
offer the fact that this code has been tested through AdaCore's
testsuite and passed all tests, including our tests involving tasking.

Any objection?

-- 
Joel

Attachment: dec-thread.c
Description: Text document

Attachment: dec-threads.diff
Description: Text document


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