Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Phil Muldoon <pmuldoon@redhat.com>
To: Kevin Pouget <kevin.pouget@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: [Python] Input from user from extended breakpoint `stop' function
Date: Tue, 19 Apr 2011 20:10:00 -0000	[thread overview]
Message-ID: <m38vv6dmtz.fsf@redhat.com> (raw)
In-Reply-To: <BANLkTimrLOuWZSsA8t315wRAhzxNPKkFVA@mail.gmail.com> (Kevin	Pouget's message of "Tue, 19 Apr 2011 10:41:30 -0400")

Kevin Pouget <kevin.pouget@gmail.com> writes:

> Hello,
>
> is there any function provided by GDB to read from the terminal ?
> (I still don't know much about Python)

Nope, but in the context of this bug there might need to be.  GDB does a
few things with stdout/tty.

> 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.

I'm not sure what is going on here.  It seems GDB is not acting
correctly with the SIGTTIN.  I really do not know this area of GDB at
all.


> Any solution, or shall I send a bug report?

Bug report please.

Cheers,

Phil


  reply	other threads:[~2011-04-19 20:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-19 14:42 Kevin Pouget
2011-04-19 20:10 ` Phil Muldoon [this message]
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=m38vv6dmtz.fsf@redhat.com \
    --to=pmuldoon@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=kevin.pouget@gmail.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