Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Kevin Pouget <kevin.pouget@gmail.com>
To: gdb@sourceware.org
Cc: pmuldoon@redhat.com
Subject: [Python] Input from user from extended breakpoint `stop' function
Date: Tue, 19 Apr 2011 14:42:00 -0000	[thread overview]
Message-ID: <BANLkTimrLOuWZSsA8t315wRAhzxNPKkFVA@mail.gmail.com> (raw)

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


             reply	other threads:[~2011-04-19 14:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-19 14:42 Kevin Pouget [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTimrLOuWZSsA8t315wRAhzxNPKkFVA@mail.gmail.com \
    --to=kevin.pouget@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=pmuldoon@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox