Package: gdb
Version: 6.3-5
Severity: normal
Tags: patch

When terminal options include 'tostop' (stop on output from non-foreground
process), which is set when running under Midnight Commander, gdb gets
SIGTTOU and stops when pending breakpoint is resolved.

Here's my session:

(gdb) b localize.cpp:54
No source file named localize.cpp.
Make breakpoint pending on future shared library load? (y or [n]) y

Breakpoint 1 (localize.cpp:54) pending.
(gdb) r
Starting program: /home/ghost/Work/llvm/Debug/bin/opt -globalsmodref-aa -load 
/home/ghost/Work/Research/Implementation/llvm_feasibility/localize.so -localize 
a.bc -o a_l.bc -f

[1]+  Stopped                 gdb opt

After I "run fg", the output is:

Breakpoint 2 at 0xb7fe482b: file localize.cpp, line 54.
Pending breakpoint "localize.cpp:54" resolved

After I exchange the lines:

          target_terminal_inferior ();
          re_enable_breakpoints_in_shlibs ();

in infrun.c (line 2121), gdb works as expected. The problem is that 
're_enable_breakpoints_in_shlibs' prints the 'Pending breakpoint resolved"
message, while gdb does not own the terminal.


-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (620, 'testing'), (600, 'unstable'), (550, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.11-1-zigzag
Locale: LANG=C, LC_CTYPE=ru_RU.KOI8-R (charmap=KOI8-R)

Versions of packages gdb depends on:
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared libraries an
ii  libncurses5                 5.4-4        Shared libraries for terminal hand
ii  libreadline4                4.3-11       GNU readline and history libraries

-- no debconf information
--- infrun.c.orig	2005-04-25 15:22:41.000000000 +0400
+++ infrun.c	2005-04-25 15:22:44.000000000 +0400
@@ -2114,12 +2114,14 @@
 	     to propagate relevant changes (stop, section table
 	     changed, ...) up to other layers.  */
 	  SOLIB_ADD (NULL, 0, &current_target, auto_solib_add);
-	  target_terminal_inferior ();
+
 
 	  /* Try to reenable shared library breakpoints, additional
 	     code segments in shared libraries might be mapped in now. */
 	  re_enable_breakpoints_in_shlibs ();
 
+	  target_terminal_inferior ();
+
 	  /* If requested, stop when the dynamic linker notifies
 	     gdb of events.  This allows the user to get control
 	     and place breakpoints in initializer routines for

Reply via email to