From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28123 invoked by alias); 1 May 2009 19:31:32 -0000 Received: (qmail 28115 invoked by uid 22791); 1 May 2009 19:31:31 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_13,SPF_PASS,WEIRD_PORT X-Spam-Check-By: sourceware.org Received: from imr1.ericy.com (HELO imr1.ericy.com) (198.24.6.9) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 May 2009 19:31:25 +0000 Received: from eusrcmw750.eamcs.ericsson.se (eusrcmw750.exu.ericsson.se [138.85.77.50]) by imr1.ericy.com (8.13.1/8.13.1) with ESMTP id n41JfDg2030693 for ; Fri, 1 May 2009 14:41:13 -0500 Received: from ecamlmw720.eamcs.ericsson.se ([142.133.1.72]) by eusrcmw750.eamcs.ericsson.se with Microsoft SMTPSVC(6.0.3790.1830); Fri, 1 May 2009 14:31:23 -0500 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: Setting breakpoint misbehaving with all threads running in Non-Stop on Linux Date: Fri, 01 May 2009 19:31:00 -0000 Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA075CB605@ecamlmw720.eamcs.ericsson.se> From: "Marc Khouzam" To: 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: 2009-05/txt/msg00002.txt.bz2 Hi again, I'm using HEAD (from yesterday) with Non-Stop locally on Linux. I notice that when all my threads are running, setting a breakpoint is misbehaving. First, should I be able to set a breakpoint when all threads are running (on Linux)? Either way though, setting a bp reports an error -with- a breakpoint id, and then 'info break' shows the breakpoint as being set. However, the breakpoint does not actually hit. See below for the session. Thanks > gdb -i mi ~"GNU gdb (GDB) 6.8.50.20090430-cvs\n" ~"Copyright (C) 2009 Free Software Foundation, Inc.\n" ~"License GPLv3+: GNU GPL version 3 or later \n" ~"This is free software: you are free to change and redistribute it.\n" ~"There is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\n" ~"and \"show warranty\" for details.\n" ~"This GDB was configured as \"i686-pc-linux-gnu\".\n" ~"For bug reporting instructions, please see:\n" ~".\n" (gdb)=20 file a.out &"file a.out\n" ~"Reading symbols from /local/home/lmckhou/testing/a.out..." ~"done.\n" ^done (gdb)=20 l 1 &"l 1\n" ~"1\t#include \n" ~"2\t#include \n" ~"3\t#include \n" ~"4\t#include \n" ~"5\t\n" ~"6\tvoid *thread_exec(void *ptr)\n" ~"7\t{\n" ~"8\t int j =3D 0;\n" ~"9\t for (int i=3D0;i<30;i++) {\n" ~"10\t j++;\n" ^done (gdb)=20 l &"l\n" ~"11\t sleep(1);\n" ~"12\t }\n" ~"13\t}\n" ~"14\t\n" ~"15\tint main()\n" ~"16\t{\n" ~"17\t pthread_t thread2;\n" ~"18\t char *message2 =3D \"Thread 2\";\n" ~"19\t\n" ~"20\t pthread_create(&thread2, NULL, thread_exec, (void*) message2);\n" ^done (gdb)=20 l &"l\n" ~"21\t\n" ~"22\t sleep(15);\n" ~"23\t\n" ~"24\t pthread_join(thread2, NULL);\n" ~"25\t\n" ~"26\t printf(\"Thread 2 finished\\n\");\n" ~"27\t\n" ~"28\t return 0;\n" ~"29\t}\n" ^done (gdb)=20 set target-async on &"set target-async on\n" ^done (gdb)=20 set pagination off &"set pagination off\n" ^done (gdb)=20 set non-stop on &"set non-stop on\n" ^done (gdb)=20 b 24 &"b 24\n" ~"Breakpoint 1 at 0x80485dc: file MultiThread.cc, line 24.\n" ^done (gdb)=20 run& &"run&\n" ~"Starting program: /local/home/lmckhou/testing/a.out \n" =3Dthread-group-created,id=3D"23591" =3Dthread-created,id=3D"1",group-id=3D"23591" ^running *running,thread-id=3D"1" =3Dlibrary-loaded,id=3D"/lib/ld-linux.so.2",target-name=3D"/lib/ld-linux.so= .2" ,host-name=3D"/lib/ld-linux.so.2",symbols-loaded=3D"0" (gdb)=20 =3Dlibrary-loaded,id=3D"/lib/libpthread.so.0",target-name=3D"/lib/libpthrea= d.s o.0",host-name=3D"/lib/libpthread.so.0",symbols-loaded=3D"0" =3Dlibrary-loaded,id=3D"/usr/lib/libstdc++.so.6",target-name=3D"/usr/lib/li= bst dc++.so.6",host-name=3D"/usr/lib/libstdc++.so.6",symbols-loaded=3D"0" =3Dlibrary-loaded,id=3D"/lib/libm.so.6",target-name=3D"/lib/libm.so.6",host= -na me=3D"/lib/libm.so.6",symbols-loaded=3D"0" =3Dlibrary-loaded,id=3D"/lib/libgcc_s.so.1",target-name=3D"/lib/libgcc_s.so= .1" ,host-name=3D"/lib/libgcc_s.so.1",symbols-loaded=3D"0" =3Dlibrary-loaded,id=3D"/lib/libc.so.6",target-name=3D"/lib/libc.so.6",host= -na me=3D"/lib/libc.so.6",symbols-loaded=3D"0" ~"[Thread debugging using libthread_db enabled]\n" =3Dthread-created,id=3D"2",group-id=3D"23591" ~"[New Thread 0xb7d6cba0 (LWP 23598)]\n" *running,thread-id=3D"2" info th &"info th\n" ~" 2 Thread 0xb7d6cba0 (LWP 23598) (running)\n" ~"* 1 Thread 0xb7d6d6b0 (LWP 23591) (running)\n" ^done (gdb)=20 =3D=3D Here all threads are running =3D=3D b 10 &"b 10\n" ~"Breakpoint 2 at 0x804857a: file MultiThread.cc, line 10.\n" &"Warning:\n" &"Cannot insert breakpoint 2.\n" &"Error accessing memory address 0x804857a: Input/output error.\n" &"\n" ^error,msg=3D"Warning:\nCannot insert breakpoint 2.\nError accessing memory address 0x804857a: Input/output error.\n" =3D=3D error but bp is shown in 'info break' (see below) =3D=3D (gdb)=20 b 11 &"b 11\n" ~"Breakpoint 3 at 0x804857e: file MultiThread.cc, line 11.\n" &"Warning:\n" &"Cannot insert breakpoint 2.\n" &"Error accessing memory address 0x804857a: Input/output error.\n" &"Cannot insert breakpoint 3.\n" &"Error accessing memory address 0x804857e: Input/output error.\n" &"\n" ^error,msg=3D"Warning:\nCannot insert breakpoint 2.\nError accessing memory address 0x804857a: Input/output error.\nCannot insert breakpoint 3.\nError accessing memory address 0x804857e: Input/output error.\n" =3D=3D Cummulative error above =3D=3D (gdb)=20 info b &"info b\n" ~"Num Type Disp Enb Address What\n" ~"1 breakpoint keep y 0x080485dc in main at MultiThread.cc:24\n" ~"2 breakpoint keep y 0x0804857a in thread_exec(void*) at MultiThread.cc:10\n" ~"3 breakpoint keep y 0x0804857e in thread_exec(void*) at MultiThread.cc:11\n" ^done =3D=3D Both 'failed' breakpoints show as installed, but they =3D=3D =3D=3D don't actually stop the thread. =3D=3D (gdb)=20 *stopped,reason=3D"breakpoint-hit",disp=3D"keep",bkptno=3D"1",frame=3D{addr= =3D"0x0 80485dc",func=3D"main",args=3D[],file=3D"MultiThread.cc",fullname=3D"/local= /home /lmckhou/testing/MultiThread.cc",line=3D"24"},thread-id=3D"1",stopped-thread s=3D["1"]