This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/12686] New: Input from user from extended breakpoint`stop' function
- From: "kevin.pouget at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Wed, 20 Apr 2011 07:26:19 +0000
- Subject: [Bug python/12686] New: Input from user from extended breakpoint`stop' function
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=12686
Summary: Input from user from extended breakpoint `stop'
function
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: python
AssignedTo: unassigned@sourceware.org
ReportedBy: kevin.pouget@gmail.com
When you extend a Python breakpoint and override the `stop' function:
class MyBreakpoint (gdb.Breakpoint):
def stop (self):
bug = raw_input("Input ?")
print "--> ", bug
return True
MyBreakpoint(spec="main")
Python's `raw_input' will trigger the sending of 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 will send GDB to the background:
> (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 ()
--
From: Andreas Schwab <schwab@linux-m68k.org>
> The terminal still belongs to the inferior. Before gdb is doing any
> input it must call terminal_ours.
http://sourceware.org/ml/gdb/2011-04/msg00099.html
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.