This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug python/12686] New: Input from user from extended breakpoint`stop' function


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]