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] Input from user from extended breakpoint `stop'function


http://sourceware.org/bugzilla/show_bug.cgi?id=12686

--- Comment #1 from Kevin Pouget <kevin.pouget at gmail dot com> 2011-07-01 13:55:42 UTC ---
http://sourceware.org/ml/gdb-patches/2011-04/msg00373.html
On Wed, Apr 20, 2011 at 9:32 PM, Tom Tromey <tromey@redhat.com> wrote:
> I'm not really sure of the implications

changing the "terminal ownership" during the gdb.Breakpoint::stop callback can
lead GDB to a freeze:

=================================

kevin@kevin:/tmp$ cat sleeper.c 
int main(){
    sleep(50);
}

=================================

kevin@kevin:/tmp$ cat sleeper-gdb.py 
class test(gdb.Breakpoint):
    def stop(self):
        import pdb;pdb.set_trace()
        return False

test("sleep")

=================================

gdb-git-master ./sleeper -nx
GNU gdb (GDB) 7.3.50.20110701-cvs
Breakpoint 1 at 0x4003c8
(gdb) run
Starting program: /tmp/sleeper 
> /tmp/sleeper-gdb.py(4)stop()
-> return False
(Pdb) 
[1]+  Stopped                 gdb-git-master ./sleeper -nx
kevin@kevin:/tmp$ fg
gdb-git-master ./sleeper -nx

(Pdb) c

============ frozen =============

#0  0x00007fcb1f59262a in sigsuspend () from /lib64/libc.so.6
#1  0x000000000049ec84 in linux_nat_wait_1 (ops=<optimized out>, ptid=...,
ourstatus=0x7fff88c02220, target_options=0) at
../../../srcs/git/gdb-fsf/gdb/linux-nat.c:3616
#2  0x000000000049f98c in linux_nat_wait (ops=0x1b434b0, ptid=...,
ourstatus=0x7fff88c02220, target_options=0) at
../../../srcs/git/gdb-fsf/gdb/linux-nat.c:3833
#3  0x0000000000586afc in target_wait (ptid=..., status=0x7fff88c02220,
options=<optimized out>) at ../../../srcs/git/gdb-fsf/gdb/target.c:2534
#4  0x000000000055778a in wait_for_inferior () at
../../../srcs/git/gdb-fsf/gdb/infrun.c:2670
#5  0x0000000000557a4b in proceed (addr=<optimized out>,
siggnal=TARGET_SIGNAL_0, step=0) at ../../../srcs/git/gdb-fsf/gdb/infrun.c:2236
#6  0x000000000054b91f in run_command_1 (args=0x0, from_tty=1,
tbreak_at_main=<optimized out>) at ../../../srcs/git/gdb-fsf/gdb/infcmd.c:602
#7  0x000000000045c685 in execute_command (p=0x1b0f151 "", from_tty=1) at
../../../srcs/git/gdb-fsf/gdb/top.c:438
#8  0x0000000000568618 in command_handler (command=0x1b0f150 "") at
../../../srcs/git/gdb-fsf/gdb/event-top.c:499
#9  0x000000000056908c in command_line_handler (rl=<optimized out>) at
../../../srcs/git/gdb-fsf/gdb/event-top.c:702
#10 0x00000000006413f9 in rl_callback_read_char () at
../../../srcs/git/gdb-fsf/readline/callback.c:220
#11 0x0000000000568689 in rl_callback_read_char_wrapper (client_data=<optimized
out>) at ../../../srcs/git/gdb-fsf/gdb/event-top.c:177
#12 0x0000000000567528 in process_event () at
../../../srcs/git/gdb-fsf/gdb/event-loop.c:402
#13 process_event () at ../../../srcs/git/gdb-fsf/gdb/event-loop.c:352
#14 0x0000000000567c68 in gdb_do_one_event (data=<optimized out>) at
../../../srcs/git/gdb-fsf/gdb/event-loop.c:467
#15 gdb_do_one_event (data=<optimized out>) at
../../../srcs/git/gdb-fsf/gdb/event-loop.c:417
...

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