Date: Thu, 01 Jul 2004 09:15:58 +0800 From: David Xu <davidxu@freebsd.org> To: Marcel Moolenaar <marcel@xcllnt.net> Cc: Perforce Change Reviews <perforce@freebsd.org> Subject: Re: PERFORCE change 56172 for review Message-ID: <40E365CE.8070508@freebsd.org> In-Reply-To: <20040701000327.GA44174@dhcp50.pn.xcllnt.net> References: <200406302305.i5UN5Dtj055376@repoman.freebsd.org> <20040701000327.GA44174@dhcp50.pn.xcllnt.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Marcel Moolenaar wrote: > On Wed, Jun 30, 2004 at 11:05:13PM +0000, David Xu wrote: > >>http://perforce.freebsd.org/chv.cgi?CH=56172 >> >>Change 56172 by davidxu@davidxu_alona on 2004/06/30 23:04:22 >> >> Let ptrace deal with lwpid as pid. remove ttrace. > > > Excellent! Any complications with using ptrace(2) or did it all > fall out naturally as I hoped? > I think there is not important problem within this change, current if I PT_GETREGS with a pid but not lwpid, I just use first thread in the proc, this needs to be studied further whether we should reject the call for threaded process. also I allow PT_ATTACH etcs to use lwpid. > BTW: I'll copy this and libthread_db from your branch to mine. I'll > keep using my proc_service.h for now, so I'll have to tweak it a bit. > (I don't use the existing proc-service.c in GDB because we need to > rewrite the PTID to get this all working for us)... OK, feel free to do. I only have trouble with gdb_proc_service.h, gdb it defines proc service function prototypes and some other types. but libthread_db needs a proc_service.h, I don't want to let libthread_db depend on gdb_proc_service.h, so we need to keep our proc_service.h consistent with gdb, or we don't use gdb's proc_service.c at all, we write our version of proc_service.c as solaris thread db did. However, in my experience, gdb proc service works well. I only use it when I need to retrieve lwp's registers, the gdb's proc service really doing nothing, it just redirect all requests to current target, I implement fbsd_fetch/store_lwp_registers in my freebsd-thread.c, they will be called by gdb proc service, the code path in my libthread_db and freebsd-thread.c looks like following: libthread_db -> ps_lgetregs -> target_fetch_registers -> fbsd_thread_fetch_registers -> fbsd_fetch_lwp_registers -> -> ptrace(lwp)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40E365CE.8070508>