From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1044 invoked by alias); 6 Jun 2011 17:32:28 -0000 Received: (qmail 1035 invoked by uid 22791); 6 Jun 2011 17:32:28 -0000 X-SWARE-Spam-Status: No, hits=2.2 required=5.0 tests=AWL,BAYES_40,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from sam.nabble.com (HELO sam.nabble.com) (216.139.236.26) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Jun 2011 17:32:14 +0000 Received: from isper.nabble.com ([192.168.236.156]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1QTdev-0001r9-8v for gdb@sourceware.org; Mon, 06 Jun 2011 10:32:13 -0700 Message-ID: <31785488.post@talk.nabble.com> Date: Mon, 06 Jun 2011 17:32:00 -0000 From: logitech To: gdb@sourceware.org Subject: Sending signal to inferior program. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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/msg00033.txt.bz2 Hi, I am currently working with the gdb source code. I wish to send a signal to the inferior program at a specific time. I tried forking a thread in gdb.c which sends signal to the inferior process. To get its pid, I declared an extern variable shared between gdb.c and linux-nat.c But this gives a seg fault. Also the signal doesn't seem to get delivered. In linux-nat.c if (debug_linux_nat) fprintf_unfiltered (gdb_stdlog, "linux_nat_wait: [%s]\n", target_pid_to_str (ptid)); gpid=ptid.pid; // gpid gets the pid value, the signal is sent to gpid from gdb.c Moreover when i debug this with flag set, gpid initially gets the value of pid of inferior, but later it becomes -1. Is there any other way in which I can accomplish this. Thanks -- View this message in context: http://old.nabble.com/Sending-signal-to-inferior-program.-tp31785488p31785488.html Sent from the Sourceware - gdb list mailing list archive at Nabble.com.