From pgollucci@piccollo.p6m7g8.net Tue Jul 11 07:54:57 2006 Return-Path: Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A740C16A4DD for ; Tue, 11 Jul 2006 07:54:57 +0000 (UTC) (envelope-from pgollucci@piccollo.p6m7g8.net) Received: from piccollo.p6m7g8.net (c66-236-219-70.ip.panth.com [66.236.219.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9887243D46 for ; Tue, 11 Jul 2006 07:54:56 +0000 (GMT) (envelope-from pgollucci@piccollo.p6m7g8.net) Received: from piccollo.p6m7g8.net (localhost [127.0.0.1]) by piccollo.p6m7g8.net (8.13.6/8.13.6) with ESMTP id k6B7skhl014263 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO); Tue, 11 Jul 2006 03:54:46 -0400 (EDT) (envelope-from pgollucci@piccollo.p6m7g8.net) Received: (from pgollucci@localhost) by piccollo.p6m7g8.net (8.13.6/8.13.6/Submit) id k6B7se5L014262; Tue, 11 Jul 2006 03:54:40 -0400 (EDT) (envelope-from pgollucci) Message-Id: <200607110754.k6B7se5L014262@piccollo.p6m7g8.net> Date: Tue, 11 Jul 2006 03:54:40 -0400 (EDT) From: "Philip M. Gollucci" Reply-To: "Philip M. Gollucci" To: FreeBSD-gnats-submit@freebsd.org Cc: dev@httpd.apache.org, dev@perl.apache.org, chip@force-elite.com Subject: New port: devel/gdb65 GNU GDB 6.5 X-Send-Pr-Version: 3.113 X-GNATS-Notify: >Number: 100067 >Category: ports >Synopsis: New port: devel/gdb65 GNU GDB 6.5 >Confidential: no >Severity: serious >Priority: medium >Responsible: obrien >State: closed >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Jul 11 08:00:38 GMT 2006 >Closed-Date: Tue Aug 28 21:50:17 GMT 2007 >Last-Modified: Tue Aug 28 21:50:17 GMT 2007 >Originator: Philip M. Gollucci >Release: FreeBSD 6.1-STABLE i386 >Organization: P6M7G8 Consulting >Environment: System: FreeBSD home.p6m7g8.net 6.1-STABLE FreeBSD 6.1-STABLE #0: Mon Jul 3 23:24:44 PDT 2006 pgollucci@home.p6m7g8.net /usr/src/sys/HOME i386 >Description: sudo gdb ./httpd gdb>r GDB itself segfaults (all current versions in base and ports) This allows you for the first time since 2004 to debug httpd startup code on FreeBSD Personally, I think its mission critical considering the applicationS it affects. This is currently only for the i386 architecture, and does not includet the KGDB patches. [I was having issues with set_context() and regcache_* functions] >Description: >How-To-Repeat: >Fix: Use this new port - version 6.5. I haven't tried versions 6.2->6.4, but why use outdated software. Its killing me that we haven't seen a gdb update in almost 2 years even in ports. Base system I understand completely. --- gdb65.shar begins here --- # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # gdb65 # gdb65/Makefile # gdb65/distinfo # gdb65/pkg-descr # gdb65/files # gdb65/files/fbsd4.h # gdb65/files/freebsd-uthread.c # gdb65/files/patch-gdb-Makefile.in # gdb65/files/nm-fbsd.h # gdb65/files/patch-gdb-version.in # gdb65/pkg-plist # echo c - gdb65 mkdir -p gdb65 > /dev/null 2>&1 echo x - gdb65/Makefile sed 's/^X//' >gdb65/Makefile << 'END-of-gdb65/Makefile' X# ex:ts=8 X# Ports collection makefile for: GDB 6.5 X# Date created: 10 July 2006 X# Whom: Philip M. Gollucci X# X# $FreeBSD$ X# X XPORTNAME= gdb XPORTVERSION= 6.5 XCATEGORIES= devel XMASTER_SITES= ${MASTER_SITE_GNU} XMASTER_SITE_SUBDIR= gdb XDISTNAME= gdb-${PORTVERSION} X XMAINTAINER= pgollucci@p6m7g8.com XCOMMENT= GNU GDB 6.5 X XUSE_BZIP2= yes XGNU_CONFIGURE= yes XCONFIGURE_ARGS= --program-suffix=6.5 XCFLAGS+= -DRL_NO_COMPAT -DKGDB X X.include X X.if ${OSVERSION} < 500000 XCFLAGS+= -include ${FILESDIR}/fbsd4.h X.endif X X.if ${ARCH} == "amd64" XCONFIGURE_TARGET= x86_64-portbld-freebsd${OSREL} X.endif X Xpre-configure: X cd ${WRKSRC} ; ${RM} -rf dejagnu expect readline sim tcl texinfo X ${LN} -sf ${FILESDIR}/freebsd-uthread.c ${WRKSRC}/gdb/freebsd-uthread.c X ${LN} -sf ${FILESDIR}/nm-fbsd.h ${WRKSRC}/gdb/config X Xdo-install: X ${INSTALL_PROGRAM} ${WRKSRC}/gdb/gdb \ X ${PREFIX}/bin/${PORTNAME}${PORTVERSION:S/.//g} X X.include END-of-gdb65/Makefile echo x - gdb65/distinfo sed 's/^X//' >gdb65/distinfo << 'END-of-gdb65/distinfo' XMD5 (gdb-6.5.tar.bz2) = af6c8335230d7604aee0803b1df14f54 XSHA256 (gdb-6.5.tar.bz2) = 0011318d9720781d486c835e88b915f90f2c10e7101d648b64dd4739218d3faf XSIZE (gdb-6.5.tar.bz2) = 14303558 END-of-gdb65/distinfo echo x - gdb65/pkg-descr sed 's/^X//' >gdb65/pkg-descr << 'END-of-gdb65/pkg-descr' XGNU GDB 6.5 X XWWW: http://www.gnu.org/software/gdb/bugs/ END-of-gdb65/pkg-descr echo c - gdb65/files mkdir -p gdb65/files > /dev/null 2>&1 echo x - gdb65/files/fbsd4.h sed 's/^X//' >gdb65/files/fbsd4.h << 'END-of-gdb65/files/fbsd4.h' X// $FreeBSD: ports/devel/gdb6/files/fbsd4.h,v 1.2 2005/03/11 04:52:49 obrien Exp $ X Xextern void _rl_set_screen_size (int, int); X X#define rl_set_screen_size _rl_set_screen_size X#define rl_filename_completion_function filename_completion_function X Xextern int screenwidth, screenheight; X Xstatic inline void Xrl_get_screen_size (int *rows, int *cols) X{ X if (rows) *rows = screenheight; X if (cols) *cols = screenwidth; X} X X#if 0 X#define savestring X#include X#undef savestring X#endif END-of-gdb65/files/fbsd4.h echo x - gdb65/files/freebsd-uthread.c sed 's/^X//' >gdb65/files/freebsd-uthread.c << 'END-of-gdb65/files/freebsd-uthread.c' X/* Low level interface for debugging FreeBSD user threads for GDB, the GNU debugger. X Copyright 1996, 1999 Free Software Foundation, Inc. X XThis file is part of GDB. X XThis program is free software; you can redistribute it and/or modify Xit under the terms of the GNU General Public License as published by Xthe Free Software Foundation; either version 2 of the License, or X(at your option) any later version. X XThis program is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY; without even the implied warranty of XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the XGNU General Public License for more details. X XYou should have received a copy of the GNU General Public License Xalong with this program; if not, write to the Free Software XFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ X X/* $FreeBSD: ports/devel/gdb6/files/freebsd-uthread.c,v 1.4 2004/10/20 19:37:48 obrien Exp $ */ X X/* This module implements a sort of half target that sits between the X machine-independent parts of GDB and the ptrace interface (infptrace.c) to X provide access to the FreeBSD user-mode thread implementation. X X FreeBSD threads are true user-mode threads, which are invoked via X the pthread_* interfaces. These are mostly implemented in X user-space, with all thread context kept in various structures that X live in the user's heap. For the most part, the kernel has no X knowlege of these threads. X X Based largely on hpux-thread.c X X */ X X X#include "defs.h" X#include X#include X#include X#include X#include "gdbthread.h" X#include "target.h" X#include "inferior.h" X#include X#include X#include X#include X#include "gdbcore.h" X#include "regcache.h" X Xextern int child_suppress_run; Xextern struct target_ops child_ops; /* target vector for inftarg.c */ X Xextern void _initialize_freebsd_uthread PARAMS ((void)); X X/* Set to true while we are part-way through attaching */ Xstatic int freebsd_uthread_attaching; X Xstatic int freebsd_uthread_active = 0; Xstatic CORE_ADDR P_thread_list; Xstatic CORE_ADDR P_thread_run; X X/* Pointer to the next function on the objfile event chain. */ Xstatic void (*target_new_objfile_chain) (struct objfile *objfile); X Xstatic void freebsd_uthread_resume PARAMS ((ptid_t pid, int step, X enum target_signal signo)); X Xstatic void init_freebsd_uthread_ops PARAMS ((void)); X Xstatic struct target_ops freebsd_uthread_ops; X Xstatic ptid_t find_active_ptid PARAMS ((void)); X Xstruct cached_pthread { X u_int64_t uniqueid; X int state; X CORE_ADDR name; X union { X ucontext_t uc; X jmp_buf jb; X } ctx; X}; X Xstatic ptid_t cached_ptid; Xstatic struct cached_pthread cached_pthread; Xstatic CORE_ADDR cached_pthread_addr; X XLIST_HEAD(idmaplist, idmap); X Xstruct idmap { X LIST_ENTRY(idmap) link; X u_int64_t uniqueid; X int tid; X}; X X#define MAPHASH_SIZE 257 X#define TID_MIN 1 X#define TID_MAX 16383 X Xstatic int tid_to_hash[TID_MAX + 1]; /* set to map_hash index */ Xstatic struct idmaplist map_hash[MAPHASH_SIZE]; Xstatic int next_free_tid = TID_MIN; /* first available tid */ Xstatic int last_free_tid = TID_MIN; /* first unavailable */ X Xstatic CORE_ADDR P_thread_next_offset; Xstatic CORE_ADDR P_thread_uniqueid_offset; Xstatic CORE_ADDR P_thread_state_offset; Xstatic CORE_ADDR P_thread_name_offset; Xstatic CORE_ADDR P_thread_ctx_offset; Xstatic CORE_ADDR P_thread_PS_RUNNING_value; Xstatic CORE_ADDR P_thread_PS_DEAD_value; X Xstatic int next_offset; Xstatic int uniqueid_offset; Xstatic int state_offset; Xstatic int name_offset; Xstatic int ctx_offset; Xstatic int PS_RUNNING_value; Xstatic int PS_DEAD_value; X X#define UNIQUEID_HASH(id) (id % MAPHASH_SIZE) X#define TID_ADD1(tid) (((tid) + 1) == TID_MAX + 1 \ X ? TID_MIN : (tid) + 1) X#define IS_TID_FREE(tid) (tid_to_hash[tid] == -1) X Xstatic int Xget_new_tid(int h) X{ X int tid = next_free_tid; X X tid_to_hash[tid] = h; X next_free_tid = TID_ADD1(next_free_tid); X if (next_free_tid == last_free_tid) X { X int i; X X for (i = last_free_tid; TID_ADD1(i) != last_free_tid; i = TID_ADD1(i)) X if (IS_TID_FREE(i)) X break; X if (TID_ADD1(i) == last_free_tid) X { X error("too many threads"); X return 0; X } X next_free_tid = i; X for (i = TID_ADD1(i); IS_TID_FREE(i); i = TID_ADD1(i)) X ; X last_free_tid = i; X } X X return tid; X} X Xstatic ptid_t Xfind_ptid(u_int64_t uniqueid) X{ X int h = UNIQUEID_HASH(uniqueid); X struct idmap *im; X X LIST_FOREACH(im, &map_hash[h], link) X if (im->uniqueid == uniqueid) X return MERGEPID(PIDGET(inferior_ptid), im->tid); X X im = xmalloc(sizeof(struct idmap)); X im->uniqueid = uniqueid; X im->tid = get_new_tid(h); X LIST_INSERT_HEAD(&map_hash[h], im, link); X X return MERGEPID(PIDGET(inferior_ptid), im->tid); X} X Xstatic void Xfree_ptid(ptid_t ptid) X{ X int tid = TIDGET(ptid); X int h = tid_to_hash[tid]; X struct idmap *im; X X if (!tid) return; X X LIST_FOREACH(im, &map_hash[h], link) X if (im->tid == tid) X break; X X if (!im) return; X X LIST_REMOVE(im, link); X tid_to_hash[tid] = -1; X free(im); X} X X#define READ_OFFSET(field) read_memory(P_thread_##field##_offset, \ X (char *) &field##_offset, \ X sizeof(field##_offset)) X X#define READ_VALUE(name) read_memory(P_thread_##name##_value, \ X (char *) &name##_value, \ X sizeof(name##_value)) X Xstatic void Xread_thread_offsets (void) X{ X READ_OFFSET(next); X READ_OFFSET(uniqueid); X READ_OFFSET(state); X READ_OFFSET(name); X READ_OFFSET(ctx); X X READ_VALUE(PS_RUNNING); X READ_VALUE(PS_DEAD); X} X X#define READ_FIELD(ptr, T, field, result) \ X read_memory ((ptr) + field##_offset, (char *) &(result), sizeof result) X Xstatic u_int64_t Xread_pthread_uniqueid (CORE_ADDR ptr) X{ X u_int64_t uniqueid; X READ_FIELD(ptr, u_int64_t, uniqueid, uniqueid); X return uniqueid; X} X Xstatic CORE_ADDR Xread_pthread_next (CORE_ADDR ptr) X{ X CORE_ADDR next; X READ_FIELD(ptr, CORE_ADDR, next, next); X return next; X} X Xstatic void Xread_cached_pthread (CORE_ADDR ptr, struct cached_pthread *cache) X{ X READ_FIELD(ptr, u_int64_t, uniqueid, cache->uniqueid); X READ_FIELD(ptr, int, state, cache->state); X READ_FIELD(ptr, CORE_ADDR, name, cache->name); X READ_FIELD(ptr, ucontext_t, ctx, cache->ctx); X} X Xstatic ptid_t Xfind_active_ptid (void) X{ X CORE_ADDR ptr; X X read_memory ((CORE_ADDR)P_thread_run, X (char *)&ptr, X sizeof ptr); X X return find_ptid(read_pthread_uniqueid(ptr)); X} X Xstatic CORE_ADDR find_pthread_addr PARAMS ((ptid_t ptid)); Xstatic struct cached_pthread * find_pthread PARAMS ((ptid_t ptid)); X Xstatic CORE_ADDR Xfind_pthread_addr (ptid_t ptid) X{ X CORE_ADDR ptr; X X if (ptid_equal(ptid, cached_ptid)) X return cached_pthread_addr; X X read_memory ((CORE_ADDR)P_thread_list, X (char *)&ptr, X sizeof ptr); X X while (ptr != 0) X { X if (ptid_equal(find_ptid(read_pthread_uniqueid(ptr)), ptid)) X { X cached_ptid = ptid; X cached_pthread_addr = ptr; X read_cached_pthread(ptr, &cached_pthread); X return ptr; X } X ptr = read_pthread_next(ptr); X } X X return NULL; X} X Xstatic struct cached_pthread * Xfind_pthread (ptid_t ptid) X{ X CORE_ADDR ptr; X X if (ptid_equal(ptid, cached_ptid)) X return &cached_pthread; X X read_memory ((CORE_ADDR)P_thread_list, X (char *)&ptr, X sizeof ptr); X X while (ptr != 0) X { X if (ptid_equal(find_ptid(read_pthread_uniqueid(ptr)), ptid)) X { X cached_ptid = ptid; X cached_pthread_addr = ptr; X read_cached_pthread(ptr, &cached_pthread); X return &cached_pthread; X } X ptr = read_pthread_next(ptr); X } X X#if 0 X error ("Can't find pthread %d,%d", PIDGET(ptid), TIDGET(ptid)); X#endif X return NULL; X} X X X/* Most target vector functions from here on actually just pass through to X inftarg.c, as they don't need to do anything specific for threads. */ X X/* ARGSUSED */ Xstatic void Xfreebsd_uthread_open (char *arg, int from_tty) X{ X child_ops.to_open (arg, from_tty); X} X X/* Attach to process PID, then initialize for debugging it X and wait for the trace-trap that results from attaching. */ X Xstatic void Xfreebsd_uthread_attach (char *args, int from_tty) X{ X child_ops.to_attach (args, from_tty); X push_target (&freebsd_uthread_ops); X freebsd_uthread_attaching = 1; X} X X/* After an attach, see if the target is threaded */ X Xstatic void Xfreebsd_uthread_post_attach (int pid) X{ X if (freebsd_uthread_active) X { X read_thread_offsets (); X inferior_ptid = find_active_ptid (); X add_thread (inferior_ptid); X } X else X { X unpush_target (&freebsd_uthread_ops); X push_target (&child_ops); X } X X freebsd_uthread_attaching = 0; X} X X/* Take a program previously attached to and detaches it. X The program resumes execution and will no longer stop X on signals, etc. We'd better not have left any breakpoints X in the program or it'll die when it hits one. For this X to work, it may be necessary for the process to have been X previously attached. It *might* work if the program was X started via the normal ptrace (PTRACE_TRACEME). */ X Xstatic void Xfreebsd_uthread_detach (char *args, int from_tty) X{ X child_ops.to_detach (args, from_tty); X} X X/* Resume execution of process PID. If STEP is nozero, then X just single step it. If SIGNAL is nonzero, restart it with that X signal activated. We may have to convert pid from a thread-id to an LWP id X for procfs. */ X Xstatic void Xfreebsd_uthread_resume (ptid_t ptid, int step, enum target_signal signo) X{ X if (freebsd_uthread_attaching) X { X child_ops.to_resume (ptid, step, signo); X return; X } X X child_ops.to_resume (ptid, step, signo); X cached_ptid = MERGEPID(0, 0); X} X X/* Wait for any threads to stop. We may have to convert PID from a thread id X to a LWP id, and vice versa on the way out. */ X Xstatic ptid_t Xfreebsd_uthread_wait (ptid_t ptid, struct target_waitstatus *ourstatus) X{ X ptid_t rtnval; X X if (freebsd_uthread_attaching) X { X return child_ops.to_wait (ptid, ourstatus); X } X X rtnval = child_ops.to_wait (ptid, ourstatus); X X if (PIDGET(rtnval) >= 0) X { X rtnval = find_active_ptid (); X if (!in_thread_list (rtnval)) X add_thread (rtnval); X } X X return rtnval; X} X X/* XXX: this needs to be selected by target, not [build] host */ X#ifdef __i386__ X X#include "i386-tdep.h" X Xstatic char sigmap[I386_SSE_NUM_REGS] = /* map reg to sigcontext */ X{ X 12, /* eax */ X 11, /* ecx */ X 10, /* edx */ X 9, /* ebx */ X 8, /* esp */ X 7, /* ebp */ X 6, /* esi */ X 5, /* edi */ X 15, /* eip */ X 17, /* eflags */ X 16, /* cs */ X 19, /* ss */ X 4, /* ds */ X 3, /* es */ X 2, /* fs */ X 1, /* gs */ X -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ X -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ X -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ X -1, /* mxcsr */ X}; X Xstatic char jmpmap[I386_SSE_NUM_REGS] = /* map reg to jmp_buf */ X{ X 6, /* eax */ X -1, /* ecx */ X -1, /* edx */ X 1, /* ebx */ X 2, /* esp */ X 3, /* ebp */ X 4, /* esi */ X 5, /* edi */ X 0, /* eip */ X -1, /* eflags */ X -1, /* cs */ X -1, /* ss */ X -1, /* ds */ X -1, /* es */ X -1, /* fs */ X -1, /* gs */ X -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ X -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ X -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ X -1, /* mxcsr */ X}; X X#endif X X#ifdef __amd64__ X X#include "amd64-tdep.h" X X// XXX:DEO not fully ported from i386 yet!! X Xstatic char sigmap[AMD64_NUM_REGS_TOTAL] = /* map reg to sigcontext */ X{ X 12, /* rax */ X 11, /* rcx */ X 10, /* rdx */ X 9, /* rbx */ X 8, /* rsp */ X 7, /* rbp */ X 6, /* rsi */ X 5, /* rdi */ X 15, /* rip */ X 17, /* rflags */ X 16, /* cs */ X 19, /* ss */ X 4, /* ds */ X 3, /* es */ X 2, /* fs */ X 1, /* gs */ X -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ X -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ X -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ X -1, /* mxcsr */ X}; X Xstatic char jmpmap[AMD64_NUM_REGS_TOTAL] = /* map reg to jmp_buf */ X{ X 6, /* rax */ X -1, /* rcx */ X -1, /* rdx */ X 1, /* rbx */ X 2, /* rsp */ X 3, /* rbp */ X 4, /* rsi */ X 5, /* rdi */ X 0, /* rip */ X -1, /* rflags */ X -1, /* cs */ X -1, /* ss */ X -1, /* ds */ X -1, /* es */ X -1, /* fs */ X -1, /* gs */ X -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ X -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ X -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ X -1, /* mxcsr */ X}; X X#endif X X#ifdef __alpha__ X X#include "alpha-tdep.h" X Xstatic char sigmap[ALPHA_NUM_REGS] = /* map reg to sigcontext */ X{ X 1, 2, 3, 4, 5, 6, 7, 8, /* v0 - t6 */ X 9, 10, 11, 12, 13, 14, 15, 16, /* t7 - fp */ X 17, 18, 19, 20, 21, 22, 23, 24, /* a0 - t9 */ X 25, 26, 27, 28, 29, 30, 31, 32, /* t10 - zero */ X 38, 39, 40, 41, 42, 43, 44, 45, /* f0 - f7 */ X 46, 47, 48, 49, 50, 51, 52, 53, /* f8 - f15 */ X 54, 55, 56, 57, 58, 59, 60, 61, /* f16 - f23 */ X 62, 63, 64, 65, 66, 67, 68, 69, /* f24 - f31 */ X 33, -1 /* pc, vfp */ X}; Xstatic char jmpmap[ALPHA_NUM_REGS] = { X 4, 5, 6, 7, 8, 9, 10, 11, /* v0 - t6 */ X 12, 13, 14, 15, 16, 17, 18, 19, /* t7 - fp */ X 20, 21, 22, 23, 24, 25, 26, 27, /* a0 - t9 */ X 28, 29, 30, 31, 32, 33, 34, 35, /* t10 - zero */ X 37, 38, 39, 40, 41, 42, 43, 44, /* f0 - f7 */ X 45, 46, 47, 48, 49, 50, 51, 52, /* f8 - f15 */ X 53, 54, 55, 56, 57, 58, 59, 60, /* f16 - f23 */ X 61, 62, 63, 64, 65, 66, 67, 68, /* f24 - f31 */ X 2, -1, /* pc, vfp */ X}; X X#endif X X#ifdef __sparc64__ X Xstatic char sigmap[125] = /* map reg to sigcontext */ X{ X -1 X}; Xstatic char jmpmap[125] = { X -1 X}; X X#endif X Xstatic void Xfreebsd_uthread_fetch_registers (int regno) X{ X struct cached_pthread *thread; X int active; X int first_regno, last_regno; X register_t *regbase; X char *regmap; X X if (freebsd_uthread_attaching || TIDGET(inferior_ptid) == 0) X { X child_ops.to_fetch_registers (regno); X return; X } X X thread = find_pthread (inferior_ptid); X active = (ptid_equal(inferior_ptid, find_active_ptid())); X X if (active) X { X child_ops.to_fetch_registers (regno); X return; X } X X if (regno == -1) X { X first_regno = 0; X last_regno = NUM_REGS - 1; X } X else X { X first_regno = regno; X last_regno = regno; X } X X regbase = (register_t*) &thread->ctx.jb[0]; X regmap = jmpmap; X X for (regno = first_regno; regno <= last_regno; regno++) X { X if (regmap[regno] == -1) X child_ops.to_fetch_registers (regno); X else X if (thread) X regcache_raw_supply (current_regcache, regno, (char*) ®base[regmap[regno]]); X else X regcache_raw_supply (current_regcache, regno, NULL); X } X} X Xstatic void Xfreebsd_uthread_store_registers (int regno) X{ X struct cached_pthread *thread; X CORE_ADDR ptr; X int first_regno, last_regno; X u_int32_t *regbase; X char *regmap; X X if (freebsd_uthread_attaching) X { X child_ops.to_store_registers (regno); X return; X } X X thread = find_pthread (inferior_ptid); X X if (thread->state == PS_RUNNING_value) X { X child_ops.to_store_registers (regno); X return; X } X X if (regno == -1) X { X first_regno = 0; X last_regno = NUM_REGS - 1; X } X else X { X first_regno = regno; X last_regno = regno; X } X X regbase = (u_int32_t*) &thread->ctx.jb[0]; X regmap = jmpmap; X X ptr = find_pthread_addr (inferior_ptid); X for (regno = first_regno; regno <= last_regno; regno++) X { X if (regmap[regno] == -1) X child_ops.to_store_registers (regno); X else X { X u_int32_t *reg = ®base[regmap[regno]]; X int off; X X /* Hang onto cached value */ X/*DEO:XXX*/ X memcpy(reg, deprecated_registers /*regcache_collect ()*/+ DEPRECATED_REGISTER_BYTE (regno), X register_size (current_gdbarch, regno)); X X /* And push out to inferior */ X off = (char *) reg - (char *) thread; X write_memory (ptr + off, X/*DEO:XXX*/ X deprecated_registers /*regcache_collect ()*/+ DEPRECATED_REGISTER_BYTE (regno), X register_size (current_gdbarch, regno)); X } X } X} X X/* Get ready to modify the registers array. On machines which store X individual registers, this doesn't need to do anything. On machines X which store all the registers in one fell swoop, this makes sure X that registers contains all the registers from the program being X debugged. */ X Xstatic void Xfreebsd_uthread_prepare_to_store (void) X{ X child_ops.to_prepare_to_store (); X} X Xstatic int Xfreebsd_uthread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, X int dowrite, struct mem_attrib *attrib, X struct target_ops *target) X{ X return child_ops.to_xfer_memory (memaddr, myaddr, len, dowrite, X attrib, target); X} X X/* Print status information about what we're accessing. */ X Xstatic void Xfreebsd_uthread_files_info (struct target_ops *ignore) X{ X child_ops.to_files_info (ignore); X} X Xstatic void Xfreebsd_uthread_kill_inferior (void) X{ X child_ops.to_kill (); X} X Xstatic void Xfreebsd_uthread_notice_signals (ptid_t ptid) X{ X child_ops.to_notice_signals (ptid); X} X X/* Fork an inferior process, and start debugging it with /proc. */ X Xstatic void Xfreebsd_uthread_create_inferior (char *exec_file, char *allargs, char **env, X int from_tty) X{ X child_ops.to_create_inferior (exec_file, allargs, env, from_tty); X X if (PIDGET(inferior_ptid) && freebsd_uthread_active) X { X read_thread_offsets (); X push_target (&freebsd_uthread_ops); X inferior_ptid = find_active_ptid (); X add_thread (inferior_ptid); X } X} X X/* This routine is called to find out if the inferior is using threads. X We check for the _thread_run and _thread_list globals. */ X Xvoid Xfreebsd_uthread_new_objfile (struct objfile *objfile) X{ X struct minimal_symbol *ms; X X if (!objfile) X { X freebsd_uthread_active = 0; X return; X } X X ms = lookup_minimal_symbol ("_thread_run", NULL, objfile); X X if (!ms) X return; X X P_thread_run = SYMBOL_VALUE_ADDRESS (ms); X X ms = lookup_minimal_symbol ("_thread_list", NULL, objfile); X X if (!ms) X return; X X P_thread_list = SYMBOL_VALUE_ADDRESS (ms); X X#define OFFSET_SYM(field) "_thread_" #field "_offset" X#define LOOKUP_OFFSET(field) \ X do { \ X ms = lookup_minimal_symbol (OFFSET_SYM(field), NULL, objfile); \ X if (!ms) \ X return; \ X P_thread_##field##_offset = SYMBOL_VALUE_ADDRESS (ms); \ X } while (0); X X#define VALUE_SYM(name) "_thread_" #name "_value" X#define LOOKUP_VALUE(name) \ X do { \ X ms = lookup_minimal_symbol (VALUE_SYM(name), NULL, objfile); \ X if (!ms) \ X return; \ X P_thread_##name##_value = SYMBOL_VALUE_ADDRESS (ms); \ X } while (0); X X LOOKUP_OFFSET(next); X LOOKUP_OFFSET(uniqueid); X LOOKUP_OFFSET(state); X LOOKUP_OFFSET(name); X LOOKUP_OFFSET(ctx); X X LOOKUP_VALUE(PS_RUNNING); X LOOKUP_VALUE(PS_DEAD); X X freebsd_uthread_active = 1; X} X X/* Clean up after the inferior dies. */ X Xstatic void Xfreebsd_uthread_mourn_inferior () X{ X child_ops.to_mourn_inferior (); X unpush_target (&freebsd_uthread_ops); X} X X/* Mark our target-struct as eligible for stray "run" and "attach" commands. */ X Xstatic int Xfreebsd_uthread_can_run () X{ X return child_suppress_run; X} X Xstatic int Xfreebsd_uthread_thread_alive (ptid_t ptid) X{ X struct cached_pthread *thread; X int ret = 0; X X if (freebsd_uthread_attaching) X return 1; X X /* X * We can get called from child_ops.to_wait() which passes the underlying X * pid (without a thread number). X */ X if (TIDGET(ptid) == 0) X return 1; X X if (find_pthread_addr (ptid) != 0) X { X thread = find_pthread (ptid); X ret = (thread->state != PS_DEAD_value); X } X X if (!ret) X free_ptid(ptid); X X return ret; X} X Xstatic void Xfreebsd_uthread_stop (void) X{ X child_ops.to_stop (); X} X Xstatic void Xfreebsd_uthread_find_new_threads (void) X{ X CORE_ADDR ptr; X int state; X u_int64_t uniqueid; X X read_memory ((CORE_ADDR)P_thread_list, X (char *)&ptr, X sizeof ptr); X X while (ptr != 0) X { X READ_FIELD(ptr, int, state, state); X READ_FIELD(ptr, u_int64_t, uniqueid, uniqueid); X if (state != PS_DEAD_value && X !in_thread_list (find_ptid(uniqueid))) X add_thread (find_ptid(uniqueid)); X ptr = read_pthread_next(ptr); X } X} X X/* MUST MATCH enum pthread_state */ Xstatic const char *statenames[] = { X "RUNNING", X "SIGTHREAD", X "MUTEX_WAIT", X "COND_WAIT", X "FDLR_WAIT", X "FDLW_WAIT", X "FDR_WAIT", X "FDW_WAIT", X "POLL_WAIT", X "FILE_WAIT", X "SELECT_WAIT", X "SLEEP_WAIT", X "WAIT_WAIT", X "SIGSUSPEND", X "SIGWAIT", X "SPINBLOCK", X "JOIN", X "SUSPENDED", X "DEAD", X "DEADLOCK", X}; X X#if 0 X Xstatic int Xfreebsd_uthread_get_thread_info (ref, selection, info) X gdb_threadref *ref; X int selection; X struct gdb_ext_thread_info *info; X{ X int pid = *ref; X struct cached_pthread *thread = find_pthread (pid); X struct cleanup *old_chain; X X old_chain = save_inferior_pid (); X inferior_pid = main_pid; X X memset(&info->threadid, 0, OPAQUETHREADBYTES); X X memcpy(&info->threadid, ref, sizeof *ref); X info->active = thread->state == PS_RUNNING_value; X strcpy(info->display, statenames[thread->state]); X if (thread->name) X read_memory ((CORE_ADDR) thread->name, info->shortname, 32); X else X strcpy(info->shortname, ""); X X do_cleanups (old_chain); X return (0); X} X X#endif X Xchar * Xfreebsd_uthread_pid_to_str (ptid_t ptid) X{ X static char buf[30]; X X if (DEPRECATED_STREQ (current_target.to_shortname, "freebsd-uthreads")) X sprintf (buf, "Process %d, Thread %ld", X PIDGET(ptid), TIDGET(ptid)); X else X sprintf (buf, "Process %d", PIDGET(ptid)); X X return buf; X} X X Xstatic void Xinit_freebsd_uthread_ops () X{ X freebsd_uthread_ops.to_shortname = "freebsd-uthreads"; X freebsd_uthread_ops.to_longname = "FreeBSD uthreads"; X freebsd_uthread_ops.to_doc = "FreeBSD user threads support."; X freebsd_uthread_ops.to_open = freebsd_uthread_open; X freebsd_uthread_ops.to_attach = freebsd_uthread_attach; X freebsd_uthread_ops.to_post_attach = freebsd_uthread_post_attach; X freebsd_uthread_ops.to_detach = freebsd_uthread_detach; X freebsd_uthread_ops.to_resume = freebsd_uthread_resume; X freebsd_uthread_ops.to_wait = freebsd_uthread_wait; X freebsd_uthread_ops.to_fetch_registers = freebsd_uthread_fetch_registers; X freebsd_uthread_ops.to_store_registers = freebsd_uthread_store_registers; X freebsd_uthread_ops.to_prepare_to_store = freebsd_uthread_prepare_to_store; X freebsd_uthread_ops.to_xfer_memory = freebsd_uthread_xfer_memory; X freebsd_uthread_ops.to_files_info = freebsd_uthread_files_info; X freebsd_uthread_ops.to_insert_breakpoint = memory_insert_breakpoint; X freebsd_uthread_ops.to_remove_breakpoint = memory_remove_breakpoint; X freebsd_uthread_ops.to_terminal_init = terminal_init_inferior; X freebsd_uthread_ops.to_terminal_inferior = terminal_inferior; X freebsd_uthread_ops.to_terminal_ours_for_output = terminal_ours_for_output; X freebsd_uthread_ops.to_terminal_ours = terminal_ours; X freebsd_uthread_ops.to_terminal_info = child_terminal_info; X freebsd_uthread_ops.to_kill = freebsd_uthread_kill_inferior; X freebsd_uthread_ops.to_create_inferior = freebsd_uthread_create_inferior; X freebsd_uthread_ops.to_mourn_inferior = freebsd_uthread_mourn_inferior; X freebsd_uthread_ops.to_can_run = freebsd_uthread_can_run; X freebsd_uthread_ops.to_notice_signals = freebsd_uthread_notice_signals; X freebsd_uthread_ops.to_thread_alive = freebsd_uthread_thread_alive; X freebsd_uthread_ops.to_stop = freebsd_uthread_stop; X freebsd_uthread_ops.to_stratum = process_stratum; X freebsd_uthread_ops.to_has_all_memory = 1; X freebsd_uthread_ops.to_has_memory = 1; X freebsd_uthread_ops.to_has_stack = 1; X freebsd_uthread_ops.to_has_registers = 1; X freebsd_uthread_ops.to_has_execution = 1; X freebsd_uthread_ops.to_has_thread_control = 0; X freebsd_uthread_ops.to_magic = OPS_MAGIC; X freebsd_uthread_ops.to_find_new_threads = freebsd_uthread_find_new_threads; X freebsd_uthread_ops.to_pid_to_str = freebsd_uthread_pid_to_str; X#if 0 X freebsd_uthread_vec.get_thread_info = freebsd_uthread_get_thread_info; X#endif X} X Xvoid X_initialize_freebsd_uthread () X{ X init_freebsd_uthread_ops (); X add_target (&freebsd_uthread_ops); X X target_new_objfile_chain = deprecated_target_new_objfile_hook; X deprecated_target_new_objfile_hook = freebsd_uthread_new_objfile; X X child_suppress_run = 1; X} END-of-gdb65/files/freebsd-uthread.c echo x - gdb65/files/patch-gdb-Makefile.in sed 's/^X//' >gdb65/files/patch-gdb-Makefile.in << 'END-of-gdb65/files/patch-gdb-Makefile.in' X--- gdb/Makefile.in.orig Mon Jul 10 23:49:02 2006 X+++ gdb/Makefile.in Mon Jul 10 23:50:38 2006 X@@ -122,10 +122,10 @@ X BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC) X X # Where is the READLINE library? Typically in ../readline. X-READLINE_DIR = ../readline X-READLINE = $(READLINE_DIR)/libreadline.a X-READLINE_SRC = $(srcdir)/$(READLINE_DIR) X-READLINE_CFLAGS = -I$(READLINE_SRC)/.. X+#READLINE_DIR = ../readline X+#READLINE = $(READLINE_DIR)/libreadline.a X+#READLINE_SRC = $(srcdir)/$(READLINE_DIR) X+#READLINE_CFLAGS = -I$(READLINE_SRC)/.. X X WARN_CFLAGS = @WARN_CFLAGS@ X WERROR_CFLAGS = @WERROR_CFLAGS@ X@@ -590,9 +590,9 @@ X demangle_h = $(INCLUDE_DIR)/demangle.h X obstack_h = $(INCLUDE_DIR)/obstack.h X opcode_m68hc11_h = $(INCLUDE_DIR)/opcode/m68hc11.h X-readline_h = $(READLINE_SRC)/readline.h X-readline_tilde_h = $(READLINE_SRC)/tilde.h X-readline_history_h = $(READLINE_SRC)/history.h X+#readline_h = $(READLINE_SRC)/readline.h X+#readline_tilde_h = $(READLINE_SRC)/tilde.h X+#readline_history_h = $(READLINE_SRC)/history.h X frv_desc_h = $(OPCODES_SRC)/frv-desc.h X sh_opc_h = $(OPCODES_SRC)/sh-opc.h X gdb_callback_h = $(INCLUDE_DIR)/gdb/callback.h X@@ -3171,3 +3171,4 @@ X $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-winsource.c X X ### end of the gdb Makefile.in. X+READLINE = -lreadline END-of-gdb65/files/patch-gdb-Makefile.in echo x - gdb65/files/nm-fbsd.h sed 's/^X//' >gdb65/files/nm-fbsd.h << 'END-of-gdb65/files/nm-fbsd.h' X#ifndef CONFIG_NM_FBSD_H X#define CONFIG_NM_FBSD_H X X/* $FreeBSD: ports/devel/gdb6/files/nm-fbsd.h,v 1.1 2004/05/13 04:28:38 obrien Exp $ */ X X#ifdef HAVE_SYS_PARAM_H X#include X#endif X Xextern int kernel_debugging; Xextern int kernel_writablecore; X XCORE_ADDR fbsd_kern_frame_saved_pc(struct frame_info *frame); X X#if __FreeBSD_version >= 500032 X#define KGDB 1 X#define ADDITIONAL_OPTIONS \ X {"kernel", no_argument, &kernel_debugging, 1}, \ X {"k", no_argument, &kernel_debugging, 1}, \ X {"wcore", no_argument, &kernel_writablecore, 1}, \ X {"w", no_argument, &kernel_writablecore, 1}, X X#define ADDITIONAL_OPTION_HELP \ X "\ X --kernel Enable kernel debugging.\n\ X --wcore Make core file writable (only works for /dev/mem).\n\ X This option only works while debugging a kernel !!\n\ X" X X#define DEFAULT_PROMPT kernel_debugging?"(kgdb) ":"(gdb) " X X/* misuse START_PROGRESS to test whether we're running as kgdb */ X/* START_PROGRESS is called at the top of main */ X#undef START_PROGRESS X#define START_PROGRESS(STR,N) \ X if (!strcmp (STR, "kgdb")) \ X kernel_debugging = 1; X#endif X#endif /* CONFIG_NM_FBSD_H */ END-of-gdb65/files/nm-fbsd.h echo x - gdb65/files/patch-gdb-version.in sed 's/^X//' >gdb65/files/patch-gdb-version.in << 'END-of-gdb65/files/patch-gdb-version.in' X--- gdb/version.in.orig Tue Jun 20 22:05:40 2006 X+++ gdb/version.in Mon Jul 10 23:17:58 2006 X@@ -1 +1 @@ X-6.5 X+6.5 [GDB v6.x for FreeBSD] END-of-gdb65/files/patch-gdb-version.in echo x - gdb65/pkg-plist sed 's/^X//' >gdb65/pkg-plist << 'END-of-gdb65/pkg-plist' X@comment $FreeBSD$ Xbin/gdb65 END-of-gdb65/pkg-plist exit --- gdb65.shar ends here --- >Release-Note: >Audit-Trail: Responsible-Changed-From-To: freebsd-ports-bugs->alepulver Responsible-Changed-By: alepulver Responsible-Changed-When: Sun Oct 1 15:56:15 UTC 2006 Responsible-Changed-Why: Take PR. http://www.freebsd.org/cgi/query-pr.cgi?pr=100067 State-Changed-From-To: open->feedback State-Changed-By: alepulver State-Changed-When: Sun Oct 1 17:57:41 UTC 2006 State-Changed-Why: Doesn't build. Ask submitter for a fix. http://www.freebsd.org/cgi/query-pr.cgi?pr=100067 From: Alejandro Pulver To: bug-followup@FreeBSD.org Cc: "Philip M. Gollucci" Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Sun, 1 Oct 2006 14:58:59 -0300 Hello. The port fails to build when CFLAGS is not set in /etc/make.conf (when default values are used). The log is available at: ftp://ftp.alepulver.com.ar/logs/gdb-6.5.log.bz2 Could you please submit a fix? Best Regards, Ale Responsible-Changed-From-To: alepulver->freebsd-ports-bugs Responsible-Changed-By: alepulver Responsible-Changed-When: Wed Nov 8 19:35:07 UTC 2006 Responsible-Changed-Why: Leave PR http://www.freebsd.org/cgi/query-pr.cgi?pr=100067 From: "Philip M. Gollucci" To: bug-followup@FreeBSD.org, pgollucci@p6m7g8.com Cc: Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Sun, 03 Dec 2006 04:48:25 -0800 This is a multi-part message in MIME format. --------------050805010408080704070803 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Fix attached. Its a hack. I can't for the life of me find that "space" issue. So I hacked/patched the prebuilt configure to just not do the check. This should be okay since its in the testsuite dir anyway which I guess we could have just skipped. Also, I should note, I forgot to say you should ask for a repo copy from devel/gdb6. -- ------------------------------------------------------------------------ Philip M. Gollucci (philip.gollucci@ticketmaster.com) 323.219.4708 Senior Software Engineer - TicketMaster - http://ticketmaster.com 1024D/A79997FA F357 0FDD 2301 6296 690F 6A47 D55A 7172 A799 97F --------------050805010408080704070803 Content-Type: text/plain; name="gdb65.shar" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gdb65.shar" # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # gdb65 # gdb65/Makefile # gdb65/distinfo # gdb65/pkg-descr # gdb65/files # gdb65/files/fbsd4.h # gdb65/files/freebsd-uthread.c # gdb65/files/patch-gdb-Makefile.in # gdb65/files/nm-fbsd.h # gdb65/files/patch-gdb-version.in # gdb65/files/patch-gdb-testsuite-configure # gdb65/pkg-plist # echo c - gdb65 mkdir -p gdb65 > /dev/null 2>&1 echo x - gdb65/Makefile sed 's/^X//' >gdb65/Makefile << 'END-of-gdb65/Makefile' X# ex:ts=8 X# Ports collection makefile for: GDB 6.5 X# Date created: 10 July 2006 X# Whom: Philip M. Gollucci X# X# $FreeBSD$ X# X XPORTNAME= gdb XPORTVERSION= 6.5 XCATEGORIES= devel XMASTER_SITES= ${MASTER_SITE_GNU} XMASTER_SITE_SUBDIR= gdb XDISTNAME= gdb-${PORTVERSION} X XMAINTAINER= pgollucci@p6m7g8.com XCOMMENT= GNU GDB 6.5 X XUSE_BZIP2= yes XGNU_CONFIGURE= yes XCONFIGURE_ARGS= --program-suffix=6.5 XCFLAGS+= -DRL_NO_COMPAT -DKGDB X X.include X X.if ${OSVERSION} < 500000 XCFLAGS+= -include ${FILESDIR}/fbsd4.h X.endif X X.if ${ARCH} == "amd64" XCONFIGURE_TARGET= x86_64-portbld-freebsd${OSREL} X.endif X Xpre-configure: X cd ${WRKSRC} ; ${RM} -rf dejagnu expect readline sim tcl texinfo X ${LN} -sf ${FILESDIR}/freebsd-uthread.c ${WRKSRC}/gdb/freebsd-uthread.c X ${LN} -sf ${FILESDIR}/nm-fbsd.h ${WRKSRC}/gdb/config X Xpost-configure: X ${PERL} -pi -ane 'next unless /CFLAGS/; s,\s+, ,g' ${WRKSRC}/config.status Xdo-install: X ${INSTALL_PROGRAM} ${WRKSRC}/gdb/gdb \ X ${PREFIX}/bin/${PORTNAME}${PORTVERSION:S/.//g} X Xc: X @${ECHO} ${CFLAGS} X.include END-of-gdb65/Makefile echo x - gdb65/distinfo sed 's/^X//' >gdb65/distinfo << 'END-of-gdb65/distinfo' XMD5 (gdb-6.5.tar.bz2) = af6c8335230d7604aee0803b1df14f54 XSHA256 (gdb-6.5.tar.bz2) = 0011318d9720781d486c835e88b915f90f2c10e7101d648b64dd4739218d3faf XSIZE (gdb-6.5.tar.bz2) = 14303558 END-of-gdb65/distinfo echo x - gdb65/pkg-descr sed 's/^X//' >gdb65/pkg-descr << 'END-of-gdb65/pkg-descr' XGNU GDB 6.5 X XWWW: http://www.gnu.org/software/gdb/bugs/ END-of-gdb65/pkg-descr echo c - gdb65/files mkdir -p gdb65/files > /dev/null 2>&1 echo x - gdb65/files/fbsd4.h sed 's/^X//' >gdb65/files/fbsd4.h << 'END-of-gdb65/files/fbsd4.h' X// $FreeBSD: ports/devel/gdb6/files/fbsd4.h,v 1.2 2005/03/11 04:52:49 obrien Exp $ X Xextern void _rl_set_screen_size (int, int); X X#define rl_set_screen_size _rl_set_screen_size X#define rl_filename_completion_function filename_completion_function X Xextern int screenwidth, screenheight; X Xstatic inline void Xrl_get_screen_size (int *rows, int *cols) X{ X if (rows) *rows = screenheight; X if (cols) *cols = screenwidth; X} X X#if 0 X#define savestring X#include X#undef savestring X#endif END-of-gdb65/files/fbsd4.h echo x - gdb65/files/freebsd-uthread.c sed 's/^X//' >gdb65/files/freebsd-uthread.c << 'END-of-gdb65/files/freebsd-uthread.c' X/* Low level interface for debugging FreeBSD user threads for GDB, the GNU debugger. X Copyright 1996, 1999 Free Software Foundation, Inc. X XThis file is part of GDB. X XThis program is free software; you can redistribute it and/or modify Xit under the terms of the GNU General Public License as published by Xthe Free Software Foundation; either version 2 of the License, or X(at your option) any later version. X XThis program is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY; without even the implied warranty of XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the XGNU General Public License for more details. X XYou should have received a copy of the GNU General Public License Xalong with this program; if not, write to the Free Software XFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ X X/* $FreeBSD: ports/devel/gdb6/files/freebsd-uthread.c,v 1.4 2004/10/20 19:37:48 obrien Exp $ */ X X/* This module implements a sort of half target that sits between the X machine-independent parts of GDB and the ptrace interface (infptrace.c) to X provide access to the FreeBSD user-mode thread implementation. X X FreeBSD threads are true user-mode threads, which are invoked via X the pthread_* interfaces. These are mostly implemented in X user-space, with all thread context kept in various structures that X live in the user's heap. For the most part, the kernel has no X knowlege of these threads. X X Based largely on hpux-thread.c X X */ X X X#include "defs.h" X#include X#include X#include X#include X#include "gdbthread.h" X#include "target.h" X#include "inferior.h" X#include X#include X#include X#include X#include "gdbcore.h" X#include "regcache.h" X Xextern int child_suppress_run; Xextern struct target_ops child_ops; /* target vector for inftarg.c */ X Xextern void _initialize_freebsd_uthread PARAMS ((void)); X X/* Set to true while we are part-way through attaching */ Xstatic int freebsd_uthread_attaching; X Xstatic int freebsd_uthread_active = 0; Xstatic CORE_ADDR P_thread_list; Xstatic CORE_ADDR P_thread_run; X X/* Pointer to the next function on the objfile event chain. */ Xstatic void (*target_new_objfile_chain) (struct objfile *objfile); X Xstatic void freebsd_uthread_resume PARAMS ((ptid_t pid, int step, X enum target_signal signo)); X Xstatic void init_freebsd_uthread_ops PARAMS ((void)); X Xstatic struct target_ops freebsd_uthread_ops; X Xstatic ptid_t find_active_ptid PARAMS ((void)); X Xstruct cached_pthread { X u_int64_t uniqueid; X int state; X CORE_ADDR name; X union { X ucontext_t uc; X jmp_buf jb; X } ctx; X}; X Xstatic ptid_t cached_ptid; Xstatic struct cached_pthread cached_pthread; Xstatic CORE_ADDR cached_pthread_addr; X XLIST_HEAD(idmaplist, idmap); X Xstruct idmap { X LIST_ENTRY(idmap) link; X u_int64_t uniqueid; X int tid; X}; X X#define MAPHASH_SIZE 257 X#define TID_MIN 1 X#define TID_MAX 16383 X Xstatic int tid_to_hash[TID_MAX + 1]; /* set to map_hash index */ Xstatic struct idmaplist map_hash[MAPHASH_SIZE]; Xstatic int next_free_tid = TID_MIN; /* first available tid */ Xstatic int last_free_tid = TID_MIN; /* first unavailable */ X Xstatic CORE_ADDR P_thread_next_offset; Xstatic CORE_ADDR P_thread_uniqueid_offset; Xstatic CORE_ADDR P_thread_state_offset; Xstatic CORE_ADDR P_thread_name_offset; Xstatic CORE_ADDR P_thread_ctx_offset; Xstatic CORE_ADDR P_thread_PS_RUNNING_value; Xstatic CORE_ADDR P_thread_PS_DEAD_value; X Xstatic int next_offset; Xstatic int uniqueid_offset; Xstatic int state_offset; Xstatic int name_offset; Xstatic int ctx_offset; Xstatic int PS_RUNNING_value; Xstatic int PS_DEAD_value; X X#define UNIQUEID_HASH(id) (id % MAPHASH_SIZE) X#define TID_ADD1(tid) (((tid) + 1) == TID_MAX + 1 \ X ? TID_MIN : (tid) + 1) X#define IS_TID_FREE(tid) (tid_to_hash[tid] == -1) X Xstatic int Xget_new_tid(int h) X{ X int tid = next_free_tid; X X tid_to_hash[tid] = h; X next_free_tid = TID_ADD1(next_free_tid); X if (next_free_tid == last_free_tid) X { X int i; X X for (i = last_free_tid; TID_ADD1(i) != last_free_tid; i = TID_ADD1(i)) X if (IS_TID_FREE(i)) X break; X if (TID_ADD1(i) == last_free_tid) X { X error("too many threads"); X return 0; X } X next_free_tid = i; X for (i = TID_ADD1(i); IS_TID_FREE(i); i = TID_ADD1(i)) X ; X last_free_tid = i; X } X X return tid; X} X Xstatic ptid_t Xfind_ptid(u_int64_t uniqueid) X{ X int h = UNIQUEID_HASH(uniqueid); X struct idmap *im; X X LIST_FOREACH(im, &map_hash[h], link) X if (im->uniqueid == uniqueid) X return MERGEPID(PIDGET(inferior_ptid), im->tid); X X im = xmalloc(sizeof(struct idmap)); X im->uniqueid = uniqueid; X im->tid = get_new_tid(h); X LIST_INSERT_HEAD(&map_hash[h], im, link); X X return MERGEPID(PIDGET(inferior_ptid), im->tid); X} X Xstatic void Xfree_ptid(ptid_t ptid) X{ X int tid = TIDGET(ptid); X int h = tid_to_hash[tid]; X struct idmap *im; X X if (!tid) return; X X LIST_FOREACH(im, &map_hash[h], link) X if (im->tid == tid) X break; X X if (!im) return; X X LIST_REMOVE(im, link); X tid_to_hash[tid] = -1; X free(im); X} X X#define READ_OFFSET(field) read_memory(P_thread_##field##_offset, \ X (char *) &field##_offset, \ X sizeof(field##_offset)) X X#define READ_VALUE(name) read_memory(P_thread_##name##_value, \ X (char *) &name##_value, \ X sizeof(name##_value)) X Xstatic void Xread_thread_offsets (void) X{ X READ_OFFSET(next); X READ_OFFSET(uniqueid); X READ_OFFSET(state); X READ_OFFSET(name); X READ_OFFSET(ctx); X X READ_VALUE(PS_RUNNING); X READ_VALUE(PS_DEAD); X} X X#define READ_FIELD(ptr, T, field, result) \ X read_memory ((ptr) + field##_offset, (char *) &(result), sizeof result) X Xstatic u_int64_t Xread_pthread_uniqueid (CORE_ADDR ptr) X{ X u_int64_t uniqueid; X READ_FIELD(ptr, u_int64_t, uniqueid, uniqueid); X return uniqueid; X} X Xstatic CORE_ADDR Xread_pthread_next (CORE_ADDR ptr) X{ X CORE_ADDR next; X READ_FIELD(ptr, CORE_ADDR, next, next); X return next; X} X Xstatic void Xread_cached_pthread (CORE_ADDR ptr, struct cached_pthread *cache) X{ X READ_FIELD(ptr, u_int64_t, uniqueid, cache->uniqueid); X READ_FIELD(ptr, int, state, cache->state); X READ_FIELD(ptr, CORE_ADDR, name, cache->name); X READ_FIELD(ptr, ucontext_t, ctx, cache->ctx); X} X Xstatic ptid_t Xfind_active_ptid (void) X{ X CORE_ADDR ptr; X X read_memory ((CORE_ADDR)P_thread_run, X (char *)&ptr, X sizeof ptr); X X return find_ptid(read_pthread_uniqueid(ptr)); X} X Xstatic CORE_ADDR find_pthread_addr PARAMS ((ptid_t ptid)); Xstatic struct cached_pthread * find_pthread PARAMS ((ptid_t ptid)); X Xstatic CORE_ADDR Xfind_pthread_addr (ptid_t ptid) X{ X CORE_ADDR ptr; X X if (ptid_equal(ptid, cached_ptid)) X return cached_pthread_addr; X X read_memory ((CORE_ADDR)P_thread_list, X (char *)&ptr, X sizeof ptr); X X while (ptr != 0) X { X if (ptid_equal(find_ptid(read_pthread_uniqueid(ptr)), ptid)) X { X cached_ptid = ptid; X cached_pthread_addr = ptr; X read_cached_pthread(ptr, &cached_pthread); X return ptr; X } X ptr = read_pthread_next(ptr); X } X X return NULL; X} X Xstatic struct cached_pthread * Xfind_pthread (ptid_t ptid) X{ X CORE_ADDR ptr; X X if (ptid_equal(ptid, cached_ptid)) X return &cached_pthread; X X read_memory ((CORE_ADDR)P_thread_list, X (char *)&ptr, X sizeof ptr); X X while (ptr != 0) X { X if (ptid_equal(find_ptid(read_pthread_uniqueid(ptr)), ptid)) X { X cached_ptid = ptid; X cached_pthread_addr = ptr; X read_cached_pthread(ptr, &cached_pthread); X return &cached_pthread; X } X ptr = read_pthread_next(ptr); X } X X#if 0 X error ("Can't find pthread %d,%d", PIDGET(ptid), TIDGET(ptid)); X#endif X return NULL; X} X X X/* Most target vector functions from here on actually just pass through to X inftarg.c, as they don't need to do anything specific for threads. */ X X/* ARGSUSED */ Xstatic void Xfreebsd_uthread_open (char *arg, int from_tty) X{ X child_ops.to_open (arg, from_tty); X} X X/* Attach to process PID, then initialize for debugging it X and wait for the trace-trap that results from attaching. */ X Xstatic void Xfreebsd_uthread_attach (char *args, int from_tty) X{ X child_ops.to_attach (args, from_tty); X push_target (&freebsd_uthread_ops); X freebsd_uthread_attaching = 1; X} X X/* After an attach, see if the target is threaded */ X Xstatic void Xfreebsd_uthread_post_attach (int pid) X{ X if (freebsd_uthread_active) X { X read_thread_offsets (); X inferior_ptid = find_active_ptid (); X add_thread (inferior_ptid); X } X else X { X unpush_target (&freebsd_uthread_ops); X push_target (&child_ops); X } X X freebsd_uthread_attaching = 0; X} X X/* Take a program previously attached to and detaches it. X The program resumes execution and will no longer stop X on signals, etc. We'd better not have left any breakpoints X in the program or it'll die when it hits one. For this X to work, it may be necessary for the process to have been X previously attached. It *might* work if the program was X started via the normal ptrace (PTRACE_TRACEME). */ X Xstatic void Xfreebsd_uthread_detach (char *args, int from_tty) X{ X child_ops.to_detach (args, from_tty); X} X X/* Resume execution of process PID. If STEP is nozero, then X just single step it. If SIGNAL is nonzero, restart it with that X signal activated. We may have to convert pid from a thread-id to an LWP id X for procfs. */ X Xstatic void Xfreebsd_uthread_resume (ptid_t ptid, int step, enum target_signal signo) X{ X if (freebsd_uthread_attaching) X { X child_ops.to_resume (ptid, step, signo); X return; X } X X child_ops.to_resume (ptid, step, signo); X cached_ptid = MERGEPID(0, 0); X} X X/* Wait for any threads to stop. We may have to convert PID from a thread id X to a LWP id, and vice versa on the way out. */ X Xstatic ptid_t Xfreebsd_uthread_wait (ptid_t ptid, struct target_waitstatus *ourstatus) X{ X ptid_t rtnval; X X if (freebsd_uthread_attaching) X { X return child_ops.to_wait (ptid, ourstatus); X } X X rtnval = child_ops.to_wait (ptid, ourstatus); X X if (PIDGET(rtnval) >= 0) X { X rtnval = find_active_ptid (); X if (!in_thread_list (rtnval)) X add_thread (rtnval); X } X X return rtnval; X} X X/* XXX: this needs to be selected by target, not [build] host */ X#ifdef __i386__ X X#include "i386-tdep.h" X Xstatic char sigmap[I386_SSE_NUM_REGS] = /* map reg to sigcontext */ X{ X 12, /* eax */ X 11, /* ecx */ X 10, /* edx */ X 9, /* ebx */ X 8, /* esp */ X 7, /* ebp */ X 6, /* esi */ X 5, /* edi */ X 15, /* eip */ X 17, /* eflags */ X 16, /* cs */ X 19, /* ss */ X 4, /* ds */ X 3, /* es */ X 2, /* fs */ X 1, /* gs */ X -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ X -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ X -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ X -1, /* mxcsr */ X}; X Xstatic char jmpmap[I386_SSE_NUM_REGS] = /* map reg to jmp_buf */ X{ X 6, /* eax */ X -1, /* ecx */ X -1, /* edx */ X 1, /* ebx */ X 2, /* esp */ X 3, /* ebp */ X 4, /* esi */ X 5, /* edi */ X 0, /* eip */ X -1, /* eflags */ X -1, /* cs */ X -1, /* ss */ X -1, /* ds */ X -1, /* es */ X -1, /* fs */ X -1, /* gs */ X -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ X -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ X -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ X -1, /* mxcsr */ X}; X X#endif X X#ifdef __amd64__ X X#include "amd64-tdep.h" X X// XXX:DEO not fully ported from i386 yet!! X Xstatic char sigmap[AMD64_NUM_REGS_TOTAL] = /* map reg to sigcontext */ X{ X 12, /* rax */ X 11, /* rcx */ X 10, /* rdx */ X 9, /* rbx */ X 8, /* rsp */ X 7, /* rbp */ X 6, /* rsi */ X 5, /* rdi */ X 15, /* rip */ X 17, /* rflags */ X 16, /* cs */ X 19, /* ss */ X 4, /* ds */ X 3, /* es */ X 2, /* fs */ X 1, /* gs */ X -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ X -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ X -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ X -1, /* mxcsr */ X}; X Xstatic char jmpmap[AMD64_NUM_REGS_TOTAL] = /* map reg to jmp_buf */ X{ X 6, /* rax */ X -1, /* rcx */ X -1, /* rdx */ X 1, /* rbx */ X 2, /* rsp */ X 3, /* rbp */ X 4, /* rsi */ X 5, /* rdi */ X 0, /* rip */ X -1, /* rflags */ X -1, /* cs */ X -1, /* ss */ X -1, /* ds */ X -1, /* es */ X -1, /* fs */ X -1, /* gs */ X -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ X -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ X -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ X -1, /* mxcsr */ X}; X X#endif X X#ifdef __alpha__ X X#include "alpha-tdep.h" X Xstatic char sigmap[ALPHA_NUM_REGS] = /* map reg to sigcontext */ X{ X 1, 2, 3, 4, 5, 6, 7, 8, /* v0 - t6 */ X 9, 10, 11, 12, 13, 14, 15, 16, /* t7 - fp */ X 17, 18, 19, 20, 21, 22, 23, 24, /* a0 - t9 */ X 25, 26, 27, 28, 29, 30, 31, 32, /* t10 - zero */ X 38, 39, 40, 41, 42, 43, 44, 45, /* f0 - f7 */ X 46, 47, 48, 49, 50, 51, 52, 53, /* f8 - f15 */ X 54, 55, 56, 57, 58, 59, 60, 61, /* f16 - f23 */ X 62, 63, 64, 65, 66, 67, 68, 69, /* f24 - f31 */ X 33, -1 /* pc, vfp */ X}; Xstatic char jmpmap[ALPHA_NUM_REGS] = { X 4, 5, 6, 7, 8, 9, 10, 11, /* v0 - t6 */ X 12, 13, 14, 15, 16, 17, 18, 19, /* t7 - fp */ X 20, 21, 22, 23, 24, 25, 26, 27, /* a0 - t9 */ X 28, 29, 30, 31, 32, 33, 34, 35, /* t10 - zero */ X 37, 38, 39, 40, 41, 42, 43, 44, /* f0 - f7 */ X 45, 46, 47, 48, 49, 50, 51, 52, /* f8 - f15 */ X 53, 54, 55, 56, 57, 58, 59, 60, /* f16 - f23 */ X 61, 62, 63, 64, 65, 66, 67, 68, /* f24 - f31 */ X 2, -1, /* pc, vfp */ X}; X X#endif X X#ifdef __sparc64__ X Xstatic char sigmap[125] = /* map reg to sigcontext */ X{ X -1 X}; Xstatic char jmpmap[125] = { X -1 X}; X X#endif X Xstatic void Xfreebsd_uthread_fetch_registers (int regno) X{ X struct cached_pthread *thread; X int active; X int first_regno, last_regno; X register_t *regbase; X char *regmap; X X if (freebsd_uthread_attaching || TIDGET(inferior_ptid) == 0) X { X child_ops.to_fetch_registers (regno); X return; X } X X thread = find_pthread (inferior_ptid); X active = (ptid_equal(inferior_ptid, find_active_ptid())); X X if (active) X { X child_ops.to_fetch_registers (regno); X return; X } X X if (regno == -1) X { X first_regno = 0; X last_regno = NUM_REGS - 1; X } X else X { X first_regno = regno; X last_regno = regno; X } X X regbase = (register_t*) &thread->ctx.jb[0]; X regmap = jmpmap; X X for (regno = first_regno; regno <= last_regno; regno++) X { X if (regmap[regno] == -1) X child_ops.to_fetch_registers (regno); X else X if (thread) X regcache_raw_supply (current_regcache, regno, (char*) ®base[regmap[regno]]); X else X regcache_raw_supply (current_regcache, regno, NULL); X } X} X Xstatic void Xfreebsd_uthread_store_registers (int regno) X{ X struct cached_pthread *thread; X CORE_ADDR ptr; X int first_regno, last_regno; X u_int32_t *regbase; X char *regmap; X X if (freebsd_uthread_attaching) X { X child_ops.to_store_registers (regno); X return; X } X X thread = find_pthread (inferior_ptid); X X if (thread->state == PS_RUNNING_value) X { X child_ops.to_store_registers (regno); X return; X } X X if (regno == -1) X { X first_regno = 0; X last_regno = NUM_REGS - 1; X } X else X { X first_regno = regno; X last_regno = regno; X } X X regbase = (u_int32_t*) &thread->ctx.jb[0]; X regmap = jmpmap; X X ptr = find_pthread_addr (inferior_ptid); X for (regno = first_regno; regno <= last_regno; regno++) X { X if (regmap[regno] == -1) X child_ops.to_store_registers (regno); X else X { X u_int32_t *reg = ®base[regmap[regno]]; X int off; X X /* Hang onto cached value */ X/*DEO:XXX*/ X memcpy(reg, deprecated_registers /*regcache_collect ()*/+ DEPRECATED_REGISTER_BYTE (regno), X register_size (current_gdbarch, regno)); X X /* And push out to inferior */ X off = (char *) reg - (char *) thread; X write_memory (ptr + off, X/*DEO:XXX*/ X deprecated_registers /*regcache_collect ()*/+ DEPRECATED_REGISTER_BYTE (regno), X register_size (current_gdbarch, regno)); X } X } X} X X/* Get ready to modify the registers array. On machines which store X individual registers, this doesn't need to do anything. On machines X which store all the registers in one fell swoop, this makes sure X that registers contains all the registers from the program being X debugged. */ X Xstatic void Xfreebsd_uthread_prepare_to_store (void) X{ X child_ops.to_prepare_to_store (); X} X Xstatic int Xfreebsd_uthread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, X int dowrite, struct mem_attrib *attrib, X struct target_ops *target) X{ X return child_ops.to_xfer_memory (memaddr, myaddr, len, dowrite, X attrib, target); X} X X/* Print status information about what we're accessing. */ X Xstatic void Xfreebsd_uthread_files_info (struct target_ops *ignore) X{ X child_ops.to_files_info (ignore); X} X Xstatic void Xfreebsd_uthread_kill_inferior (void) X{ X child_ops.to_kill (); X} X Xstatic void Xfreebsd_uthread_notice_signals (ptid_t ptid) X{ X child_ops.to_notice_signals (ptid); X} X X/* Fork an inferior process, and start debugging it with /proc. */ X Xstatic void Xfreebsd_uthread_create_inferior (char *exec_file, char *allargs, char **env, X int from_tty) X{ X child_ops.to_create_inferior (exec_file, allargs, env, from_tty); X X if (PIDGET(inferior_ptid) && freebsd_uthread_active) X { X read_thread_offsets (); X push_target (&freebsd_uthread_ops); X inferior_ptid = find_active_ptid (); X add_thread (inferior_ptid); X } X} X X/* This routine is called to find out if the inferior is using threads. X We check for the _thread_run and _thread_list globals. */ X Xvoid Xfreebsd_uthread_new_objfile (struct objfile *objfile) X{ X struct minimal_symbol *ms; X X if (!objfile) X { X freebsd_uthread_active = 0; X return; X } X X ms = lookup_minimal_symbol ("_thread_run", NULL, objfile); X X if (!ms) X return; X X P_thread_run = SYMBOL_VALUE_ADDRESS (ms); X X ms = lookup_minimal_symbol ("_thread_list", NULL, objfile); X X if (!ms) X return; X X P_thread_list = SYMBOL_VALUE_ADDRESS (ms); X X#define OFFSET_SYM(field) "_thread_" #field "_offset" X#define LOOKUP_OFFSET(field) \ X do { \ X ms = lookup_minimal_symbol (OFFSET_SYM(field), NULL, objfile); \ X if (!ms) \ X return; \ X P_thread_##field##_offset = SYMBOL_VALUE_ADDRESS (ms); \ X } while (0); X X#define VALUE_SYM(name) "_thread_" #name "_value" X#define LOOKUP_VALUE(name) \ X do { \ X ms = lookup_minimal_symbol (VALUE_SYM(name), NULL, objfile); \ X if (!ms) \ X return; \ X P_thread_##name##_value = SYMBOL_VALUE_ADDRESS (ms); \ X } while (0); X X LOOKUP_OFFSET(next); X LOOKUP_OFFSET(uniqueid); X LOOKUP_OFFSET(state); X LOOKUP_OFFSET(name); X LOOKUP_OFFSET(ctx); X X LOOKUP_VALUE(PS_RUNNING); X LOOKUP_VALUE(PS_DEAD); X X freebsd_uthread_active = 1; X} X X/* Clean up after the inferior dies. */ X Xstatic void Xfreebsd_uthread_mourn_inferior () X{ X child_ops.to_mourn_inferior (); X unpush_target (&freebsd_uthread_ops); X} X X/* Mark our target-struct as eligible for stray "run" and "attach" commands. */ X Xstatic int Xfreebsd_uthread_can_run () X{ X return child_suppress_run; X} X Xstatic int Xfreebsd_uthread_thread_alive (ptid_t ptid) X{ X struct cached_pthread *thread; X int ret = 0; X X if (freebsd_uthread_attaching) X return 1; X X /* X * We can get called from child_ops.to_wait() which passes the underlying X * pid (without a thread number). X */ X if (TIDGET(ptid) == 0) X return 1; X X if (find_pthread_addr (ptid) != 0) X { X thread = find_pthread (ptid); X ret = (thread->state != PS_DEAD_value); X } X X if (!ret) X free_ptid(ptid); X X return ret; X} X Xstatic void Xfreebsd_uthread_stop (void) X{ X child_ops.to_stop (); X} X Xstatic void Xfreebsd_uthread_find_new_threads (void) X{ X CORE_ADDR ptr; X int state; X u_int64_t uniqueid; X X read_memory ((CORE_ADDR)P_thread_list, X (char *)&ptr, X sizeof ptr); X X while (ptr != 0) X { X READ_FIELD(ptr, int, state, state); X READ_FIELD(ptr, u_int64_t, uniqueid, uniqueid); X if (state != PS_DEAD_value && X !in_thread_list (find_ptid(uniqueid))) X add_thread (find_ptid(uniqueid)); X ptr = read_pthread_next(ptr); X } X} X X/* MUST MATCH enum pthread_state */ Xstatic const char *statenames[] = { X "RUNNING", X "SIGTHREAD", X "MUTEX_WAIT", X "COND_WAIT", X "FDLR_WAIT", X "FDLW_WAIT", X "FDR_WAIT", X "FDW_WAIT", X "POLL_WAIT", X "FILE_WAIT", X "SELECT_WAIT", X "SLEEP_WAIT", X "WAIT_WAIT", X "SIGSUSPEND", X "SIGWAIT", X "SPINBLOCK", X "JOIN", X "SUSPENDED", X "DEAD", X "DEADLOCK", X}; X X#if 0 X Xstatic int Xfreebsd_uthread_get_thread_info (ref, selection, info) X gdb_threadref *ref; X int selection; X struct gdb_ext_thread_info *info; X{ X int pid = *ref; X struct cached_pthread *thread = find_pthread (pid); X struct cleanup *old_chain; X X old_chain = save_inferior_pid (); X inferior_pid = main_pid; X X memset(&info->threadid, 0, OPAQUETHREADBYTES); X X memcpy(&info->threadid, ref, sizeof *ref); X info->active = thread->state == PS_RUNNING_value; X strcpy(info->display, statenames[thread->state]); X if (thread->name) X read_memory ((CORE_ADDR) thread->name, info->shortname, 32); X else X strcpy(info->shortname, ""); X X do_cleanups (old_chain); X return (0); X} X X#endif X Xchar * Xfreebsd_uthread_pid_to_str (ptid_t ptid) X{ X static char buf[30]; X X if (DEPRECATED_STREQ (current_target.to_shortname, "freebsd-uthreads")) X sprintf (buf, "Process %d, Thread %ld", X PIDGET(ptid), TIDGET(ptid)); X else X sprintf (buf, "Process %d", PIDGET(ptid)); X X return buf; X} X X Xstatic void Xinit_freebsd_uthread_ops () X{ X freebsd_uthread_ops.to_shortname = "freebsd-uthreads"; X freebsd_uthread_ops.to_longname = "FreeBSD uthreads"; X freebsd_uthread_ops.to_doc = "FreeBSD user threads support."; X freebsd_uthread_ops.to_open = freebsd_uthread_open; X freebsd_uthread_ops.to_attach = freebsd_uthread_attach; X freebsd_uthread_ops.to_post_attach = freebsd_uthread_post_attach; X freebsd_uthread_ops.to_detach = freebsd_uthread_detach; X freebsd_uthread_ops.to_resume = freebsd_uthread_resume; X freebsd_uthread_ops.to_wait = freebsd_uthread_wait; X freebsd_uthread_ops.to_fetch_registers = freebsd_uthread_fetch_registers; X freebsd_uthread_ops.to_store_registers = freebsd_uthread_store_registers; X freebsd_uthread_ops.to_prepare_to_store = freebsd_uthread_prepare_to_store; X freebsd_uthread_ops.to_xfer_memory = freebsd_uthread_xfer_memory; X freebsd_uthread_ops.to_files_info = freebsd_uthread_files_info; X freebsd_uthread_ops.to_insert_breakpoint = memory_insert_breakpoint; X freebsd_uthread_ops.to_remove_breakpoint = memory_remove_breakpoint; X freebsd_uthread_ops.to_terminal_init = terminal_init_inferior; X freebsd_uthread_ops.to_terminal_inferior = terminal_inferior; X freebsd_uthread_ops.to_terminal_ours_for_output = terminal_ours_for_output; X freebsd_uthread_ops.to_terminal_ours = terminal_ours; X freebsd_uthread_ops.to_terminal_info = child_terminal_info; X freebsd_uthread_ops.to_kill = freebsd_uthread_kill_inferior; X freebsd_uthread_ops.to_create_inferior = freebsd_uthread_create_inferior; X freebsd_uthread_ops.to_mourn_inferior = freebsd_uthread_mourn_inferior; X freebsd_uthread_ops.to_can_run = freebsd_uthread_can_run; X freebsd_uthread_ops.to_notice_signals = freebsd_uthread_notice_signals; X freebsd_uthread_ops.to_thread_alive = freebsd_uthread_thread_alive; X freebsd_uthread_ops.to_stop = freebsd_uthread_stop; X freebsd_uthread_ops.to_stratum = process_stratum; X freebsd_uthread_ops.to_has_all_memory = 1; X freebsd_uthread_ops.to_has_memory = 1; X freebsd_uthread_ops.to_has_stack = 1; X freebsd_uthread_ops.to_has_registers = 1; X freebsd_uthread_ops.to_has_execution = 1; X freebsd_uthread_ops.to_has_thread_control = 0; X freebsd_uthread_ops.to_magic = OPS_MAGIC; X freebsd_uthread_ops.to_find_new_threads = freebsd_uthread_find_new_threads; X freebsd_uthread_ops.to_pid_to_str = freebsd_uthread_pid_to_str; X#if 0 X freebsd_uthread_vec.get_thread_info = freebsd_uthread_get_thread_info; X#endif X} X Xvoid X_initialize_freebsd_uthread () X{ X init_freebsd_uthread_ops (); X add_target (&freebsd_uthread_ops); X X target_new_objfile_chain = deprecated_target_new_objfile_hook; X deprecated_target_new_objfile_hook = freebsd_uthread_new_objfile; X X child_suppress_run = 1; X} END-of-gdb65/files/freebsd-uthread.c echo x - gdb65/files/patch-gdb-Makefile.in sed 's/^X//' >gdb65/files/patch-gdb-Makefile.in << 'END-of-gdb65/files/patch-gdb-Makefile.in' X--- gdb/Makefile.in.orig Mon Jul 10 23:49:02 2006 X+++ gdb/Makefile.in Mon Jul 10 23:50:38 2006 X@@ -122,10 +122,10 @@ X BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC) X X # Where is the READLINE library? Typically in ../readline. X-READLINE_DIR = ../readline X-READLINE = $(READLINE_DIR)/libreadline.a X-READLINE_SRC = $(srcdir)/$(READLINE_DIR) X-READLINE_CFLAGS = -I$(READLINE_SRC)/.. X+#READLINE_DIR = ../readline X+#READLINE = $(READLINE_DIR)/libreadline.a X+#READLINE_SRC = $(srcdir)/$(READLINE_DIR) X+#READLINE_CFLAGS = -I$(READLINE_SRC)/.. X X WARN_CFLAGS = @WARN_CFLAGS@ X WERROR_CFLAGS = @WERROR_CFLAGS@ X@@ -590,9 +590,9 @@ X demangle_h = $(INCLUDE_DIR)/demangle.h X obstack_h = $(INCLUDE_DIR)/obstack.h X opcode_m68hc11_h = $(INCLUDE_DIR)/opcode/m68hc11.h X-readline_h = $(READLINE_SRC)/readline.h X-readline_tilde_h = $(READLINE_SRC)/tilde.h X-readline_history_h = $(READLINE_SRC)/history.h X+#readline_h = $(READLINE_SRC)/readline.h X+#readline_tilde_h = $(READLINE_SRC)/tilde.h X+#readline_history_h = $(READLINE_SRC)/history.h X frv_desc_h = $(OPCODES_SRC)/frv-desc.h X sh_opc_h = $(OPCODES_SRC)/sh-opc.h X gdb_callback_h = $(INCLUDE_DIR)/gdb/callback.h X@@ -3171,3 +3171,4 @@ X $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-winsource.c X X ### end of the gdb Makefile.in. X+READLINE = -lreadline END-of-gdb65/files/patch-gdb-Makefile.in echo x - gdb65/files/nm-fbsd.h sed 's/^X//' >gdb65/files/nm-fbsd.h << 'END-of-gdb65/files/nm-fbsd.h' X#ifndef CONFIG_NM_FBSD_H X#define CONFIG_NM_FBSD_H X X/* $FreeBSD: ports/devel/gdb6/files/nm-fbsd.h,v 1.1 2004/05/13 04:28:38 obrien Exp $ */ X X#ifdef HAVE_SYS_PARAM_H X#include X#endif X Xextern int kernel_debugging; Xextern int kernel_writablecore; X XCORE_ADDR fbsd_kern_frame_saved_pc(struct frame_info *frame); X X#if __FreeBSD_version >= 500032 X#define KGDB 1 X#define ADDITIONAL_OPTIONS \ X {"kernel", no_argument, &kernel_debugging, 1}, \ X {"k", no_argument, &kernel_debugging, 1}, \ X {"wcore", no_argument, &kernel_writablecore, 1}, \ X {"w", no_argument, &kernel_writablecore, 1}, X X#define ADDITIONAL_OPTION_HELP \ X "\ X --kernel Enable kernel debugging.\n\ X --wcore Make core file writable (only works for /dev/mem).\n\ X This option only works while debugging a kernel !!\n\ X" X X#define DEFAULT_PROMPT kernel_debugging?"(kgdb) ":"(gdb) " X X/* misuse START_PROGRESS to test whether we're running as kgdb */ X/* START_PROGRESS is called at the top of main */ X#undef START_PROGRESS X#define START_PROGRESS(STR,N) \ X if (!strcmp (STR, "kgdb")) \ X kernel_debugging = 1; X#endif X#endif /* CONFIG_NM_FBSD_H */ END-of-gdb65/files/nm-fbsd.h echo x - gdb65/files/patch-gdb-version.in sed 's/^X//' >gdb65/files/patch-gdb-version.in << 'END-of-gdb65/files/patch-gdb-version.in' X--- gdb/version.in.orig Tue Jun 20 22:05:40 2006 X+++ gdb/version.in Mon Jul 10 23:17:58 2006 X@@ -1 +1 @@ X-6.5 X+6.5 [GDB v6.x for FreeBSD] END-of-gdb65/files/patch-gdb-version.in echo x - gdb65/files/patch-gdb-testsuite-configure sed 's/^X//' >gdb65/files/patch-gdb-testsuite-configure << 'END-of-gdb65/files/patch-gdb-testsuite-configure' X--- gdb/testsuite/configure.orig Sun Dec 3 04:06:15 2006 X+++ gdb/testsuite/configure Sun Dec 3 04:06:51 2006 X@@ -1247,16 +1247,6 @@ X echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} X ac_cache_corrupted=: ;; X ,);; X- *) X- if test "x$ac_old_val" != "x$ac_new_val"; then X- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 X-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} X- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 X-echo "$as_me: former value: $ac_old_val" >&2;} X- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 X-echo "$as_me: current value: $ac_new_val" >&2;} X- ac_cache_corrupted=: X- fi;; X esac X # Pass precious variables to config.status. X if test "$ac_new_set" = set; then END-of-gdb65/files/patch-gdb-testsuite-configure echo x - gdb65/pkg-plist sed 's/^X//' >gdb65/pkg-plist << 'END-of-gdb65/pkg-plist' X@comment $FreeBSD$ Xbin/gdb65 END-of-gdb65/pkg-plist exit --------------050805010408080704070803-- From: "Philip M. Gollucci" To: bug-followup@freebsd.org, pgollucci@p6m7g8.com Cc: Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Sun, 03 Dec 2006 04:17:39 -0800 This is a multi-part message in MIME format. --------------020208080303000907060007 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Fix attached. Its a hack. I can't for the life of me find that "space" issue. So I hacked/patched the prebuilt configure to just not do the check. This should be okay since its in the testsuite dir anyway which I guess we could have just skipped. Also, I should note, I forgot to say you should ask for a repo copy from devel/gdb6. -- ------------------------------------------------------------------------ Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708 Consultant / http://p6m7g8.net/Resume/resume.shtml Senior Software Engineer - TicketMaster - http://ticketmaster.com 1024D/EC88A0BF 0DE5 C55C 6BF3 B235 2DAB B89E 1324 9B4F EC88 A0BF I never had a dream come true 'Til the day that I found you. Even though I pretend that I've moved on You'll always be my baby. I never found the words to say You're the one I think about each day And I know no matter where life takes me to A part of me will always be... A part of me will always be with you. --------------020208080303000907060007 Content-Type: text/plain; name="gdb65.shar" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gdb65.shar" # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # gdb65 # gdb65/Makefile # gdb65/distinfo # gdb65/pkg-descr # gdb65/files # gdb65/files/fbsd4.h # gdb65/files/freebsd-uthread.c # gdb65/files/patch-gdb-Makefile.in # gdb65/files/nm-fbsd.h # gdb65/files/patch-gdb-version.in # gdb65/files/patch-gdb-testsuite-configure # gdb65/pkg-plist # echo c - gdb65 mkdir -p gdb65 > /dev/null 2>&1 echo x - gdb65/Makefile sed 's/^X//' >gdb65/Makefile << 'END-of-gdb65/Makefile' X# ex:ts=8 X# Ports collection makefile for: GDB 6.5 X# Date created: 10 July 2006 X# Whom: Philip M. Gollucci X# X# $FreeBSD$ X# X XPORTNAME= gdb XPORTVERSION= 6.5 XCATEGORIES= devel XMASTER_SITES= ${MASTER_SITE_GNU} XMASTER_SITE_SUBDIR= gdb XDISTNAME= gdb-${PORTVERSION} X XMAINTAINER= pgollucci@p6m7g8.com XCOMMENT= GNU GDB 6.5 X XUSE_BZIP2= yes XGNU_CONFIGURE= yes XCONFIGURE_ARGS= --program-suffix=6.5 XCFLAGS+= -DRL_NO_COMPAT -DKGDB X X.include X X.if ${OSVERSION} < 500000 XCFLAGS+= -include ${FILESDIR}/fbsd4.h X.endif X X.if ${ARCH} == "amd64" XCONFIGURE_TARGET= x86_64-portbld-freebsd${OSREL} X.endif X Xpre-configure: X cd ${WRKSRC} ; ${RM} -rf dejagnu expect readline sim tcl texinfo X ${LN} -sf ${FILESDIR}/freebsd-uthread.c ${WRKSRC}/gdb/freebsd-uthread.c X ${LN} -sf ${FILESDIR}/nm-fbsd.h ${WRKSRC}/gdb/config X Xpost-configure: X ${PERL} -pi -ane 'next unless /CFLAGS/; s,\s+, ,g' ${WRKSRC}/config.status Xdo-install: X ${INSTALL_PROGRAM} ${WRKSRC}/gdb/gdb \ X ${PREFIX}/bin/${PORTNAME}${PORTVERSION:S/.//g} X Xc: X @${ECHO} ${CFLAGS} X.include END-of-gdb65/Makefile echo x - gdb65/distinfo sed 's/^X//' >gdb65/distinfo << 'END-of-gdb65/distinfo' XMD5 (gdb-6.5.tar.bz2) = af6c8335230d7604aee0803b1df14f54 XSHA256 (gdb-6.5.tar.bz2) = 0011318d9720781d486c835e88b915f90f2c10e7101d648b64dd4739218d3faf XSIZE (gdb-6.5.tar.bz2) = 14303558 END-of-gdb65/distinfo echo x - gdb65/pkg-descr sed 's/^X//' >gdb65/pkg-descr << 'END-of-gdb65/pkg-descr' XGNU GDB 6.5 X XWWW: http://www.gnu.org/software/gdb/bugs/ END-of-gdb65/pkg-descr echo c - gdb65/files mkdir -p gdb65/files > /dev/null 2>&1 echo x - gdb65/files/fbsd4.h sed 's/^X//' >gdb65/files/fbsd4.h << 'END-of-gdb65/files/fbsd4.h' X// $FreeBSD: ports/devel/gdb6/files/fbsd4.h,v 1.2 2005/03/11 04:52:49 obrien Exp $ X Xextern void _rl_set_screen_size (int, int); X X#define rl_set_screen_size _rl_set_screen_size X#define rl_filename_completion_function filename_completion_function X Xextern int screenwidth, screenheight; X Xstatic inline void Xrl_get_screen_size (int *rows, int *cols) X{ X if (rows) *rows = screenheight; X if (cols) *cols = screenwidth; X} X X#if 0 X#define savestring X#include X#undef savestring X#endif END-of-gdb65/files/fbsd4.h echo x - gdb65/files/freebsd-uthread.c sed 's/^X//' >gdb65/files/freebsd-uthread.c << 'END-of-gdb65/files/freebsd-uthread.c' X/* Low level interface for debugging FreeBSD user threads for GDB, the GNU debugger. X Copyright 1996, 1999 Free Software Foundation, Inc. X XThis file is part of GDB. X XThis program is free software; you can redistribute it and/or modify Xit under the terms of the GNU General Public License as published by Xthe Free Software Foundation; either version 2 of the License, or X(at your option) any later version. X XThis program is distributed in the hope that it will be useful, Xbut WITHOUT ANY WARRANTY; without even the implied warranty of XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the XGNU General Public License for more details. X XYou should have received a copy of the GNU General Public License Xalong with this program; if not, write to the Free Software XFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ X X/* $FreeBSD: ports/devel/gdb6/files/freebsd-uthread.c,v 1.4 2004/10/20 19:37:48 obrien Exp $ */ X X/* This module implements a sort of half target that sits between the X machine-independent parts of GDB and the ptrace interface (infptrace.c) to X provide access to the FreeBSD user-mode thread implementation. X X FreeBSD threads are true user-mode threads, which are invoked via X the pthread_* interfaces. These are mostly implemented in X user-space, with all thread context kept in various structures that X live in the user's heap. For the most part, the kernel has no X knowlege of these threads. X X Based largely on hpux-thread.c X X */ X X X#include "defs.h" X#include X#include X#include X#include X#include "gdbthread.h" X#include "target.h" X#include "inferior.h" X#include X#include X#include X#include X#include "gdbcore.h" X#include "regcache.h" X Xextern int child_suppress_run; Xextern struct target_ops child_ops; /* target vector for inftarg.c */ X Xextern void _initialize_freebsd_uthread PARAMS ((void)); X X/* Set to true while we are part-way through attaching */ Xstatic int freebsd_uthread_attaching; X Xstatic int freebsd_uthread_active = 0; Xstatic CORE_ADDR P_thread_list; Xstatic CORE_ADDR P_thread_run; X X/* Pointer to the next function on the objfile event chain. */ Xstatic void (*target_new_objfile_chain) (struct objfile *objfile); X Xstatic void freebsd_uthread_resume PARAMS ((ptid_t pid, int step, X enum target_signal signo)); X Xstatic void init_freebsd_uthread_ops PARAMS ((void)); X Xstatic struct target_ops freebsd_uthread_ops; X Xstatic ptid_t find_active_ptid PARAMS ((void)); X Xstruct cached_pthread { X u_int64_t uniqueid; X int state; X CORE_ADDR name; X union { X ucontext_t uc; X jmp_buf jb; X } ctx; X}; X Xstatic ptid_t cached_ptid; Xstatic struct cached_pthread cached_pthread; Xstatic CORE_ADDR cached_pthread_addr; X XLIST_HEAD(idmaplist, idmap); X Xstruct idmap { X LIST_ENTRY(idmap) link; X u_int64_t uniqueid; X int tid; X}; X X#define MAPHASH_SIZE 257 X#define TID_MIN 1 X#define TID_MAX 16383 X Xstatic int tid_to_hash[TID_MAX + 1]; /* set to map_hash index */ Xstatic struct idmaplist map_hash[MAPHASH_SIZE]; Xstatic int next_free_tid = TID_MIN; /* first available tid */ Xstatic int last_free_tid = TID_MIN; /* first unavailable */ X Xstatic CORE_ADDR P_thread_next_offset; Xstatic CORE_ADDR P_thread_uniqueid_offset; Xstatic CORE_ADDR P_thread_state_offset; Xstatic CORE_ADDR P_thread_name_offset; Xstatic CORE_ADDR P_thread_ctx_offset; Xstatic CORE_ADDR P_thread_PS_RUNNING_value; Xstatic CORE_ADDR P_thread_PS_DEAD_value; X Xstatic int next_offset; Xstatic int uniqueid_offset; Xstatic int state_offset; Xstatic int name_offset; Xstatic int ctx_offset; Xstatic int PS_RUNNING_value; Xstatic int PS_DEAD_value; X X#define UNIQUEID_HASH(id) (id % MAPHASH_SIZE) X#define TID_ADD1(tid) (((tid) + 1) == TID_MAX + 1 \ X ? TID_MIN : (tid) + 1) X#define IS_TID_FREE(tid) (tid_to_hash[tid] == -1) X Xstatic int Xget_new_tid(int h) X{ X int tid = next_free_tid; X X tid_to_hash[tid] = h; X next_free_tid = TID_ADD1(next_free_tid); X if (next_free_tid == last_free_tid) X { X int i; X X for (i = last_free_tid; TID_ADD1(i) != last_free_tid; i = TID_ADD1(i)) X if (IS_TID_FREE(i)) X break; X if (TID_ADD1(i) == last_free_tid) X { X error("too many threads"); X return 0; X } X next_free_tid = i; X for (i = TID_ADD1(i); IS_TID_FREE(i); i = TID_ADD1(i)) X ; X last_free_tid = i; X } X X return tid; X} X Xstatic ptid_t Xfind_ptid(u_int64_t uniqueid) X{ X int h = UNIQUEID_HASH(uniqueid); X struct idmap *im; X X LIST_FOREACH(im, &map_hash[h], link) X if (im->uniqueid == uniqueid) X return MERGEPID(PIDGET(inferior_ptid), im->tid); X X im = xmalloc(sizeof(struct idmap)); X im->uniqueid = uniqueid; X im->tid = get_new_tid(h); X LIST_INSERT_HEAD(&map_hash[h], im, link); X X return MERGEPID(PIDGET(inferior_ptid), im->tid); X} X Xstatic void Xfree_ptid(ptid_t ptid) X{ X int tid = TIDGET(ptid); X int h = tid_to_hash[tid]; X struct idmap *im; X X if (!tid) return; X X LIST_FOREACH(im, &map_hash[h], link) X if (im->tid == tid) X break; X X if (!im) return; X X LIST_REMOVE(im, link); X tid_to_hash[tid] = -1; X free(im); X} X X#define READ_OFFSET(field) read_memory(P_thread_##field##_offset, \ X (char *) &field##_offset, \ X sizeof(field##_offset)) X X#define READ_VALUE(name) read_memory(P_thread_##name##_value, \ X (char *) &name##_value, \ X sizeof(name##_value)) X Xstatic void Xread_thread_offsets (void) X{ X READ_OFFSET(next); X READ_OFFSET(uniqueid); X READ_OFFSET(state); X READ_OFFSET(name); X READ_OFFSET(ctx); X X READ_VALUE(PS_RUNNING); X READ_VALUE(PS_DEAD); X} X X#define READ_FIELD(ptr, T, field, result) \ X read_memory ((ptr) + field##_offset, (char *) &(result), sizeof result) X Xstatic u_int64_t Xread_pthread_uniqueid (CORE_ADDR ptr) X{ X u_int64_t uniqueid; X READ_FIELD(ptr, u_int64_t, uniqueid, uniqueid); X return uniqueid; X} X Xstatic CORE_ADDR Xread_pthread_next (CORE_ADDR ptr) X{ X CORE_ADDR next; X READ_FIELD(ptr, CORE_ADDR, next, next); X return next; X} X Xstatic void Xread_cached_pthread (CORE_ADDR ptr, struct cached_pthread *cache) X{ X READ_FIELD(ptr, u_int64_t, uniqueid, cache->uniqueid); X READ_FIELD(ptr, int, state, cache->state); X READ_FIELD(ptr, CORE_ADDR, name, cache->name); X READ_FIELD(ptr, ucontext_t, ctx, cache->ctx); X} X Xstatic ptid_t Xfind_active_ptid (void) X{ X CORE_ADDR ptr; X X read_memory ((CORE_ADDR)P_thread_run, X (char *)&ptr, X sizeof ptr); X X return find_ptid(read_pthread_uniqueid(ptr)); X} X Xstatic CORE_ADDR find_pthread_addr PARAMS ((ptid_t ptid)); Xstatic struct cached_pthread * find_pthread PARAMS ((ptid_t ptid)); X Xstatic CORE_ADDR Xfind_pthread_addr (ptid_t ptid) X{ X CORE_ADDR ptr; X X if (ptid_equal(ptid, cached_ptid)) X return cached_pthread_addr; X X read_memory ((CORE_ADDR)P_thread_list, X (char *)&ptr, X sizeof ptr); X X while (ptr != 0) X { X if (ptid_equal(find_ptid(read_pthread_uniqueid(ptr)), ptid)) X { X cached_ptid = ptid; X cached_pthread_addr = ptr; X read_cached_pthread(ptr, &cached_pthread); X return ptr; X } X ptr = read_pthread_next(ptr); X } X X return NULL; X} X Xstatic struct cached_pthread * Xfind_pthread (ptid_t ptid) X{ X CORE_ADDR ptr; X X if (ptid_equal(ptid, cached_ptid)) X return &cached_pthread; X X read_memory ((CORE_ADDR)P_thread_list, X (char *)&ptr, X sizeof ptr); X X while (ptr != 0) X { X if (ptid_equal(find_ptid(read_pthread_uniqueid(ptr)), ptid)) X { X cached_ptid = ptid; X cached_pthread_addr = ptr; X read_cached_pthread(ptr, &cached_pthread); X return &cached_pthread; X } X ptr = read_pthread_next(ptr); X } X X#if 0 X error ("Can't find pthread %d,%d", PIDGET(ptid), TIDGET(ptid)); X#endif X return NULL; X} X X X/* Most target vector functions from here on actually just pass through to X inftarg.c, as they don't need to do anything specific for threads. */ X X/* ARGSUSED */ Xstatic void Xfreebsd_uthread_open (char *arg, int from_tty) X{ X child_ops.to_open (arg, from_tty); X} X X/* Attach to process PID, then initialize for debugging it X and wait for the trace-trap that results from attaching. */ X Xstatic void Xfreebsd_uthread_attach (char *args, int from_tty) X{ X child_ops.to_attach (args, from_tty); X push_target (&freebsd_uthread_ops); X freebsd_uthread_attaching = 1; X} X X/* After an attach, see if the target is threaded */ X Xstatic void Xfreebsd_uthread_post_attach (int pid) X{ X if (freebsd_uthread_active) X { X read_thread_offsets (); X inferior_ptid = find_active_ptid (); X add_thread (inferior_ptid); X } X else X { X unpush_target (&freebsd_uthread_ops); X push_target (&child_ops); X } X X freebsd_uthread_attaching = 0; X} X X/* Take a program previously attached to and detaches it. X The program resumes execution and will no longer stop X on signals, etc. We'd better not have left any breakpoints X in the program or it'll die when it hits one. For this X to work, it may be necessary for the process to have been X previously attached. It *might* work if the program was X started via the normal ptrace (PTRACE_TRACEME). */ X Xstatic void Xfreebsd_uthread_detach (char *args, int from_tty) X{ X child_ops.to_detach (args, from_tty); X} X X/* Resume execution of process PID. If STEP is nozero, then X just single step it. If SIGNAL is nonzero, restart it with that X signal activated. We may have to convert pid from a thread-id to an LWP id X for procfs. */ X Xstatic void Xfreebsd_uthread_resume (ptid_t ptid, int step, enum target_signal signo) X{ X if (freebsd_uthread_attaching) X { X child_ops.to_resume (ptid, step, signo); X return; X } X X child_ops.to_resume (ptid, step, signo); X cached_ptid = MERGEPID(0, 0); X} X X/* Wait for any threads to stop. We may have to convert PID from a thread id X to a LWP id, and vice versa on the way out. */ X Xstatic ptid_t Xfreebsd_uthread_wait (ptid_t ptid, struct target_waitstatus *ourstatus) X{ X ptid_t rtnval; X X if (freebsd_uthread_attaching) X { X return child_ops.to_wait (ptid, ourstatus); X } X X rtnval = child_ops.to_wait (ptid, ourstatus); X X if (PIDGET(rtnval) >= 0) X { X rtnval = find_active_ptid (); X if (!in_thread_list (rtnval)) X add_thread (rtnval); X } X X return rtnval; X} X X/* XXX: this needs to be selected by target, not [build] host */ X#ifdef __i386__ X X#include "i386-tdep.h" X Xstatic char sigmap[I386_SSE_NUM_REGS] = /* map reg to sigcontext */ X{ X 12, /* eax */ X 11, /* ecx */ X 10, /* edx */ X 9, /* ebx */ X 8, /* esp */ X 7, /* ebp */ X 6, /* esi */ X 5, /* edi */ X 15, /* eip */ X 17, /* eflags */ X 16, /* cs */ X 19, /* ss */ X 4, /* ds */ X 3, /* es */ X 2, /* fs */ X 1, /* gs */ X -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ X -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ X -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ X -1, /* mxcsr */ X}; X Xstatic char jmpmap[I386_SSE_NUM_REGS] = /* map reg to jmp_buf */ X{ X 6, /* eax */ X -1, /* ecx */ X -1, /* edx */ X 1, /* ebx */ X 2, /* esp */ X 3, /* ebp */ X 4, /* esi */ X 5, /* edi */ X 0, /* eip */ X -1, /* eflags */ X -1, /* cs */ X -1, /* ss */ X -1, /* ds */ X -1, /* es */ X -1, /* fs */ X -1, /* gs */ X -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ X -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ X -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ X -1, /* mxcsr */ X}; X X#endif X X#ifdef __amd64__ X X#include "amd64-tdep.h" X X// XXX:DEO not fully ported from i386 yet!! X Xstatic char sigmap[AMD64_NUM_REGS_TOTAL] = /* map reg to sigcontext */ X{ X 12, /* rax */ X 11, /* rcx */ X 10, /* rdx */ X 9, /* rbx */ X 8, /* rsp */ X 7, /* rbp */ X 6, /* rsi */ X 5, /* rdi */ X 15, /* rip */ X 17, /* rflags */ X 16, /* cs */ X 19, /* ss */ X 4, /* ds */ X 3, /* es */ X 2, /* fs */ X 1, /* gs */ X -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ X -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ X -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ X -1, /* mxcsr */ X}; X Xstatic char jmpmap[AMD64_NUM_REGS_TOTAL] = /* map reg to jmp_buf */ X{ X 6, /* rax */ X -1, /* rcx */ X -1, /* rdx */ X 1, /* rbx */ X 2, /* rsp */ X 3, /* rbp */ X 4, /* rsi */ X 5, /* rdi */ X 0, /* rip */ X -1, /* rflags */ X -1, /* cs */ X -1, /* ss */ X -1, /* ds */ X -1, /* es */ X -1, /* fs */ X -1, /* gs */ X -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ X -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ X -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ X -1, /* mxcsr */ X}; X X#endif X X#ifdef __alpha__ X X#include "alpha-tdep.h" X Xstatic char sigmap[ALPHA_NUM_REGS] = /* map reg to sigcontext */ X{ X 1, 2, 3, 4, 5, 6, 7, 8, /* v0 - t6 */ X 9, 10, 11, 12, 13, 14, 15, 16, /* t7 - fp */ X 17, 18, 19, 20, 21, 22, 23, 24, /* a0 - t9 */ X 25, 26, 27, 28, 29, 30, 31, 32, /* t10 - zero */ X 38, 39, 40, 41, 42, 43, 44, 45, /* f0 - f7 */ X 46, 47, 48, 49, 50, 51, 52, 53, /* f8 - f15 */ X 54, 55, 56, 57, 58, 59, 60, 61, /* f16 - f23 */ X 62, 63, 64, 65, 66, 67, 68, 69, /* f24 - f31 */ X 33, -1 /* pc, vfp */ X}; Xstatic char jmpmap[ALPHA_NUM_REGS] = { X 4, 5, 6, 7, 8, 9, 10, 11, /* v0 - t6 */ X 12, 13, 14, 15, 16, 17, 18, 19, /* t7 - fp */ X 20, 21, 22, 23, 24, 25, 26, 27, /* a0 - t9 */ X 28, 29, 30, 31, 32, 33, 34, 35, /* t10 - zero */ X 37, 38, 39, 40, 41, 42, 43, 44, /* f0 - f7 */ X 45, 46, 47, 48, 49, 50, 51, 52, /* f8 - f15 */ X 53, 54, 55, 56, 57, 58, 59, 60, /* f16 - f23 */ X 61, 62, 63, 64, 65, 66, 67, 68, /* f24 - f31 */ X 2, -1, /* pc, vfp */ X}; X X#endif X X#ifdef __sparc64__ X Xstatic char sigmap[125] = /* map reg to sigcontext */ X{ X -1 X}; Xstatic char jmpmap[125] = { X -1 X}; X X#endif X Xstatic void Xfreebsd_uthread_fetch_registers (int regno) X{ X struct cached_pthread *thread; X int active; X int first_regno, last_regno; X register_t *regbase; X char *regmap; X X if (freebsd_uthread_attaching || TIDGET(inferior_ptid) == 0) X { X child_ops.to_fetch_registers (regno); X return; X } X X thread = find_pthread (inferior_ptid); X active = (ptid_equal(inferior_ptid, find_active_ptid())); X X if (active) X { X child_ops.to_fetch_registers (regno); X return; X } X X if (regno == -1) X { X first_regno = 0; X last_regno = NUM_REGS - 1; X } X else X { X first_regno = regno; X last_regno = regno; X } X X regbase = (register_t*) &thread->ctx.jb[0]; X regmap = jmpmap; X X for (regno = first_regno; regno <= last_regno; regno++) X { X if (regmap[regno] == -1) X child_ops.to_fetch_registers (regno); X else X if (thread) X regcache_raw_supply (current_regcache, regno, (char*) ®base[regmap[regno]]); X else X regcache_raw_supply (current_regcache, regno, NULL); X } X} X Xstatic void Xfreebsd_uthread_store_registers (int regno) X{ X struct cached_pthread *thread; X CORE_ADDR ptr; X int first_regno, last_regno; X u_int32_t *regbase; X char *regmap; X X if (freebsd_uthread_attaching) X { X child_ops.to_store_registers (regno); X return; X } X X thread = find_pthread (inferior_ptid); X X if (thread->state == PS_RUNNING_value) X { X child_ops.to_store_registers (regno); X return; X } X X if (regno == -1) X { X first_regno = 0; X last_regno = NUM_REGS - 1; X } X else X { X first_regno = regno; X last_regno = regno; X } X X regbase = (u_int32_t*) &thread->ctx.jb[0]; X regmap = jmpmap; X X ptr = find_pthread_addr (inferior_ptid); X for (regno = first_regno; regno <= last_regno; regno++) X { X if (regmap[regno] == -1) X child_ops.to_store_registers (regno); X else X { X u_int32_t *reg = ®base[regmap[regno]]; X int off; X X /* Hang onto cached value */ X/*DEO:XXX*/ X memcpy(reg, deprecated_registers /*regcache_collect ()*/+ DEPRECATED_REGISTER_BYTE (regno), X register_size (current_gdbarch, regno)); X X /* And push out to inferior */ X off = (char *) reg - (char *) thread; X write_memory (ptr + off, X/*DEO:XXX*/ X deprecated_registers /*regcache_collect ()*/+ DEPRECATED_REGISTER_BYTE (regno), X register_size (current_gdbarch, regno)); X } X } X} X X/* Get ready to modify the registers array. On machines which store X individual registers, this doesn't need to do anything. On machines X which store all the registers in one fell swoop, this makes sure X that registers contains all the registers from the program being X debugged. */ X Xstatic void Xfreebsd_uthread_prepare_to_store (void) X{ X child_ops.to_prepare_to_store (); X} X Xstatic int Xfreebsd_uthread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, X int dowrite, struct mem_attrib *attrib, X struct target_ops *target) X{ X return child_ops.to_xfer_memory (memaddr, myaddr, len, dowrite, X attrib, target); X} X X/* Print status information about what we're accessing. */ X Xstatic void Xfreebsd_uthread_files_info (struct target_ops *ignore) X{ X child_ops.to_files_info (ignore); X} X Xstatic void Xfreebsd_uthread_kill_inferior (void) X{ X child_ops.to_kill (); X} X Xstatic void Xfreebsd_uthread_notice_signals (ptid_t ptid) X{ X child_ops.to_notice_signals (ptid); X} X X/* Fork an inferior process, and start debugging it with /proc. */ X Xstatic void Xfreebsd_uthread_create_inferior (char *exec_file, char *allargs, char **env, X int from_tty) X{ X child_ops.to_create_inferior (exec_file, allargs, env, from_tty); X X if (PIDGET(inferior_ptid) && freebsd_uthread_active) X { X read_thread_offsets (); X push_target (&freebsd_uthread_ops); X inferior_ptid = find_active_ptid (); X add_thread (inferior_ptid); X } X} X X/* This routine is called to find out if the inferior is using threads. X We check for the _thread_run and _thread_list globals. */ X Xvoid Xfreebsd_uthread_new_objfile (struct objfile *objfile) X{ X struct minimal_symbol *ms; X X if (!objfile) X { X freebsd_uthread_active = 0; X return; X } X X ms = lookup_minimal_symbol ("_thread_run", NULL, objfile); X X if (!ms) X return; X X P_thread_run = SYMBOL_VALUE_ADDRESS (ms); X X ms = lookup_minimal_symbol ("_thread_list", NULL, objfile); X X if (!ms) X return; X X P_thread_list = SYMBOL_VALUE_ADDRESS (ms); X X#define OFFSET_SYM(field) "_thread_" #field "_offset" X#define LOOKUP_OFFSET(field) \ X do { \ X ms = lookup_minimal_symbol (OFFSET_SYM(field), NULL, objfile); \ X if (!ms) \ X return; \ X P_thread_##field##_offset = SYMBOL_VALUE_ADDRESS (ms); \ X } while (0); X X#define VALUE_SYM(name) "_thread_" #name "_value" X#define LOOKUP_VALUE(name) \ X do { \ X ms = lookup_minimal_symbol (VALUE_SYM(name), NULL, objfile); \ X if (!ms) \ X return; \ X P_thread_##name##_value = SYMBOL_VALUE_ADDRESS (ms); \ X } while (0); X X LOOKUP_OFFSET(next); X LOOKUP_OFFSET(uniqueid); X LOOKUP_OFFSET(state); X LOOKUP_OFFSET(name); X LOOKUP_OFFSET(ctx); X X LOOKUP_VALUE(PS_RUNNING); X LOOKUP_VALUE(PS_DEAD); X X freebsd_uthread_active = 1; X} X X/* Clean up after the inferior dies. */ X Xstatic void Xfreebsd_uthread_mourn_inferior () X{ X child_ops.to_mourn_inferior (); X unpush_target (&freebsd_uthread_ops); X} X X/* Mark our target-struct as eligible for stray "run" and "attach" commands. */ X Xstatic int Xfreebsd_uthread_can_run () X{ X return child_suppress_run; X} X Xstatic int Xfreebsd_uthread_thread_alive (ptid_t ptid) X{ X struct cached_pthread *thread; X int ret = 0; X X if (freebsd_uthread_attaching) X return 1; X X /* X * We can get called from child_ops.to_wait() which passes the underlying X * pid (without a thread number). X */ X if (TIDGET(ptid) == 0) X return 1; X X if (find_pthread_addr (ptid) != 0) X { X thread = find_pthread (ptid); X ret = (thread->state != PS_DEAD_value); X } X X if (!ret) X free_ptid(ptid); X X return ret; X} X Xstatic void Xfreebsd_uthread_stop (void) X{ X child_ops.to_stop (); X} X Xstatic void Xfreebsd_uthread_find_new_threads (void) X{ X CORE_ADDR ptr; X int state; X u_int64_t uniqueid; X X read_memory ((CORE_ADDR)P_thread_list, X (char *)&ptr, X sizeof ptr); X X while (ptr != 0) X { X READ_FIELD(ptr, int, state, state); X READ_FIELD(ptr, u_int64_t, uniqueid, uniqueid); X if (state != PS_DEAD_value && X !in_thread_list (find_ptid(uniqueid))) X add_thread (find_ptid(uniqueid)); X ptr = read_pthread_next(ptr); X } X} X X/* MUST MATCH enum pthread_state */ Xstatic const char *statenames[] = { X "RUNNING", X "SIGTHREAD", X "MUTEX_WAIT", X "COND_WAIT", X "FDLR_WAIT", X "FDLW_WAIT", X "FDR_WAIT", X "FDW_WAIT", X "POLL_WAIT", X "FILE_WAIT", X "SELECT_WAIT", X "SLEEP_WAIT", X "WAIT_WAIT", X "SIGSUSPEND", X "SIGWAIT", X "SPINBLOCK", X "JOIN", X "SUSPENDED", X "DEAD", X "DEADLOCK", X}; X X#if 0 X Xstatic int Xfreebsd_uthread_get_thread_info (ref, selection, info) X gdb_threadref *ref; X int selection; X struct gdb_ext_thread_info *info; X{ X int pid = *ref; X struct cached_pthread *thread = find_pthread (pid); X struct cleanup *old_chain; X X old_chain = save_inferior_pid (); X inferior_pid = main_pid; X X memset(&info->threadid, 0, OPAQUETHREADBYTES); X X memcpy(&info->threadid, ref, sizeof *ref); X info->active = thread->state == PS_RUNNING_value; X strcpy(info->display, statenames[thread->state]); X if (thread->name) X read_memory ((CORE_ADDR) thread->name, info->shortname, 32); X else X strcpy(info->shortname, ""); X X do_cleanups (old_chain); X return (0); X} X X#endif X Xchar * Xfreebsd_uthread_pid_to_str (ptid_t ptid) X{ X static char buf[30]; X X if (DEPRECATED_STREQ (current_target.to_shortname, "freebsd-uthreads")) X sprintf (buf, "Process %d, Thread %ld", X PIDGET(ptid), TIDGET(ptid)); X else X sprintf (buf, "Process %d", PIDGET(ptid)); X X return buf; X} X X Xstatic void Xinit_freebsd_uthread_ops () X{ X freebsd_uthread_ops.to_shortname = "freebsd-uthreads"; X freebsd_uthread_ops.to_longname = "FreeBSD uthreads"; X freebsd_uthread_ops.to_doc = "FreeBSD user threads support."; X freebsd_uthread_ops.to_open = freebsd_uthread_open; X freebsd_uthread_ops.to_attach = freebsd_uthread_attach; X freebsd_uthread_ops.to_post_attach = freebsd_uthread_post_attach; X freebsd_uthread_ops.to_detach = freebsd_uthread_detach; X freebsd_uthread_ops.to_resume = freebsd_uthread_resume; X freebsd_uthread_ops.to_wait = freebsd_uthread_wait; X freebsd_uthread_ops.to_fetch_registers = freebsd_uthread_fetch_registers; X freebsd_uthread_ops.to_store_registers = freebsd_uthread_store_registers; X freebsd_uthread_ops.to_prepare_to_store = freebsd_uthread_prepare_to_store; X freebsd_uthread_ops.to_xfer_memory = freebsd_uthread_xfer_memory; X freebsd_uthread_ops.to_files_info = freebsd_uthread_files_info; X freebsd_uthread_ops.to_insert_breakpoint = memory_insert_breakpoint; X freebsd_uthread_ops.to_remove_breakpoint = memory_remove_breakpoint; X freebsd_uthread_ops.to_terminal_init = terminal_init_inferior; X freebsd_uthread_ops.to_terminal_inferior = terminal_inferior; X freebsd_uthread_ops.to_terminal_ours_for_output = terminal_ours_for_output; X freebsd_uthread_ops.to_terminal_ours = terminal_ours; X freebsd_uthread_ops.to_terminal_info = child_terminal_info; X freebsd_uthread_ops.to_kill = freebsd_uthread_kill_inferior; X freebsd_uthread_ops.to_create_inferior = freebsd_uthread_create_inferior; X freebsd_uthread_ops.to_mourn_inferior = freebsd_uthread_mourn_inferior; X freebsd_uthread_ops.to_can_run = freebsd_uthread_can_run; X freebsd_uthread_ops.to_notice_signals = freebsd_uthread_notice_signals; X freebsd_uthread_ops.to_thread_alive = freebsd_uthread_thread_alive; X freebsd_uthread_ops.to_stop = freebsd_uthread_stop; X freebsd_uthread_ops.to_stratum = process_stratum; X freebsd_uthread_ops.to_has_all_memory = 1; X freebsd_uthread_ops.to_has_memory = 1; X freebsd_uthread_ops.to_has_stack = 1; X freebsd_uthread_ops.to_has_registers = 1; X freebsd_uthread_ops.to_has_execution = 1; X freebsd_uthread_ops.to_has_thread_control = 0; X freebsd_uthread_ops.to_magic = OPS_MAGIC; X freebsd_uthread_ops.to_find_new_threads = freebsd_uthread_find_new_threads; X freebsd_uthread_ops.to_pid_to_str = freebsd_uthread_pid_to_str; X#if 0 X freebsd_uthread_vec.get_thread_info = freebsd_uthread_get_thread_info; X#endif X} X Xvoid X_initialize_freebsd_uthread () X{ X init_freebsd_uthread_ops (); X add_target (&freebsd_uthread_ops); X X target_new_objfile_chain = deprecated_target_new_objfile_hook; X deprecated_target_new_objfile_hook = freebsd_uthread_new_objfile; X X child_suppress_run = 1; X} END-of-gdb65/files/freebsd-uthread.c echo x - gdb65/files/patch-gdb-Makefile.in sed 's/^X//' >gdb65/files/patch-gdb-Makefile.in << 'END-of-gdb65/files/patch-gdb-Makefile.in' X--- gdb/Makefile.in.orig Mon Jul 10 23:49:02 2006 X+++ gdb/Makefile.in Mon Jul 10 23:50:38 2006 X@@ -122,10 +122,10 @@ X BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC) X X # Where is the READLINE library? Typically in ../readline. X-READLINE_DIR = ../readline X-READLINE = $(READLINE_DIR)/libreadline.a X-READLINE_SRC = $(srcdir)/$(READLINE_DIR) X-READLINE_CFLAGS = -I$(READLINE_SRC)/.. X+#READLINE_DIR = ../readline X+#READLINE = $(READLINE_DIR)/libreadline.a X+#READLINE_SRC = $(srcdir)/$(READLINE_DIR) X+#READLINE_CFLAGS = -I$(READLINE_SRC)/.. X X WARN_CFLAGS = @WARN_CFLAGS@ X WERROR_CFLAGS = @WERROR_CFLAGS@ X@@ -590,9 +590,9 @@ X demangle_h = $(INCLUDE_DIR)/demangle.h X obstack_h = $(INCLUDE_DIR)/obstack.h X opcode_m68hc11_h = $(INCLUDE_DIR)/opcode/m68hc11.h X-readline_h = $(READLINE_SRC)/readline.h X-readline_tilde_h = $(READLINE_SRC)/tilde.h X-readline_history_h = $(READLINE_SRC)/history.h X+#readline_h = $(READLINE_SRC)/readline.h X+#readline_tilde_h = $(READLINE_SRC)/tilde.h X+#readline_history_h = $(READLINE_SRC)/history.h X frv_desc_h = $(OPCODES_SRC)/frv-desc.h X sh_opc_h = $(OPCODES_SRC)/sh-opc.h X gdb_callback_h = $(INCLUDE_DIR)/gdb/callback.h X@@ -3171,3 +3171,4 @@ X $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-winsource.c X X ### end of the gdb Makefile.in. X+READLINE = -lreadline END-of-gdb65/files/patch-gdb-Makefile.in echo x - gdb65/files/nm-fbsd.h sed 's/^X//' >gdb65/files/nm-fbsd.h << 'END-of-gdb65/files/nm-fbsd.h' X#ifndef CONFIG_NM_FBSD_H X#define CONFIG_NM_FBSD_H X X/* $FreeBSD: ports/devel/gdb6/files/nm-fbsd.h,v 1.1 2004/05/13 04:28:38 obrien Exp $ */ X X#ifdef HAVE_SYS_PARAM_H X#include X#endif X Xextern int kernel_debugging; Xextern int kernel_writablecore; X XCORE_ADDR fbsd_kern_frame_saved_pc(struct frame_info *frame); X X#if __FreeBSD_version >= 500032 X#define KGDB 1 X#define ADDITIONAL_OPTIONS \ X {"kernel", no_argument, &kernel_debugging, 1}, \ X {"k", no_argument, &kernel_debugging, 1}, \ X {"wcore", no_argument, &kernel_writablecore, 1}, \ X {"w", no_argument, &kernel_writablecore, 1}, X X#define ADDITIONAL_OPTION_HELP \ X "\ X --kernel Enable kernel debugging.\n\ X --wcore Make core file writable (only works for /dev/mem).\n\ X This option only works while debugging a kernel !!\n\ X" X X#define DEFAULT_PROMPT kernel_debugging?"(kgdb) ":"(gdb) " X X/* misuse START_PROGRESS to test whether we're running as kgdb */ X/* START_PROGRESS is called at the top of main */ X#undef START_PROGRESS X#define START_PROGRESS(STR,N) \ X if (!strcmp (STR, "kgdb")) \ X kernel_debugging = 1; X#endif X#endif /* CONFIG_NM_FBSD_H */ END-of-gdb65/files/nm-fbsd.h echo x - gdb65/files/patch-gdb-version.in sed 's/^X//' >gdb65/files/patch-gdb-version.in << 'END-of-gdb65/files/patch-gdb-version.in' X--- gdb/version.in.orig Tue Jun 20 22:05:40 2006 X+++ gdb/version.in Mon Jul 10 23:17:58 2006 X@@ -1 +1 @@ X-6.5 X+6.5 [GDB v6.x for FreeBSD] END-of-gdb65/files/patch-gdb-version.in echo x - gdb65/files/patch-gdb-testsuite-configure sed 's/^X//' >gdb65/files/patch-gdb-testsuite-configure << 'END-of-gdb65/files/patch-gdb-testsuite-configure' X--- gdb/testsuite/configure.orig Sun Dec 3 04:06:15 2006 X+++ gdb/testsuite/configure Sun Dec 3 04:06:51 2006 X@@ -1247,16 +1247,6 @@ X echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} X ac_cache_corrupted=: ;; X ,);; X- *) X- if test "x$ac_old_val" != "x$ac_new_val"; then X- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 X-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} X- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 X-echo "$as_me: former value: $ac_old_val" >&2;} X- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 X-echo "$as_me: current value: $ac_new_val" >&2;} X- ac_cache_corrupted=: X- fi;; X esac X # Pass precious variables to config.status. X if test "$ac_new_set" = set; then END-of-gdb65/files/patch-gdb-testsuite-configure echo x - gdb65/pkg-plist sed 's/^X//' >gdb65/pkg-plist << 'END-of-gdb65/pkg-plist' X@comment $FreeBSD$ Xbin/gdb65 END-of-gdb65/pkg-plist exit --------------020208080303000907060007-- State-Changed-From-To: feedback->open State-Changed-By: gabor State-Changed-When: Mon Dec 11 22:15:05 UTC 2006 State-Changed-Why: Feedback received. Responsible-Changed-From-To: freebsd-ports-bugs->gabor Responsible-Changed-By: gabor Responsible-Changed-When: Mon Dec 11 22:15:05 UTC 2006 Responsible-Changed-Why: Take. http://www.freebsd.org/cgi/query-pr.cgi?pr=100067 State-Changed-From-To: open->repocopy State-Changed-By: gabor State-Changed-When: Tue Dec 12 22:00:37 UTC 2006 State-Changed-Why: Ask for repocopy: devel/gdb6 -> devel/gdb65. Responsible-Changed-From-To: gabor->portmgr Responsible-Changed-By: gabor Responsible-Changed-When: Tue Dec 12 22:00:37 UTC 2006 Responsible-Changed-Why: Ask for repocopy: devel/gdb6 -> devel/gdb65. http://www.freebsd.org/cgi/query-pr.cgi?pr=100067 State-Changed-From-To: repocopy->open State-Changed-By: marcus State-Changed-When: Wed Dec 13 07:55:35 UTC 2006 State-Changed-Why: I'd prefer you discuss this new version with obrien to see what his plans are regarding gdb. There may be other reasons why this port has not been updated. Responsible-Changed-From-To: portmgr->gabor Responsible-Changed-By: marcus Responsible-Changed-When: Wed Dec 13 07:55:35 UTC 2006 Responsible-Changed-Why: I'd prefer you discuss this new version with obrien to see what his plans are regarding gdb. There may be other reasons why this port has not been updated. http://www.freebsd.org/cgi/query-pr.cgi?pr=100067 From: linimon@lonesome.com (Mark Linimon) To: bug-followup@FreeBSD.org Cc: Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Wed, 13 Dec 2006 08:05:59 -0600 Forwarding manually, as this was not Cc:ed. ----- Forwarded message from "Philip M. Gollucci" ----- From: "Philip M. Gollucci" Joe Marcus Clarke wrote: >I'd prefer you discuss this new version with obrien to see what his plans >are regarding gdb. There may be other reasons why this port has not been >updated. > >http://www.freebsd.org/cgi/query-pr.cgi?pr=100067 I know I made some noise and was then slow to fix it, but 3+ years without being able to do anything httpd, or perl or mod_perl threaded debugging is IMHO very bad. -- ------------------------------------------------------------------------ Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708 Consultant / http://p6m7g8.net/Resume/resume.shtml Senior Software Engineer - TicketMaster - http://ticketmaster.com 1024D/EC88A0BF 0DE5 C55C 6BF3 B235 2DAB B89E 1324 9B4F EC88 A0BF From: Gabor Kovesdan To: Joe Marcus Clarke Cc: pgollucci@p6m7g8.com, portmgr@FreeBSD.org, bug-followup@FreeBSD.org Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Wed, 13 Dec 2006 19:13:36 +0100 Joe Marcus Clarke schrieb: > Synopsis: New port: devel/gdb65 GNU GDB 6.5 > > State-Changed-From-To: repocopy->open > State-Changed-By: marcus > State-Changed-When: Wed Dec 13 07:55:35 UTC 2006 > State-Changed-Why: > I'd prefer you discuss this new version with obrien to see what his plans > are regarding gdb. There may be other reasons why this port has not been > updated. > > I wrote to obrien@ on Dec 7 and got no answer from him. I've tested this port and it's okay (apart from the missing USE_PERL5_BUILD), I also did some run-time tests and worked well. If obrien has other plans, this port could be improved later, but personally I think we could add it in this form in this way. If they are issues with this, they will show up and we can start addressing them. And note, that this is a new port, gdb6 is still there for conservative people or in case this port fails to work in a specific situation. Gabor From: "Philip M. Gollucci" To: Gabor Kovesdan Cc: Joe Marcus Clarke , portmgr@FreeBSD.org, bug-followup@FreeBSD.org Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Wed, 13 Dec 2006 10:17:53 -0800 Gabor Kovesdan wrote: > I wrote to obrien@ on Dec 7 and got no answer from him. I've tested this > port and it's okay (apart from the missing USE_PERL5_BUILD), I also did > some run-time tests and worked well. If obrien has other plans, this > port could be improved later, but personally I think we could add it in > this form in this way. If they are issues with this, they will show up > and we can start addressing them. And note, that this is a new port, > gdb6 is still there for conservative people or in case this port fails > to work in a specific situation. I couldn't have said it better. Thanks. -- ------------------------------------------------------------------------ Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708 Consultant / http://p6m7g8.net/Resume/resume.shtml Senior Software Engineer - TicketMaster - http://ticketmaster.com 1024D/EC88A0BF 0DE5 C55C 6BF3 B235 2DAB B89E 1324 9B4F EC88 A0BF I never had a dream come true 'Til the day that I found you. Even though I pretend that I've moved on You'll always be my baby. I never found the words to say You're the one I think about each day And I know no matter where life takes me to A part of me will always be... A part of me will always be with you. Responsible-Changed-From-To: gabor->obrien Responsible-Changed-By: gabor Responsible-Changed-When: Thu Dec 14 08:28:40 UTC 2006 Responsible-Changed-Why: Over to obrien, he agreed to handle this PR. http://www.freebsd.org/cgi/query-pr.cgi?pr=100067 From: "Philip M. Gollucci" To: bug-followup@FreeBSD.org, pgollucci@p6m7g8.com Cc: Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Mon, 18 Dec 2006 19:53:09 -0800 FYI: gdb 6.6 is out as of ~today. -- ------------------------------------------------------------------------ Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708 Consultant / http://p6m7g8.net/Resume/resume.shtml Senior Software Engineer - TicketMaster - http://ticketmaster.com 1024D/EC88A0BF 0DE5 C55C 6BF3 B235 2DAB B89E 1324 9B4F EC88 A0BF I never had a dream come true 'Til the day that I found you. Even though I pretend that I've moved on You'll always be my baby. I never found the words to say You're the one I think about each day And I know no matter where life takes me to A part of me will always be... A part of me will always be with you. From: "Abdullah Ibn Hamad Al-Marri" To: bug-followup@freebsd.org, pgollucci@p6m7g8.com Cc: Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Mon, 9 Apr 2007 08:41:30 +0300 Hello, No word about his port yet? -- Regards, -Abdullah Ibn Hamad Al-Marri Arab Portal http://www.WeArab.Net/ From: "Philip M. Gollucci" To: Abdullah Ibn Hamad Al-Marri Cc: bug-followup@freebsd.org Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Wed, 11 Apr 2007 14:21:16 -0700 Abdullah Ibn Hamad Al-Marri wrote: > Hello, > > No word about his port yet? > You'll need to talk to obrien@ My Hands are tied. -- ------------------------------------------------------------------------ Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708 Consultant / http://p6m7g8.net/Resume/resume.shtml Senior Software Engineer - TicketMaster - http://ticketmaster.com 1024D/EC88A0BF 0DE5 C55C 6BF3 B235 2DAB B89E 1324 9B4F EC88 A0BF Work like you don't need the money, love like you'll never get hurt, and dance like nobody's watching. From: Michael Nottebrock To: bug-followup@freebsd.org, pgollucci@p6m7g8.com Cc: portmgr@freebsd.org Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Tue, 17 Apr 2007 21:55:28 +0200 I just learned that the current version of kdevelop wants gdb 6.6 and does not work with any of the gdbs available in base or ports. Can portmgr@ please revisit this issue and make a decision on whether obrien@'s silence on the matter should further block creation of a port for an up-to-date gdb? From: "Abdullah Ibn Hamad Al-Marri" To: bug-followup@freebsd.org Cc: Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Sun, 22 Apr 2007 11:02:22 +0300 This port is very important for debugging many threaded apps, I wish we could see it in the ports tree very soon. -- Regards, -Abdullah Ibn Hamad Al-Marri Arab Portal http://www.WeArab.Net/ From: Pav Lucistnik To: Michael Nottebrock Cc: bug-followup@FreeBSD.org, pgollucci@p6m7g8.com, portmgr@FreeBSD.org Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Mon, 23 Apr 2007 10:51:25 +0200 > I just learned that the current version of kdevelop wants gdb 6.6 and does not > work with any of the gdbs available in base or ports. > > Can portmgr@ please revisit this issue and make a decision on whether > obrien@'s silence on the matter should further block creation of a port for > an up-to-date gdb? At this point, I think we can assume creation of gdb66 port without obrien's involvment. -- Pav Lucistnik I will give you a name, and I shall call you Sting. From: "Philip M. Gollucci" To: pav@FreeBSD.org Cc: Michael Nottebrock , bug-followup@FreeBSD.org, portmgr@FreeBSD.org Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Mon, 23 Apr 2007 10:01:22 -0700 Pav Lucistnik wrote: >> I just learned that the current version of kdevelop wants gdb 6.6 and does not >> work with any of the gdbs available in base or ports. >> >> Can portmgr@ please revisit this issue and make a decision on whether >> obrien@'s silence on the matter should further block creation of a port for >> an up-to-date gdb? > > At this point, I think we can assume creation of gdb66 port without > obrien's involvment. > I'll see what I can put together nowish. I'm moving from Los Angeles to Virginia on Thursday, so I'll be internet disable starting Wednesday for a while. If you haven't seen a port from me before then, assume you don't need to wait for me. Thanks Pav. -- ------------------------------------------------------------------------ Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708 Consultant / http://p6m7g8.net/Resume Senior Software Engineer - TicketMaster - http://ticketmaster.com 1024D/EC88A0BF 0DE5 C55C 6BF3 B235 2DAB B89E 1324 9B4F EC88 A0BF Work like you don't need the money, love like you'll never get hurt, and dance like nobody's watching. From: "Philip M. Gollucci" To: bug-followup@FreeBSD.org, pgollucci@p6m7g8.com Cc: Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Mon, 23 Apr 2007 16:20:12 -0700 This is a multi-part message in MIME format. --------------070904040603090007040402 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 1) So the initial bug of gdb itself segfaulting is fixed: /usr/local/bin/gdb66 ./httpd (gdb) b ap_process_request Breakpoint 1 at 0x80851ce: file http_request.c, line 252. (gdb) r -DONE_PROCESS -d /home/pgollucci/dev/software/freebsd-6.2-stable/debug/3.4.6/httpd/2.2.4/worker Breakpoint 1, ap_process_request (r=0x81bd050) at http_request.c:252 252 if (ap_extended_status) (gdb) (gdb) (gdb) (gdb) bt #0 ap_process_request (r=0x81bd050) at http_request.c:252 #1 0x08082630 in ap_process_http_connection (c=0x81b7120) at http_core.c:184 #2 0x0807eb1a in ap_run_process_connection (c=0x81b7120) at connection.c:43 #3 0x0807ef58 in ap_process_connection (c=0x81b7120, csd=0x81b7050) at connection.c:178 #4 0x0808a358 in process_socket (p=0x81b7018, sock=0x81b7050, my_child_num=0, my_thread_num=0, bucket_alloc=0x81bb018) at worker.c:544 #5 0x0808ab5d in worker_thread (thd=0x81493d8, dummy=0x80ab5c0) at worker.c:894 #6 0x2813f5ec in dummy_worker (opaque=0x81493d8) at threadproc/unix/thread.c:138 #7 0x2816b3a5 in ?? () from /lib/libpthread.so.2 #8 0x081493d8 in ?? () #9 0x00000000 in ?? () 2) It looks like a lot of the kernel stuff has been in gdb since 2004 http://sourceware.org/ml/gdb-patches/2004-05/msg00480.html Thus, I removed a lot of the files/patches in devel/gdb66/files 3) We nolonger need USE_PERL_BUILD which I forgot in the original 65 port. 4) I came up with a cleaner hack for CFLAGS going foobar which it still does by just rm -rf gdb/testsuite 5) Need a repo copy from devel/gdb6 to devel/gdb66 then apply this diff (attached as gdb66.diff) 6) We should probably use INFO/INFO_PATH to install gdb/docs/*.info ? 7) I only have i386 available to me to test on until end of May. 8) I'm not really setup at the moment to do kernel debugging to test that feature. 9) I dropped freebsd 4.x support 10) several portlint -CA fixes 11) I don't know what to do about this one though: WARN: Makefile: Consider adding support for a WITHOUT_NLS knob to conditionally disable gettext support. 12) copied a lot of the text on the website into pkg_descr and added a WWW: line. -- ------------------------------------------------------------------------ Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708 Consultant / http://p6m7g8.net/Resume Senior Software Engineer - TicketMaster - http://ticketmaster.com 1024D/EC88A0BF 0DE5 C55C 6BF3 B235 2DAB B89E 1324 9B4F EC88 A0BF Work like you don't need the money, love like you'll never get hurt, and dance like nobody's watching. --------------070904040603090007040402 Content-Type: text/plain; name="gdb66.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gdb66.diff" Index: Makefile =================================================================== RCS file: /home/ncvs/ports/devel/gdb6/Makefile,v retrieving revision 1.47 diff -u -r1.47 Makefile --- Makefile 4 May 2006 21:40:39 -0000 1.47 +++ Makefile 23 Apr 2007 23:17:49 -0000 @@ -1,70 +1,44 @@ # ex:ts=8 -# Ports collection makefile for: GDB 6 -# Date created: 30 March 2001 -# Whom: David O'Brien +# Ports collection makefile for: GDB 6.6 +# Date created: 23 April 2007 +# Whom: Philip M. Gollucci # -# $FreeBSD: ports/devel/gdb6/Makefile,v 1.47 2006/05/04 21:40:39 edwin Exp $ +# $FreeBSD$ # -SNAPDATE= 2004-08-10 -SNAPVER= ${SNAPDATE:S/-//g} - PORTNAME= gdb -PORTVERSION= 6 -PORTREVISION= ${SNAPVER} +PORTVERSION= 6.6 CATEGORIES= devel -MASTER_SITES= ${MASTER_SITE_SOURCEWARE:S/$/:sw/} \ - ${MASTER_SITE_LOCAL:S/$/:local/} -MASTER_SITE_SUBDIR= gdb/snapshots/current/:sw obrien/:local -DISTNAME= gdb+dejagnu-weekly-${SNAPVER} -DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:sw,local - -PATCH_SITES= ${MASTER_SITE_LOCAL} -PATCH_SITE_SUBDIR= obrien -#PATCHFILES= gdb60_xfree-loadmod.diff +MASTER_SITES= ${MASTER_SITE_GNU} +MASTER_SITE_SUBDIR= gdb -MAINTAINER= obrien@FreeBSD.org -COMMENT= GNU GDB 6 +MAINTAINER= pgollucci@p6m7g8.com +COMMENT= GNU GDB 6.6 -WRKSRC= ${WRKDIR}/${DISTNAME:S/-weekly//} -USE_BZIP2= yes USE_GMAKE= yes GNU_CONFIGURE= yes -CONFIGURE_ARGS= --program-suffix=6 -CFLAGS+= -DRL_NO_COMPAT -DKGDB +USE_GETTEXT= yes +CONFIGURE_ARGS= --program-suffix=66 +CFLAGS+= -DRL_NO_COMPAT -DKGDB -I${LOCALBASE}/include .include .if ${ARCH} == "ia64" || ${ARCH} == "sparc64" || ${ARCH} == "alpha" -BROKEN= "Does not build on ia64, sparc64 or alpha" -.endif - -.if ${OSVERSION} < 500000 -CFLAGS+= -include ${FILESDIR}/fbsd4.h +BROKEN= Does not build on ia64, sparc64 or alpha. .endif .if ${ARCH} == "amd64" CONFIGURE_TARGET= x86_64-portbld-freebsd${OSREL} .endif -post-patch: - @${REINPLACE_CMD} -e 's/$$/ [GDB v6.x for FreeBSD]/' \ - ${WRKSRC}/gdb/version.in - @${REINPLACE_CMD} -e 's/^READLINE/#READLINE/' \ - -e 's/^readline/#readline/' \ - ${WRKSRC}/gdb/Makefile.in - ${ECHO} 'READLINE = -lreadline' >> ${WRKSRC}/gdb/Makefile.in - pre-configure: - cd ${WRKSRC} ; ${RM} -rf dejagnu expect readline sim tcl texinfo -.for f in freebsd-uthread.c kvm-fbsd.c kvm-fbsd-${ARCH}.h - ${LN} -sf ${FILESDIR}/${f} ${WRKSRC}/gdb/${f:C/-${ARCH}//} -.endfor + cd ${WRKSRC} ; ${RM} -rf dejagnu expect readline sim tcl texinfo gdb/testsuite ${LN} -sf ${FILESDIR}/nm-fbsd.h ${WRKSRC}/gdb/config do-install: ${INSTALL_PROGRAM} ${WRKSRC}/gdb/gdb \ ${PREFIX}/bin/${PORTNAME}${PORTVERSION:S/.//g} + cklatest: ncftpls \ ftp://sources.redhat.com/pub/${MASTER_SITE_SUBDIR}/ \ Index: distinfo =================================================================== RCS file: /home/ncvs/ports/devel/gdb6/distinfo,v retrieving revision 1.26 diff -u -r1.26 distinfo --- distinfo 22 Jan 2006 08:28:11 -0000 1.26 +++ distinfo 23 Apr 2007 23:17:49 -0000 @@ -1,3 +1,3 @@ -MD5 (gdb+dejagnu-weekly-20040810.tar.bz2) = 6baf5181993bb71d0b2da7112dc6eea0 -SHA256 (gdb+dejagnu-weekly-20040810.tar.bz2) = fe2fdd73fc75bb8f67d815df13698fb8f23f53de2a527aa314520e477fa2d011 -SIZE (gdb+dejagnu-weekly-20040810.tar.bz2) = 16970119 +MD5 (gdb-6.6.tar.gz) = 18be4e7a1ac713bda93d00fee20bbef8 +SHA256 (gdb-6.6.tar.gz) = c119ce82f0e42d3412420c42c1ead75e0b9de67131a5c9dd3cdab509f65ddfdd +SIZE (gdb-6.6.tar.gz) = 19298180 Index: pkg-descr =================================================================== RCS file: /home/ncvs/ports/devel/gdb6/pkg-descr,v retrieving revision 1.5 diff -u -r1.5 pkg-descr --- pkg-descr 13 May 2004 04:28:38 -0000 1.5 +++ pkg-descr 23 Apr 2007 23:17:49 -0000 @@ -1 +1,19 @@ -GNU GDB 6.x developmental snapshot. +GDB, the GNU Project debugger, allows you to see what is going on `inside' +another program while it executes -- or what another program was doing at +the moment it crashed. + +GDB can do four main kinds of things (plus other things in support of these) +to help you catch bugs in the act: + + * Start your program, specifying anything that might affect its behavior. + * Make your program stop on specified conditions. + * Examine what has happened, when your program has stopped. + * Change things in your program, so you can experiment with correcting the + effects of one bug and go on to learn about another. + +The program being debugged can be written in Ada, C, C++, Objective-C, Pascal +(and many other languages). Those programs might be executing on the same +machine as GDB (native) or on another machine (remote). GDB can run on most +popular UNIX and Microsoft Windows variants. + +WWW: http://sourceware.org/gdb Index: pkg-plist =================================================================== RCS file: /home/ncvs/ports/devel/gdb6/pkg-plist,v retrieving revision 1.9 diff -u -r1.9 pkg-plist --- pkg-plist 12 Mar 2005 07:44:31 -0000 1.9 +++ pkg-plist 23 Apr 2007 23:17:49 -0000 @@ -1,2 +1,2 @@ -@comment $FreeBSD: ports/devel/gdb6/pkg-plist,v 1.9 2005/03/12 07:44:31 obrien Exp $ -bin/gdb6 +@comment $FreeBSD$ +bin/gdb66 cvs diff: cannot find files/fbsd4.h Index: files/freebsd-uthread.c =================================================================== RCS file: /home/ncvs/ports/devel/gdb6/files/freebsd-uthread.c,v retrieving revision 1.4 diff -u -r1.4 freebsd-uthread.c --- files/freebsd-uthread.c 20 Oct 2004 19:37:48 -0000 1.4 +++ files/freebsd-uthread.c 23 Apr 2007 23:17:49 -0000 @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $FreeBSD: ports/devel/gdb6/files/freebsd-uthread.c,v 1.4 2004/10/20 19:37:48 obrien Exp $ */ +/* $FreeBSD$ */ /* This module implements a sort of half target that sits between the machine-independent parts of GDB and the ptrace interface (infptrace.c) to @@ -65,7 +65,7 @@ static void (*target_new_objfile_chain) (struct objfile *objfile); static void freebsd_uthread_resume PARAMS ((ptid_t pid, int step, - enum target_signal signo)); + enum target_signal signo)); static void init_freebsd_uthread_ops PARAMS ((void)); @@ -74,13 +74,13 @@ static ptid_t find_active_ptid PARAMS ((void)); struct cached_pthread { - u_int64_t uniqueid; - int state; - CORE_ADDR name; + u_int64_t uniqueid; + int state; + CORE_ADDR name; union { - ucontext_t uc; - jmp_buf jb; - } ctx; + ucontext_t uc; + jmp_buf jb; + } ctx; }; static ptid_t cached_ptid; @@ -90,19 +90,19 @@ LIST_HEAD(idmaplist, idmap); struct idmap { - LIST_ENTRY(idmap) link; - u_int64_t uniqueid; - int tid; + LIST_ENTRY(idmap) link; + u_int64_t uniqueid; + int tid; }; -#define MAPHASH_SIZE 257 -#define TID_MIN 1 -#define TID_MAX 16383 +#define MAPHASH_SIZE 257 +#define TID_MIN 1 +#define TID_MAX 16383 -static int tid_to_hash[TID_MAX + 1]; /* set to map_hash index */ +static int tid_to_hash[TID_MAX + 1]; /* set to map_hash index */ static struct idmaplist map_hash[MAPHASH_SIZE]; -static int next_free_tid = TID_MIN; /* first available tid */ -static int last_free_tid = TID_MIN; /* first unavailable */ +static int next_free_tid = TID_MIN; /* first available tid */ +static int last_free_tid = TID_MIN; /* first unavailable */ static CORE_ADDR P_thread_next_offset; static CORE_ADDR P_thread_uniqueid_offset; @@ -120,10 +120,10 @@ static int PS_RUNNING_value; static int PS_DEAD_value; -#define UNIQUEID_HASH(id) (id % MAPHASH_SIZE) -#define TID_ADD1(tid) (((tid) + 1) == TID_MAX + 1 \ - ? TID_MIN : (tid) + 1) -#define IS_TID_FREE(tid) (tid_to_hash[tid] == -1) +#define UNIQUEID_HASH(id) (id % MAPHASH_SIZE) +#define TID_ADD1(tid) (((tid) + 1) == TID_MAX + 1 \ + ? TID_MIN : (tid) + 1) +#define IS_TID_FREE(tid) (tid_to_hash[tid] == -1) static int get_new_tid(int h) @@ -137,16 +137,16 @@ int i; for (i = last_free_tid; TID_ADD1(i) != last_free_tid; i = TID_ADD1(i)) - if (IS_TID_FREE(i)) - break; + if (IS_TID_FREE(i)) + break; if (TID_ADD1(i) == last_free_tid) - { - error("too many threads"); - return 0; - } + { + error("too many threads"); + return 0; + } next_free_tid = i; for (i = TID_ADD1(i); IS_TID_FREE(i); i = TID_ADD1(i)) - ; + ; last_free_tid = i; } @@ -191,13 +191,13 @@ free(im); } -#define READ_OFFSET(field) read_memory(P_thread_##field##_offset, \ - (char *) &field##_offset, \ - sizeof(field##_offset)) - -#define READ_VALUE(name) read_memory(P_thread_##name##_value, \ - (char *) &name##_value, \ - sizeof(name##_value)) +#define READ_OFFSET(field) read_memory(P_thread_##field##_offset, \ + (char *) &field##_offset, \ + sizeof(field##_offset)) + +#define READ_VALUE(name) read_memory(P_thread_##name##_value, \ + (char *) &name##_value, \ + sizeof(name##_value)) static void read_thread_offsets (void) @@ -234,10 +234,10 @@ static void read_cached_pthread (CORE_ADDR ptr, struct cached_pthread *cache) { - READ_FIELD(ptr, u_int64_t, uniqueid, cache->uniqueid); - READ_FIELD(ptr, int, state, cache->state); - READ_FIELD(ptr, CORE_ADDR, name, cache->name); - READ_FIELD(ptr, ucontext_t, ctx, cache->ctx); + READ_FIELD(ptr, u_int64_t, uniqueid, cache->uniqueid); + READ_FIELD(ptr, int, state, cache->state); + READ_FIELD(ptr, CORE_ADDR, name, cache->name); + READ_FIELD(ptr, ucontext_t, ctx, cache->ctx); } static ptid_t @@ -246,8 +246,8 @@ CORE_ADDR ptr; read_memory ((CORE_ADDR)P_thread_run, - (char *)&ptr, - sizeof ptr); + (char *)&ptr, + sizeof ptr); return find_ptid(read_pthread_uniqueid(ptr)); } @@ -264,18 +264,18 @@ return cached_pthread_addr; read_memory ((CORE_ADDR)P_thread_list, - (char *)&ptr, - sizeof ptr); + (char *)&ptr, + sizeof ptr); while (ptr != 0) { if (ptid_equal(find_ptid(read_pthread_uniqueid(ptr)), ptid)) - { - cached_ptid = ptid; - cached_pthread_addr = ptr; - read_cached_pthread(ptr, &cached_pthread); - return ptr; - } + { + cached_ptid = ptid; + cached_pthread_addr = ptr; + read_cached_pthread(ptr, &cached_pthread); + return ptr; + } ptr = read_pthread_next(ptr); } @@ -291,18 +291,18 @@ return &cached_pthread; read_memory ((CORE_ADDR)P_thread_list, - (char *)&ptr, - sizeof ptr); + (char *)&ptr, + sizeof ptr); while (ptr != 0) { if (ptid_equal(find_ptid(read_pthread_uniqueid(ptr)), ptid)) - { - cached_ptid = ptid; - cached_pthread_addr = ptr; - read_cached_pthread(ptr, &cached_pthread); - return &cached_pthread; - } + { + cached_ptid = ptid; + cached_pthread_addr = ptr; + read_cached_pthread(ptr, &cached_pthread); + return &cached_pthread; + } ptr = read_pthread_next(ptr); } @@ -405,7 +405,7 @@ { rtnval = find_active_ptid (); if (!in_thread_list (rtnval)) - add_thread (rtnval); + add_thread (rtnval); } return rtnval; @@ -418,50 +418,50 @@ static char sigmap[I386_SSE_NUM_REGS] = /* map reg to sigcontext */ { - 12, /* eax */ - 11, /* ecx */ - 10, /* edx */ - 9, /* ebx */ - 8, /* esp */ - 7, /* ebp */ - 6, /* esi */ - 5, /* edi */ - 15, /* eip */ - 17, /* eflags */ - 16, /* cs */ - 19, /* ss */ - 4, /* ds */ - 3, /* es */ - 2, /* fs */ - 1, /* gs */ - -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ - -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ - -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ - -1, /* mxcsr */ + 12, /* eax */ + 11, /* ecx */ + 10, /* edx */ + 9, /* ebx */ + 8, /* esp */ + 7, /* ebp */ + 6, /* esi */ + 5, /* edi */ + 15, /* eip */ + 17, /* eflags */ + 16, /* cs */ + 19, /* ss */ + 4, /* ds */ + 3, /* es */ + 2, /* fs */ + 1, /* gs */ + -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ + -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ + -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ + -1, /* mxcsr */ }; static char jmpmap[I386_SSE_NUM_REGS] = /* map reg to jmp_buf */ { - 6, /* eax */ - -1, /* ecx */ - -1, /* edx */ - 1, /* ebx */ - 2, /* esp */ - 3, /* ebp */ - 4, /* esi */ - 5, /* edi */ - 0, /* eip */ - -1, /* eflags */ - -1, /* cs */ - -1, /* ss */ - -1, /* ds */ - -1, /* es */ - -1, /* fs */ - -1, /* gs */ - -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ - -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ - -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ - -1, /* mxcsr */ + 6, /* eax */ + -1, /* ecx */ + -1, /* edx */ + 1, /* ebx */ + 2, /* esp */ + 3, /* ebp */ + 4, /* esi */ + 5, /* edi */ + 0, /* eip */ + -1, /* eflags */ + -1, /* cs */ + -1, /* ss */ + -1, /* ds */ + -1, /* es */ + -1, /* fs */ + -1, /* gs */ + -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ + -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ + -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ + -1, /* mxcsr */ }; #endif @@ -470,54 +470,54 @@ #include "amd64-tdep.h" -// XXX:DEO not fully ported from i386 yet!! +// XXX:DEO not fully ported from i386 yet!! static char sigmap[AMD64_NUM_REGS_TOTAL] = /* map reg to sigcontext */ { - 12, /* rax */ - 11, /* rcx */ - 10, /* rdx */ - 9, /* rbx */ - 8, /* rsp */ - 7, /* rbp */ - 6, /* rsi */ - 5, /* rdi */ - 15, /* rip */ - 17, /* rflags */ - 16, /* cs */ - 19, /* ss */ - 4, /* ds */ - 3, /* es */ - 2, /* fs */ - 1, /* gs */ - -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ - -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ - -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ - -1, /* mxcsr */ + 12, /* rax */ + 11, /* rcx */ + 10, /* rdx */ + 9, /* rbx */ + 8, /* rsp */ + 7, /* rbp */ + 6, /* rsi */ + 5, /* rdi */ + 15, /* rip */ + 17, /* rflags */ + 16, /* cs */ + 19, /* ss */ + 4, /* ds */ + 3, /* es */ + 2, /* fs */ + 1, /* gs */ + -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ + -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ + -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ + -1, /* mxcsr */ }; static char jmpmap[AMD64_NUM_REGS_TOTAL] = /* map reg to jmp_buf */ { - 6, /* rax */ - -1, /* rcx */ - -1, /* rdx */ - 1, /* rbx */ - 2, /* rsp */ - 3, /* rbp */ - 4, /* rsi */ - 5, /* rdi */ - 0, /* rip */ - -1, /* rflags */ - -1, /* cs */ - -1, /* ss */ - -1, /* ds */ - -1, /* es */ - -1, /* fs */ - -1, /* gs */ - -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ - -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ - -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ - -1, /* mxcsr */ + 6, /* rax */ + -1, /* rcx */ + -1, /* rdx */ + 1, /* rbx */ + 2, /* rsp */ + 3, /* rbp */ + 4, /* rsi */ + 5, /* rdi */ + 0, /* rip */ + -1, /* rflags */ + -1, /* cs */ + -1, /* ss */ + -1, /* ds */ + -1, /* es */ + -1, /* fs */ + -1, /* gs */ + -1, -1, -1, -1, -1, -1, -1, /* st0-st7 */ + -1, -1, -1, -1, -1, -1, -1, /* fctrl-fop */ + -1, -1, -1, -1, -1, -1, -1, /* xmm0-xmm7 */ + -1, /* mxcsr */ }; #endif @@ -526,7 +526,7 @@ #include "alpha-tdep.h" -static char sigmap[ALPHA_NUM_REGS] = /* map reg to sigcontext */ +static char sigmap[ALPHA_NUM_REGS] = /* map reg to sigcontext */ { 1, 2, 3, 4, 5, 6, 7, 8, /* v0 - t6 */ 9, 10, 11, 12, 13, 14, 15, 16, /* t7 - fp */ @@ -536,7 +536,7 @@ 46, 47, 48, 49, 50, 51, 52, 53, /* f8 - f15 */ 54, 55, 56, 57, 58, 59, 60, 61, /* f16 - f23 */ 62, 63, 64, 65, 66, 67, 68, 69, /* f24 - f31 */ - 33, -1 /* pc, vfp */ + 33, -1 /* pc, vfp */ }; static char jmpmap[ALPHA_NUM_REGS] = { 4, 5, 6, 7, 8, 9, 10, 11, /* v0 - t6 */ @@ -547,14 +547,14 @@ 45, 46, 47, 48, 49, 50, 51, 52, /* f8 - f15 */ 53, 54, 55, 56, 57, 58, 59, 60, /* f16 - f23 */ 61, 62, 63, 64, 65, 66, 67, 68, /* f24 - f31 */ - 2, -1, /* pc, vfp */ + 2, -1, /* pc, vfp */ }; #endif #ifdef __sparc64__ -static char sigmap[125] = /* map reg to sigcontext */ +static char sigmap[125] = /* map reg to sigcontext */ { -1 }; @@ -605,12 +605,12 @@ for (regno = first_regno; regno <= last_regno; regno++) { if (regmap[regno] == -1) - child_ops.to_fetch_registers (regno); + child_ops.to_fetch_registers (regno); else - if (thread) - regcache_raw_supply (current_regcache, regno, (char*) ®base[regmap[regno]]); - else - regcache_raw_supply (current_regcache, regno, NULL); + if (thread) + regcache_raw_supply (current_regcache, regno, (char*) ®base[regmap[regno]]); + else + regcache_raw_supply (current_regcache, regno, NULL); } } @@ -655,24 +655,24 @@ for (regno = first_regno; regno <= last_regno; regno++) { if (regmap[regno] == -1) - child_ops.to_store_registers (regno); + child_ops.to_store_registers (regno); else - { - u_int32_t *reg = ®base[regmap[regno]]; - int off; + { + u_int32_t *reg = ®base[regmap[regno]]; + int off; - /* Hang onto cached value */ + /* Hang onto cached value */ /*DEO:XXX*/ - memcpy(reg, deprecated_registers /*regcache_collect ()*/+ DEPRECATED_REGISTER_BYTE (regno), - register_size (current_gdbarch, regno)); + memcpy(reg, deprecated_registers /*regcache_collect ()*/+ DEPRECATED_REGISTER_BYTE (regno), + register_size (current_gdbarch, regno)); - /* And push out to inferior */ - off = (char *) reg - (char *) thread; - write_memory (ptr + off, + /* And push out to inferior */ + off = (char *) reg - (char *) thread; + write_memory (ptr + off, /*DEO:XXX*/ - deprecated_registers /*regcache_collect ()*/+ DEPRECATED_REGISTER_BYTE (regno), - register_size (current_gdbarch, regno)); - } + deprecated_registers /*regcache_collect ()*/+ DEPRECATED_REGISTER_BYTE (regno), + register_size (current_gdbarch, regno)); + } } } @@ -690,11 +690,11 @@ static int freebsd_uthread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, - int dowrite, struct mem_attrib *attrib, - struct target_ops *target) + int dowrite, struct mem_attrib *attrib, + struct target_ops *target) { return child_ops.to_xfer_memory (memaddr, myaddr, len, dowrite, - attrib, target); + attrib, target); } /* Print status information about what we're accessing. */ @@ -721,7 +721,7 @@ static void freebsd_uthread_create_inferior (char *exec_file, char *allargs, char **env, - int from_tty) + int from_tty) { child_ops.to_create_inferior (exec_file, allargs, env, from_tty); @@ -762,22 +762,22 @@ P_thread_list = SYMBOL_VALUE_ADDRESS (ms); -#define OFFSET_SYM(field) "_thread_" #field "_offset" -#define LOOKUP_OFFSET(field) \ - do { \ - ms = lookup_minimal_symbol (OFFSET_SYM(field), NULL, objfile); \ - if (!ms) \ - return; \ - P_thread_##field##_offset = SYMBOL_VALUE_ADDRESS (ms); \ +#define OFFSET_SYM(field) "_thread_" #field "_offset" +#define LOOKUP_OFFSET(field) \ + do { \ + ms = lookup_minimal_symbol (OFFSET_SYM(field), NULL, objfile); \ + if (!ms) \ + return; \ + P_thread_##field##_offset = SYMBOL_VALUE_ADDRESS (ms); \ } while (0); -#define VALUE_SYM(name) "_thread_" #name "_value" -#define LOOKUP_VALUE(name) \ - do { \ - ms = lookup_minimal_symbol (VALUE_SYM(name), NULL, objfile); \ - if (!ms) \ - return; \ - P_thread_##name##_value = SYMBOL_VALUE_ADDRESS (ms); \ +#define VALUE_SYM(name) "_thread_" #name "_value" +#define LOOKUP_VALUE(name) \ + do { \ + ms = lookup_minimal_symbol (VALUE_SYM(name), NULL, objfile); \ + if (!ms) \ + return; \ + P_thread_##name##_value = SYMBOL_VALUE_ADDRESS (ms); \ } while (0); LOOKUP_OFFSET(next); @@ -851,16 +851,16 @@ u_int64_t uniqueid; read_memory ((CORE_ADDR)P_thread_list, - (char *)&ptr, - sizeof ptr); + (char *)&ptr, + sizeof ptr); while (ptr != 0) { READ_FIELD(ptr, int, state, state); READ_FIELD(ptr, u_int64_t, uniqueid, uniqueid); if (state != PS_DEAD_value && - !in_thread_list (find_ptid(uniqueid))) - add_thread (find_ptid(uniqueid)); + !in_thread_list (find_ptid(uniqueid))) + add_thread (find_ptid(uniqueid)); ptr = read_pthread_next(ptr); } } @@ -927,7 +927,7 @@ if (DEPRECATED_STREQ (current_target.to_shortname, "freebsd-uthreads")) sprintf (buf, "Process %d, Thread %ld", - PIDGET(ptid), TIDGET(ptid)); + PIDGET(ptid), TIDGET(ptid)); else sprintf (buf, "Process %d", PIDGET(ptid)); cvs diff: cannot find files/kvm-fbsd-alpha.h cvs diff: cannot find files/kvm-fbsd-amd64.h cvs diff: cannot find files/kvm-fbsd-i386.h cvs diff: cannot find files/kvm-fbsd-sparc64.h cvs diff: cannot find files/kvm-fbsd.c Index: files/nm-fbsd.h =================================================================== RCS file: /home/ncvs/ports/devel/gdb6/files/nm-fbsd.h,v retrieving revision 1.1 diff -u -r1.1 nm-fbsd.h --- files/nm-fbsd.h 13 May 2004 04:28:38 -0000 1.1 +++ files/nm-fbsd.h 23 Apr 2007 23:17:49 -0000 @@ -1,7 +1,7 @@ #ifndef CONFIG_NM_FBSD_H #define CONFIG_NM_FBSD_H -/* $FreeBSD: ports/devel/gdb6/files/nm-fbsd.h,v 1.1 2004/05/13 04:28:38 obrien Exp $ */ +/* $FreeBSD$ */ #ifdef HAVE_SYS_PARAM_H #include cvs diff: files/patch-Makefile.in was removed, no comparison available cvs diff: files/patch-amd64-tdep.c was removed, no comparison available cvs diff: files/patch-amd64-tdep.h was removed, no comparison available cvs diff: files/patch-config_alpha_fbsd.mh was removed, no comparison available cvs diff: files/patch-config_alpha_nm-fbsd.h was removed, no comparison available cvs diff: files/patch-config_i386_fbsd.mh was removed, no comparison available cvs diff: files/patch-config_i386_fbsd64.mh was removed, no comparison available cvs diff: files/patch-config_i386_nm-fbsd.h was removed, no comparison available cvs diff: files/patch-config_powerpc_fbsd.mh was removed, no comparison available cvs diff: files/patch-config_powerpc_fbsd.mt was removed, no comparison available cvs diff: files/patch-config_sparc_fbsd.mh was removed, no comparison available cvs diff: files/patch-config_sparc_fbsd.mt was removed, no comparison available cvs diff: files/patch-config_sparc_nm-fbsd.h was removed, no comparison available cvs diff: files/patch-config_sparc_tm-fbsd.h was removed, no comparison available Index: files/patch-configure.host =================================================================== RCS file: /home/ncvs/ports/devel/gdb6/files/patch-configure.host,v retrieving revision 1.1 diff -u -r1.1 patch-configure.host --- files/patch-configure.host 12 Aug 2006 20:54:37 -0000 1.1 +++ files/patch-configure.host 23 Apr 2007 23:17:49 -0000 @@ -1,13 +1,12 @@ +$FreeBSD$ -$FreeBSD: ports/devel/gdb6/files/patch-configure.host,v 1.1 2006/08/12 20:54:37 obrien Exp $ - ---- gdb/configure.host -+++ gdb/configure.host -@@ -106,6 +106,7 @@ - powerpc-*-aix4.[0-2]*) gdb_host=aix ;; - powerpc-*-aix4.3.[0-1]*) gdb_host=aix ;; - powerpc-*-aix*) gdb_host=aix432 ;; -+powerpc-*-freebsd*) gdb_host=fbsd;; +--- gdb/configure.host.orig Mon Apr 23 12:04:34 2007 ++++ gdb/configure.host Mon Apr 23 12:06:19 2007 +@@ -110,6 +110,7 @@ + + powerpc-*-aix*) gdb_host=aix ;; powerpc-*-linux*) gdb_host=linux ;; - powerpc-*-netbsd*) gdb_host=nbsd ;; ++powerpc-*-freebsd*) gdb_host=fbsd;; + powerpc-*-netbsd* | powerpc-*-knetbsd*-gnu) + gdb_host=nbsd ;; powerpc-*-openbsd*) gdb_host=obsd ;; cvs diff: files/patch-gdb-Makefile.in is a new entry, no comparison available cvs diff: files/patch-gdb-i386fbsd-tdep.c is a new entry, no comparison available cvs diff: files/patch-gdb-main.c is a new entry, no comparison available cvs diff: files/patch-gdb-target.c is a new entry, no comparison available cvs diff: files/patch-gdb-target.h is a new entry, no comparison available cvs diff: files/patch-gdb-version.in is a new entry, no comparison available cvs diff: files/patch-i386%nm-fbsd64.h was removed, no comparison available cvs diff: files/patch-i386fbsd-tdep.c was removed, no comparison available cvs diff: files/patch-main.c was removed, no comparison available cvs diff: files/patch-ppcfbsd-nat.c was removed, no comparison available cvs diff: files/patch-ppcfbsd-tdep.c was removed, no comparison available cvs diff: files/patch-ppcfbsd-tdep.h was removed, no comparison available cvs diff: files/patch-rs6000-tdep.c was removed, no comparison available cvs diff: files/patch-target.c was removed, no comparison available cvs diff: files/patch-target.h was removed, no comparison available --------------070904040603090007040402-- From: "Philip M. Gollucci" To: bug-followup@FreeBSD.org, pgollucci@p6m7g8.com Cc: Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Mon, 23 Apr 2007 16:37:26 -0700 It dawns on me that kgdb(1) is in base since 5.3 so we should probably remove all kernel related things from devel/gdb66 right ? -- ------------------------------------------------------------------------ Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708 Consultant / http://p6m7g8.net/Resume Senior Software Engineer - TicketMaster - http://ticketmaster.com 1024D/EC88A0BF 0DE5 C55C 6BF3 B235 2DAB B89E 1324 9B4F EC88 A0BF Work like you don't need the money, love like you'll never get hurt, and dance like nobody's watching. From: Pav Lucistnik To: bug-followup@FreeBSD.org, pgollucci@p6m7g8.com Cc: Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Mon, 14 May 2007 15:57:07 +0200 Hey Philip, I noticed you forgot -N flag to that diff command, so the removal and new files have no listed content in the patch. Can you please remedy this? -- Pav Lucistnik 42.7 percent of all statistics are made up on the spot. From: Pav Lucistnik To: Philip Gollucci Cc: bug-followup@FreeBSD.org Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Wed, 16 May 2007 16:53:41 +0200 > I saw the PR was no longer open as of yesterday? What do you mean? There was no state change on it. -- Pav Lucistnik Traffic collapse in Paris starts whenever a traffic light changes color. -- JLE at #angband From: "Abdullah Ibn Hamad Al-Marri" To: bug-followup@freebsd.org, "Philip M. Gollucci" Cc: Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Thu, 31 May 2007 10:43:43 +0300 Hey Philip, Since I run threaded app I really need this port, and I thank you for your great efforts to make it hit ports before another ports freeze placed for FreeBSD 7.0 :) Could you please add the -N flag per Pav note? -- Regards, -Abdullah Ibn Hamad Al-Marri Arab Portal http://www.WeArab.Net/ From: "Abdullah Ibn Hamad Al-Marri" To: bug-followup@freebsd.org Cc: "Pav Lucistnik" Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Sun, 10 Jun 2007 11:28:27 +0300 Hello Pav, Can you add the flag -N and let it go? :) -- Regards, -Abdullah Ibn Hamad Al-Marri Arab Portal http://www.WeArab.Net/ From: "Mikhail T." To: bug-followup@FreeBSD.org, pgollucci@p6m7g8.com Cc: Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Thu, 14 Jun 2007 15:03:30 -0400 Gentlemen! I've been trying to reach the current maintainer of gdb6 for the last year or more with my proposed upgrade of gdb to the then-current gdb-6.4 (with the optional Insight front-end). Unfortunately, David is not responding... I now have my port updated to gdb-6.6 with Insight being optional (off by default, because it still requires fixing the Tcl/Tk code -- GNU people have abandoned the GUI, it seems, and it bit-rotted). Please, review my shar at: http://aldan.algebra.com/~mi/gdb66.shar Note. The additional source files in files/ should all be simply removed. The most recent diff (patch-4.diff) in this PR dispenses with most of them (even though the bulk of the diff rearranges blank-space in the freebsd-uthread.c The only patch in my version modifies the debugger's top-level main function to initialize a different interface depending on the name of the executable. This allows linking gdbtui (and, optionally, insight) to gdb, instead of creating copies of these huge executables. Considering the fact, that our base-system gdb is of about same vintage as what's currently available under devel/gdb6, I believe, there is no point in preserving the former. Repo-copy is not warranted, IMO. As soon as I get some positive feedback on my new version, I intend to upgrade devel/gdb6 with it -- maintainer timeout is long overdue. Yours, -mi From: "Abdullah Ibn Hamad Al-Marri" To: bug-followup@freebsd.org, "Philip M. Gollucci" Cc: "Mikhail T." , "Pav Lucistnik" , "Michael Nottebrock" Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Thu, 21 Jun 2007 11:38:15 +0300 Hello, No one is willing to get this sorted out at all? :) -- Regards, -Abdullah Ibn Hamad Al-Marri Arab Portal http://www.WeArab.Net/ From: Mikhail Teterin To: "Abdullah Ibn Hamad Al-Marri" Cc: bug-followup@freebsd.org, "Philip M. Gollucci" , "Pav Lucistnik" , "Michael Nottebrock" Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Thu, 21 Jun 2007 05:57:37 -0400 On четвер 21 червень 2007, you wrote: = Hello, = = No one is willing to get this sorted out at all? :) I'm most willing, but I'd like a confirmation, that my port works for more than one person (myself). Have you tried it, Abdullah? -mi From: "Abdullah Ibn Hamad Al-Marri" To: "Mikhail Teterin" Cc: bug-followup@freebsd.org, "Philip M. Gollucci" , "Pav Lucistnik" , "Michael Nottebrock" Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Thu, 21 Jun 2007 13:03:43 +0300 T24gNi8yMS8wNywgTWlraGFpbCBUZXRlcmluIDxtaStrZGVAYWxkYW4uYWxnZWJyYS5jb20+IHdy b3RlOgo+IE9uINGH0LXRgtCy0LXRgCAyMSDRh9C10YDQstC10L3RjCAyMDA3LCB5b3Ugd3JvdGU6 Cj4gPSBIZWxsbywKPiA9Cj4gPSBObyBvbmUgaXMgd2lsbGluZyB0byBnZXQgdGhpcyBzb3J0ZWQg b3V0IGF0IGFsbD8gOikKPgo+IEknbSBtb3N0IHdpbGxpbmcsIGJ1dCBJJ2QgbGlrZSBhIGNvbmZp cm1hdGlvbiwgdGhhdCBteSBwb3J0IHdvcmtzIGZvciBtb3JlCj4gdGhhbiBvbmUgcGVyc29uICht eXNlbGYpLgo+Cj4gSGF2ZSB5b3UgdHJpZWQgaXQsIEFiZHVsbGFoPwo+Cj4gICAgICAgICAtbWkK PgoKSGVsbG8gTWlraGFpbCwKCkkgZG9uJ3Qga25vdyBob3cgdG8gZG8gaXQsIHRoYXQncyB3aHkg SSBuZWVkIHRvIGluc3RhbGwgaXQgZnJvbSBwb3J0cywKSSdtIGEgbmV3YmllIHdoZW4gaXQgY29t ZXMgdG8gc2hhci4KLS0gClJlZ2FyZHMsCgotQWJkdWxsYWggSWJuIEhhbWFkIEFsLU1hcnJpCkFy YWIgUG9ydGFsCmh0dHA6Ly93d3cuV2VBcmFiLk5ldC8K From: "Mikhail T." To: Abdullah Ibn Hamad Al-Marri Cc: bug-followup@freebsd.org, "Philip M. Gollucci" , Pav Lucistnik , Michael Nottebrock Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Thu, 21 Jun 2007 10:14:42 -0400 Abdullah Ibn Hamad Al-Marri wrote: > Hello Mikhail, > > I don't know how to do it, that's why I need to install it from ports, > I'm a newbie when it comes to shar. Generic instructions to extract a shell archive (shar) are embedded into each shar :-) Here are the customized steps: fetch -o /tmp http://aldan.algebra.com/~mi/gdb66.shar # download the shar cd /usr/ports/devel # cd to the appropriate parent diectory sh /tmp/gdb66.shar # extract the shar cd gdb66 # cd into the newly created (extracted) directory make install # install the port Yours, -mi From: "Abdullah Ibn Hamad Al-Marri" To: "Mikhail T." Cc: bug-followup@freebsd.org, "Philip M. Gollucci" , "Pav Lucistnik" , "Michael Nottebrock" Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Thu, 21 Jun 2007 21:26:02 +0300 On 6/21/07, Mikhail T. wrote: > Abdullah Ibn Hamad Al-Marri wrote: > > Hello Mikhail, > > > > I don't know how to do it, that's why I need to install it from ports, > > I'm a newbie when it comes to shar. > Generic instructions to extract a shell archive (shar) are embedded into > each shar :-) Here are the customized steps: > > fetch -o /tmp http://aldan.algebra.com/~mi/gdb66.shar # download > the shar > cd /usr/ports/devel # cd to the appropriate parent diectory > sh /tmp/gdb66.shar # extract the shar > cd gdb66 # cd into the newly created (extracted) directory > make install # install the port > > Yours, > > -mi Thank you for the easy howto ;) It failed in my server. 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Mon Jun 18 21:48:28 GMT 2007 amd64 updating cache ./config.cache configure: creating ./config.status config.status: creating Makefile config.status: creating .gdbinit config.status: creating config.h config.status: executing gdb_stdint.h commands config.status: executing default commands configure: configuring in doc configure: running /bin/sh '../.././gdb/doc/configure' --prefix=/usr/local '--cache-file=./config.cache' '--build=x86_64-portbld-freebsd7.0' '--host=x86_64-portbld-freebsd7.0' '--target=x86_64-portbld-freebsd7.0' '--enable-target=all' '--enable-tui' '--with-libiconv-prefix=/usr/local' '--prefix=/usr/local' '--program-transform-name=s,$,66,; ' '--srcdir=.././gdb' 'CC=cc' 'CFLAGS=-O2 -fno-strict-aliasing -pipe -DRL_NO_COMPAT -DKGDB -I/usr/local/include' 'LDFLAGS=' 'build_alias=x86_64-portbld-freebsd7.0' 'host_alias=x86_64-portbld-freebsd7.0' 'target_alias=x86_64-portbld-freebsd7.0' --cache-file=.././config.cache --srcdir=../.././gdb/doc configure: loading cache .././config.cache checking for a BSD-compatible install... /usr/bin/install -c -o root -g wheel checking whether ln -s works... yes configure: creating ./config.status config.status: creating Makefile configure: configuring in testsuite configure: running /bin/sh '../.././gdb/testsuite/configure' --prefix=/usr/local '--cache-file=./config.cache' '--build=x86_64-portbld-freebsd7.0' '--host=x86_64-portbld-freebsd7.0' '--target=x86_64-portbld-freebsd7.0' '--enable-target=all' '--enable-tui' '--with-libiconv-prefix=/usr/local' '--prefix=/usr/local' '--program-transform-name=s,$,66,; ' '--srcdir=.././gdb' 'CC=cc' 'CFLAGS=-O2 -fno-strict-aliasing -pipe -DRL_NO_COMPAT -DKGDB -I/usr/local/include' 'LDFLAGS=' 'build_alias=x86_64-portbld-freebsd7.0' 'host_alias=x86_64-portbld-freebsd7.0' 'target_alias=x86_64-portbld-freebsd7.0' --cache-file=.././config.cache --srcdir=../.././gdb/testsuite configure: loading cache .././config.cache configure: error: `CFLAGS' has changed since the previous run: configure: former value: -O2 -fno-strict-aliasing -pipe -DRL_NO_COMPAT -DKGDB -I/usr/local/include configure: current value: -O2 -fno-strict-aliasing -pipe -DRL_NO_COMPAT -DKGDB -I/usr/local/include configure: error: changes in the environment can compromise the build configure: error: run `make distclean' and/or `rm .././config.cache' and start over configure: error: /bin/sh '../.././gdb/testsuite/configure' failed for testsuite gmake[1]: *** [configure-gdb] Error 1 gmake[1]: Leaving directory `/usr/ports/devel/gdb66/work/gdb-6.6' gmake: *** [all] Error 2 *** Error code 2 Stop in /usr/ports/devel/gdb66. *** Error code 1 Stop in /usr/ports/devel/gdb66. -- Regards, -Abdullah Ibn Hamad Al-Marri Arab Portal http://www.WeArab.Net/ From: "Mikhail T." To: Abdullah Ibn Hamad Al-Marri Cc: bug-followup@freebsd.org, "Philip M. Gollucci" , Pav Lucistnik , Michael Nottebrock Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Thu, 21 Jun 2007 14:31:54 -0400 Abdullah Ibn Hamad Al-Marri wrote: > 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Mon Jun 18 21:48:28 GMT 2007 amd64 > > updating cache ./config.cache It is supposed to start with "creating cache ./config.cache" -- could you, please, remove the work-subdirectory completely and try building the port again? Thanks! -mi From: "Abdullah Ibn Hamad Al-Marri" To: "Mikhail T." Cc: bug-followup@freebsd.org, "Philip M. Gollucci" , "Pav Lucistnik" , "Michael Nottebrock" Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Thu, 21 Jun 2007 22:06:54 +0300 On 6/21/07, Mikhail T. wrote: > Abdullah Ibn Hamad Al-Marri wrote: > > 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Mon Jun 18 21:48:28 GMT 2007 amd64 > > > > updating cache ./config.cache > It is supposed to start with "creating cache ./config.cache" -- could > you, please, remove the work-subdirectory completely and try building > the port again? Thanks! > > -mi I tried that and it didn't work too. make install doesn't work too, I had to do make clean && make install. Guess what worked? I added CPUTYPE?=nocona in make.conf then it worked. -- Regards, -Abdullah Ibn Hamad Al-Marri Arab Portal http://www.WeArab.Net/ From: "Mikhail T." To: Abdullah Ibn Hamad Al-Marri Cc: bug-followup@freebsd.org, "Philip M. Gollucci" , Pav Lucistnik , Michael Nottebrock Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Thu, 21 Jun 2007 15:33:55 -0400 Abdullah Ibn Hamad Al-Marri wrote: > Guess what worked? > > I added CPUTYPE?=nocona in make.conf then it worked. This is strange. I tried commenting out the CPUTYPE setting on my machine, but configure still succeeded. Anyway, is the resulting debugger working for you? If it is fine, I'll update the port (the current one is obsolete anyway), and deal with bug reports, if any... -mi From: "Abdullah Ibn Hamad Al-Marri" To: "Mikhail T." Cc: bug-followup@freebsd.org, "Philip M. Gollucci" , "Pav Lucistnik" , "Michael Nottebrock" Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Fri, 22 Jun 2007 21:54:51 +0300 On 6/21/07, Mikhail T. wrote: > Abdullah Ibn Hamad Al-Marri wrote: > > Guess what worked? > > > > I added CPUTYPE?=nocona in make.conf then it worked. > This is strange. I tried commenting out the CPUTYPE setting on my > machine, but configure still succeeded. > > Anyway, is the resulting debugger working for you? If it is fine, I'll > update the port (the current one is obsolete anyway), and deal with bug > reports, if any... > > -mi Yes, I can confirm, it works in FreeBSD 7.0 AMD64, and FreeBSD 6.2-STABLE i386 with CPUTYPE used in compile. -- Regards, -Abdullah Ibn Hamad Al-Marri Arab Portal http://www.WeArab.Net/ From: Mikhail Teterin To: "Abdullah Ibn Hamad Al-Marri" Cc: bug-followup@freebsd.org, "Philip M. Gollucci" , "Pav Lucistnik" , "Michael Nottebrock" Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Fri, 22 Jun 2007 15:01:37 -0400 On п'ятниця 22 червень 2007, you wrote: = Yes, I can confirm, it works in FreeBSD 7.0 AMD64, and FreeBSD = 6.2-STABLE i386 with CPUTYPE used in compile. I figured the "CPUTYPE" thing out... Indeed, when CFLAGS are not modified in /etc/make.conf _at all_, the default ones "-O2 -fomit-frame-pointer -pipe " contain a blank space at the end, somehow... This freaks gdb's picky configure out... I put a work-around into the port's makefile... -mi From: Philip Gollucci To: Abdullah Ibn Hamad Al-Marri Cc: Mikhail Teterin , bug-followup@freebsd.org, Pav Lucistnik , Michael Nottebrock Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Fri, 22 Jun 2007 10:18:24 -0400 (EDT) On Thu, 21 Jun 2007, Abdullah Ibn Hamad Al-Marri wrote: > On 6/21/07, Mikhail Teterin wrote: >> On 21 2007, you wrote: >> = Hello, >> = >> = No one is willing to get this sorted out at all? :) >> >> I'm most willing, but I'd like a confirmation, that my port works for more >> than one person (myself). >> >> Have you tried it, Abdullah? >> >> -mi Sorry, gang, I've moved, been to weddings, batchelor parties, funerals, and started a new job. I'll attempt to look at this this weekend, but I make no promises. -- ------------------------------------------------------------------------ Philip M. Gollucci (philip@riderway.com) 323.219.4708 Senior System Admin - Riderway, Inc. http://riderway.com 1024D/EC88A0BF 0DE5 C55C 6BF3 B235 2DAB B89E 1324 9B4F EC88 A0BF Work like you don't need the money, love like you'll never get hurt, and dance like nobody's watching. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: ports/100067: commit references a PR Date: Wed, 27 Jun 2007 17:31:24 +0000 (UTC) mi 2007-06-27 17:31:14 UTC FreeBSD ports repository Modified files: devel/gdb6 Makefile distinfo pkg-descr pkg-plist Removed files: devel/gdb6/files fbsd4.h freebsd-uthread.c kvm-fbsd-alpha.h kvm-fbsd-amd64.h kvm-fbsd-i386.h kvm-fbsd-sparc64.h kvm-fbsd.c nm-fbsd.h patch-Makefile.in patch-amd64-tdep.c patch-amd64-tdep.h patch-config_alpha_fbsd.mh patch-config_alpha_nm-fbsd.h patch-config_i386_fbsd.mh patch-config_i386_fbsd64.mh patch-config_i386_nm-fbsd.h patch-config_powerpc_fbsd.mh patch-config_powerpc_fbsd.mt patch-config_sparc_fbsd.mh patch-config_sparc_fbsd.mt patch-config_sparc_nm-fbsd.h patch-config_sparc_tm-fbsd.h patch-configure.host patch-i386%nm-fbsd64.h patch-i386fbsd-tdep.c patch-main.c patch-ppcfbsd-nat.c patch-ppcfbsd-tdep.c patch-ppcfbsd-tdep.h patch-rs6000-tdep.c patch-target.c patch-target.h Log: Update the stale port from a 3 year-old snapshot to the most recent release 6.6 based on own work and that of the PR's submitter. Our patches appear to be part of the distribution mostly. Many thanks to the previous maintainer for his diligence and hardwork. Begin bringing INSIGHT (gdb's GUI-frontend) in. Insight is currently broken, but enabling it (via OPTIONS) will allow someone with ITk/Iwidgets expertise to port it to the recent version of ITk, as installed by the itk port. Take over maintainership for the time being. PR: 100067 Submitted by: Philip M. Gollucci Approved by: maintainer timeout Revision Changes Path 1.48 +69 -38 ports/devel/gdb6/Makefile 1.27 +6 -3 ports/devel/gdb6/distinfo 1.3 +0 -21 ports/devel/gdb6/files/fbsd4.h (dead) 1.5 +0 -994 ports/devel/gdb6/files/freebsd-uthread.c (dead) 1.3 +0 -81 ports/devel/gdb6/files/kvm-fbsd-alpha.h (dead) 1.3 +0 -131 ports/devel/gdb6/files/kvm-fbsd-amd64.h (dead) 1.4 +0 -136 ports/devel/gdb6/files/kvm-fbsd-i386.h (dead) 1.3 +0 -98 ports/devel/gdb6/files/kvm-fbsd-sparc64.h (dead) 1.3 +0 -523 ports/devel/gdb6/files/kvm-fbsd.c (dead) 1.2 +0 -39 ports/devel/gdb6/files/nm-fbsd.h (dead) 1.2 +0 -11 ports/devel/gdb6/files/patch-Makefile.in (dead) 1.2 +0 -15 ports/devel/gdb6/files/patch-amd64-tdep.c (dead) 1.2 +0 -16 ports/devel/gdb6/files/patch-amd64-tdep.h (dead) 1.4 +0 -10 ports/devel/gdb6/files/patch-config_alpha_fbsd.mh (dead) 1.3 +0 -10 ports/devel/gdb6/files/patch-config_alpha_nm-fbsd.h (dead) 1.6 +0 -10 ports/devel/gdb6/files/patch-config_i386_fbsd.mh (dead) 1.2 +0 -10 ports/devel/gdb6/files/patch-config_i386_fbsd64.mh (dead) 1.6 +0 -12 ports/devel/gdb6/files/patch-config_i386_nm-fbsd.h (dead) 1.2 +0 -10 ports/devel/gdb6/files/patch-config_powerpc_fbsd.mh (dead) 1.2 +0 -13 ports/devel/gdb6/files/patch-config_powerpc_fbsd.mt (dead) 1.4 +0 -12 ports/devel/gdb6/files/patch-config_sparc_fbsd.mh (dead) 1.3 +0 -7 ports/devel/gdb6/files/patch-config_sparc_fbsd.mt (dead) 1.5 +0 -33 ports/devel/gdb6/files/patch-config_sparc_nm-fbsd.h (dead) 1.3 +0 -12 ports/devel/gdb6/files/patch-config_sparc_tm-fbsd.h (dead) 1.2 +0 -13 ports/devel/gdb6/files/patch-configure.host (dead) 1.4 +0 -12 ports/devel/gdb6/files/patch-i386%nm-fbsd64.h (dead) 1.2 +0 -11 ports/devel/gdb6/files/patch-i386fbsd-tdep.c (dead) 1.2 +0 -53 ports/devel/gdb6/files/patch-main.c (dead) 1.2 +0 -196 ports/devel/gdb6/files/patch-ppcfbsd-nat.c (dead) 1.2 +0 -347 ports/devel/gdb6/files/patch-ppcfbsd-tdep.c (dead) 1.2 +0 -36 ports/devel/gdb6/files/patch-ppcfbsd-tdep.h (dead) 1.2 +0 -13 ports/devel/gdb6/files/patch-rs6000-tdep.c (dead) 1.6 +0 -21 ports/devel/gdb6/files/patch-target.c (dead) 1.2 +0 -10 ports/devel/gdb6/files/patch-target.h (dead) 1.6 +3 -1 ports/devel/gdb6/pkg-descr 1.10 +260 -2 ports/devel/gdb6/pkg-plist _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org" From: "Abdullah Ibn Hamad Al-Marri" To: "Mikhail Teterin" Cc: bug-followup@freebsd.org, "Philip M. Gollucci" , "Pav Lucistnik" , "Michael Nottebrock" Subject: Re: ports/100067: New port: devel/gdb65 GNU GDB 6.5 Date: Wed, 27 Jun 2007 23:18:21 +0300 T24gNi8yMi8wNywgTWlraGFpbCBUZXRlcmluIDxtaStrZGVAYWxkYW4uYWxnZWJyYS5jb20+IHdy b3RlOgo+IE9uINC/J9GP0YLQvdC40YbRjyAyMiDRh9C10YDQstC10L3RjCAyMDA3LCB5b3Ugd3Jv dGU6Cj4gPSBZZXMsIEkgY2FuIGNvbmZpcm0sIGl0IHdvcmtzIGluIEZyZWVCU0QgNy4wIEFNRDY0 LCBhbmQgRnJlZUJTRAo+ID0gNi4yLVNUQUJMRSBpMzg2IHdpdGggQ1BVVFlQRSB1c2VkIGluIGNv bXBpbGUuCj4KPiBJIGZpZ3VyZWQgdGhlICJDUFVUWVBFIiB0aGluZyBvdXQuLi4gSW5kZWVkLCB3 aGVuIENGTEFHUyBhcmUgbm90IG1vZGlmaWVkCj4gaW4gL2V0Yy9tYWtlLmNvbmYgX2F0IGFsbF8s IHRoZSBkZWZhdWx0Cj4gb25lcyAiLU8yIC1mb21pdC1mcmFtZS1wb2ludGVyIC1waXBlICIgY29u dGFpbiBhIGJsYW5rIHNwYWNlIGF0IHRoZSBlbmQsCj4gc29tZWhvdy4uLgo+Cj4gVGhpcyBmcmVh a3MgZ2RiJ3MgcGlja3kgY29uZmlndXJlIG91dC4uLgo+Cj4gSSBwdXQgYSB3b3JrLWFyb3VuZCBp bnRvIHRoZSBwb3J0J3MgbWFrZWZpbGUuLi4KPgo+ICAgICAgICAgLW1pCgpNaWtoYWlsLAoKVGhh bmtzIGZvciBtYWtpbmcgdGhpcyBwb3J0IGludG8gcG9ydHMsIHRoYW5rIHlvdSBQaGlsaXAgYW5k IG90aGVycwpmb3IgdGhlIGhhcmQgd29yayB0byBtYWtlIHRoaXMgaGFwcGVucyBhZnRlciB3YWl0 aW5nIGZvciAzIHllYXJzLiA6KQoKLS0gClJlZ2FyZHMsCgotQWJkdWxsYWggSWJuIEhhbWFkIEFs LU1hcnJpCkFyYWIgUG9ydGFsCmh0dHA6Ly93d3cuV2VBcmFiLk5ldC8K State-Changed-From-To: open->closed State-Changed-By: pav State-Changed-When: Tue Aug 28 21:50:05 UTC 2007 State-Changed-Why: devel/gdb6 port is now at 6.6 http://www.freebsd.org/cgi/query-pr.cgi?pr=100067 >Unformatted: