Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* [Python] Input from user from extended breakpoint `stop' function
@ 2011-04-19 14:42 Kevin Pouget
  2011-04-19 20:10 ` Phil Muldoon
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Pouget @ 2011-04-19 14:42 UTC (permalink / raw)
  To: gdb; +Cc: pmuldoon

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-04-21 11:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-19 14:42 [Python] Input from user from extended breakpoint `stop' function Kevin Pouget
2011-04-19 20:10 ` Phil Muldoon
2011-04-19 20:44   ` Andreas Schwab
2011-04-19 21:30     ` Phil Muldoon
2011-04-20  7:36       ` Kevin Pouget
2011-04-20  7:48         ` Andreas Schwab
2011-04-21 11:38           ` Kevin Pouget
2011-04-20 15:41       ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox