Pthreadid, pid

From: KV Pavuram (kvpavuram_at_yahoo.co.in)
Date: 06/30/05

  • Next message: Jeff Mahoney: "Re: [PATCH] reiserfs: enable attrs by default if saf"
    Date:	Thu, 30 Jun 2005 14:14:19 +0100 (BST)
    To: linux-kernel@vger.kernel.org
    
    

    Hello,

    When i run a multi-threaded program from gdb, gdb
    shows "New Thread XXXXXXXX (LWP LLLL)" for each new
    thread created by the application.

    However, when I run ps -aelfm, the output shows each
    thread of this application but with a different PID.

    And, getpid () in each thread inside the application
    always retreives the same PID.

    What is the relation between LWP is given by GDB, PID
    shown by ps call and the PID returned by getpid ().

    Is there any system call to obtain one from the
    other??

    The problem occurs when i run strace on one the
    threads using PID given by ps command. I cant run
    application through GDB for strace to work. So i am
    not able to match the strace output to a particular
    thread in my application.

    Thanks.
    Pav.

                    
    __________________________________________________________
    How much free photo storage do you get? Store your friends 'n family snaps for FREE with Yahoo! Photos http://in.photos.yahoo.com
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Jeff Mahoney: "Re: [PATCH] reiserfs: enable attrs by default if saf"

    Relevant Pages

    • GDB help needed !
      ... and it is crashing at some point..I have ... attached the gdb to the PID of the application, ... procfs: Couldn't locate pid -1 ...
      (comp.unix.programmer)
    • Re: C-level debugging of BLT using MinGW gdb
      ... grep wish" to find out the PID of wish. ... I can run gdb and ... attach it to the running wish process. ... Debugging works just fine after ...
      (comp.lang.tcl)
    • vfork causes coredump
      ... GDB only show ... Program received signal SIGSEGV, Segmentation fault. ... pid_t pid; ... main (void) ...
      (comp.unix.programmer)
    • Re: PStack
      ... one can use a debugger (like gdb) to attach ... to a give pid to get the backtrace. ...
      (comp.sys.hp.hpux)
    • Re: PStack
      ... one can use a debugger (like gdb) to attach ... to a give pid to get the backtrace. ...
      (comp.sys.hp.hpux)