From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17303 invoked by alias); 19 Apr 2011 14:42:09 -0000 Received: (qmail 17292 invoked by uid 22791); 19 Apr 2011 14:42:08 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-vx0-f169.google.com (HELO mail-vx0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Apr 2011 14:41:51 +0000 Received: by vxk20 with SMTP id 20so5843832vxk.0 for ; Tue, 19 Apr 2011 07:41:50 -0700 (PDT) Received: by 10.220.92.71 with SMTP id q7mr1735628vcm.114.1303224110212; Tue, 19 Apr 2011 07:41:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.187.66 with HTTP; Tue, 19 Apr 2011 07:41:30 -0700 (PDT) From: Kevin Pouget Date: Tue, 19 Apr 2011 14:42:00 -0000 Message-ID: Subject: [Python] Input from user from extended breakpoint `stop' function To: gdb@sourceware.org Cc: pmuldoon@redhat.com Content-Type: text/plain; charset=ISO-8859-1 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-04/txt/msg00099.txt.bz2 Hello, is there any function provided by GDB to read from the terminal ? (I still don't know much about Python) I'm facing a problem when I was to ask a question the user from an extended breakpoint `stop' function: try class MyBreakpoint (gdb.Breakpoint): def stop (self): bug = raw_input("Input ?") print "--> ", bug return True MyBreakpoint(spec="main") and you will see this output: > (gdb) source sigttin.py > Breakpoint 1 at 0x400579 > (gdb) r > Starting program: /home/kevin/a.out > Input ? > [1]+ Stopped gdb-git a.out > kevin@kevin:~$ fg > gdb-git a.out > hello > --> hello > Breakpoint 1, 0x0000000000400579 in main () because GDB receives a SIGTTIN ("SIGTTIN is the signal sent to a process when it attempts to read from the tty while in the background." says wikipedia), which somehow makes sense. Any solution, or shall I send a bug report? cordially, Kevin