From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 619 invoked by alias); 5 Apr 2007 11:57:45 -0000 Received: (qmail 608 invoked by uid 22791); 5 Apr 2007 11:57:44 -0000 X-Spam-Check-By: sourceware.org Received: from inet-tsb5.toshiba.co.jp (HELO inet-tsb5.toshiba.co.jp) (202.33.96.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 05 Apr 2007 12:57:39 +0100 Received: from tsb-wall.toshiba.co.jp ([133.199.160.134]) by inet-tsb5.toshiba.co.jp with ESMTP id l35BvaZJ025317 for ; Thu, 5 Apr 2007 20:57:36 +0900 (JST) Received: (from root@localhost) by tsb-wall.toshiba.co.jp id l35BvaLx004523 for gdb@sourceware.org; Thu, 5 Apr 2007 20:57:36 +0900 (JST) Received: from ovp1.toshiba.co.jp [133.199.192.124] by tsb-wall.toshiba.co.jp with ESMTP id WAA04516; Thu, 5 Apr 2007 20:57:36 +0900 Received: from mx.toshiba.co.jp (localhost [127.0.0.1]) by ovp1.toshiba.co.jp with ESMTP id l35BvZJr014214 for ; Thu, 5 Apr 2007 20:57:35 +0900 (JST) Received: from mx.tjsys.co.jp by toshiba.co.jp id l35BvZEo015472; Thu, 5 Apr 2007 20:57:35 +0900 (JST) Received: from is-com10 (IDENT:U2FsdGVkX1856IBa4n1FGnT6gkfdBkgvdKdk3r1+Tx4@filtering.tjsys.co.jp [157.79.3.71]) by mx.tjsys.co.jp (8.12.11/8.12.11) with SMTP id l35BvZx6019591 for ; Thu, 5 Apr 2007 20:57:35 +0900 (JST) Received: from localhost ([157.79.51.145]) by ims.tjsys.co.jp (iPlanet Messaging Server 5.2 HotFix 2.10 (built Dec 26 2005)) with ESMTP id <0JG0006T4X7WQC@ims.tjsys.co.jp> for gdb@sourceware.org; Thu, 05 Apr 2007 20:57:32 +0900 (JST) Date: Thu, 05 Apr 2007 11:57:00 -0000 From: Emi SUZUKI Subject: single-stepping and internal breakpoints on a multi-threaded program To: gdb@sourceware.org Message-id: <20070405.205731.12335149.emi-suzuki@tjsys.co.jp> MIME-version: 1.0 X-Mailer: Mew version 5.2 on Emacs 22.0.90 / Mule 5.0 (SAKAKI) Content-type: Multipart/Mixed; boundary="--Next_Part(Thu_Apr_05_20_57_31_2007_215)--" Content-transfer-encoding: 7bit X-WAuditID: 0704052057320000028570 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00031.txt.bz2 ----Next_Part(Thu_Apr_05_20_57_31_2007_215)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-length: 2683 Hello members, My colleague has found a problem about handling single-stepping on a multi-threaded target running on Linux box. The attached program makes two sub threads, and we do single-stepping on one of them. When the target get stopped by a internal breakpoint hit (ex. thread creation, thread death, shared library loading) during singe-stepping, GDB unconditionally resume all the thread and it result in running over the range of single-stepping. The session log below shows one of the phenomena reproduced on X86 FC6; the problem occured when the second thread was created. I can see them 10-20% of the time on our Cell hardware running FC5 (note that the program is compiled just for PPC64) and X86 FC5/FC6. ---- GNU gdb 6.6.50.20070330-cvs Copyright (C) 2007 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"... Using host libthread_db library "/lib/libthread_db.so.1". (gdb) b 14 Breakpoint 1 at 0x80484fa: file mt.c, line 14. (gdb) l 14 9 { 10 int i; 11 int cnt = *((int *) arg); 12 pid_t pid = getpid(); 13 14 for (i=0; i #include #include #include #include void * counter(void *arg) { int i; int cnt = *((int *) arg); pid_t pid = getpid(); for (i=0; i