From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12535 invoked by alias); 6 Jun 2011 21:03:37 -0000 Received: (qmail 12523 invoked by uid 22791); 6 Jun 2011 21:03:37 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Jun 2011 21:03:19 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p56L3JlA003752 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 6 Jun 2011 17:03:19 -0400 Received: from host1.jankratochvil.net (ovpn-113-49.phx2.redhat.com [10.3.113.49]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p56L3HDx018951 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 6 Jun 2011 17:03:18 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p56L3GeZ007608; Mon, 6 Jun 2011 23:03:16 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p56L3F9N007603; Mon, 6 Jun 2011 23:03:15 +0200 Date: Mon, 06 Jun 2011 21:03:00 -0000 From: Jan Kratochvil To: logitech Cc: gdb@sourceware.org Subject: Re: Sending signal to inferior program. Message-ID: <20110606210315.GA6325@host1.jankratochvil.net> References: <31785488.post@talk.nabble.com> <20110606181746.GA32266@host1.jankratochvil.net> <31786813.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <31786813.post@talk.nabble.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2011-06/txt/msg00036.txt.bz2 On Mon, 06 Jun 2011 22:25:16 +0200, logitech wrote: > the same thing as forking a thread from gdb BTW GDB is not thread safe so the forked thread must not modify anything of GDB, that is it is easier to just fork() from GDB, which is mostly the same as running a completely separate program - for example by the GDB `shell' command. > Instead of CTRL-C, I want the signal to be sent from gdb to the prog. I want > to actually break the execution of the program at a specific time, so to > send the signal to the program at say 100ms. Maybe like this way? cat >x < This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: . Id Target Id Frame * 1 process 6427 "sleep" (running) (gdb) break-in-1sec 2011-06-06T23:01:03+0200 2011-06-06T23:01:04+0200 (gdb) [process 6427] #1 stopped. 0x00007ffff7aeccd0 in __nanosleep_nocancel () at ../sysdeps/unix/syscall-template.S:82 82 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS) bt #0 0x00007ffff7aeccd0 in __nanosleep_nocancel () at ../sysdeps/unix/syscall-template.S:82 #1 0x0000000000403c58 in rpl_nanosleep (requested_delay=0x7fffffffdc20, remaining_delay=0x0) at nanosleep.c:93 #2 0x00000000004032c5 in xnanosleep (seconds=) at xnanosleep.c:111 #3 0x0000000000401416 in main (argc=, argv=) at sleep.c:147 (gdb) info threads Id Target Id Frame * 1 process 6427 "sleep" 0x00007ffff7aeccd0 in __nanosleep_nocancel () at ../sysdeps/unix/syscall-template.S:82 (gdb) _ If one runs that break-in-1sec directly from the ./x script it does not work, I have filed for it: http://sourceware.org/bugzilla/show_bug.cgi?id=12850 Regards, Jan