From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5213 invoked by alias); 3 Oct 2006 03:53:14 -0000 Received: (qmail 5205 invoked by uid 22791); 3 Oct 2006 03:53:14 -0000 X-Spam-Check-By: sourceware.org Received: from web34211.mail.mud.yahoo.com (HELO web34211.mail.mud.yahoo.com) (66.163.178.126) by sourceware.org (qpsmtpd/0.31) with SMTP; Tue, 03 Oct 2006 03:53:12 +0000 Received: (qmail 80503 invoked by uid 60001); 3 Oct 2006 03:53:10 -0000 Message-ID: <20061003035310.80501.qmail@web34211.mail.mud.yahoo.com> Received: from [70.82.222.144] by web34211.mail.mud.yahoo.com via HTTP; Mon, 02 Oct 2006 20:53:10 PDT Date: Tue, 03 Oct 2006 03:53:00 -0000 From: Steve Freeland Subject: Re: Watchpoints in multithreaded programs To: Daniel Jacobowitz Cc: gdb@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00009.txt.bz2 Is there anything particularly wrong with just setting the watchpoint indiv= idually in each of the threads? I haven't a clue about portability, but on I've checked on i3= 86 Linux and this seems to work... at least, it solves my problem. I can clean this up and m= ake it submittable as a patch, but first I'd like to know if there's a problem with it concept= ually, as I've never worked with gdb internals before: struct i386_linux_dr_operation { int regnum; unsigned long value; }; static int i386_linux_dr_set_for_tid(int tid, int regnum, unsigned long val= ue) { int result =3D 0; errno =3D 0; ptrace (PTRACE_POKEUSER, tid, offsetof (struct user, u_debugreg[regnum]), value); if (errno !=3D 0) { perror_with_name (_("Couldn't write debug register")); result =3D 1; } return result; } static int i386_linux_perform_dr_operation(struct thread_info *t, void *arg) { struct i386_linux_dr_operation *op =3D arg; return i386_linux_dr_set_for_tid(TIDGET(t->ptid), op->regnum, op->value= ); } static void i386_linux_dr_set (int regnum, unsigned long value) { int tid =3D TIDGET (inferior_ptid); if (tid =3D=3D 0) { i386_linux_dr_set_for_tid(PIDGET(inferior_ptid), regnum, value); } else { struct i386_linux_dr_operation op =3D { regnum, value }; iterate_over_threads(i386_linux_perform_dr_operation, &op); } } ----- Original Message ---- From: Daniel Jacobowitz To: Steve Freeland Cc: gdb@sources.redhat.com Sent: Sunday, October 1, 2006 7:24:43 PM Subject: Re: Watchpoints in multithreaded programs On Sun, Oct 01, 2006 at 02:23:27PM -0700, Steve Freeland wrote: > So... I'm a bit confused. Is the manual out of date? Did the > "watchthreads" patch never make it into mainline builds for some > reason? It never did. Discussion trailed off and we never heard anything else about it from the submitter. I recall seeing a few weeks ago that there is an updated version in the Red Hat SRPMs. Could any of the list subscribers from Red Hat comment - is that version fit for submission? --=20 Daniel Jacobowitz CodeSourcery