This is the mail archive of the gdb-patches@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] |
Greetings, Problem: - gdb calls target_terminal_inferior(), - performs other stuff, which could issue warnings. warning() switches gdb to the foreground. - calls target_wait without switching the terminal back to inferior, which then prevents inferior from working. Demonstration: $ cat pp.c int main() { char buf[1]; while (0 != read(0, buf, 1)) write(1, buf, 1); return 0; } $ gcc -static pp.c # -static is needed to trigger warning with # my version of gcc and glibc $ gdb ./a.out GNU gdb 6.8 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-linux"... (gdb) r warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.) warning: (Internal error: pc 0x8048100 in read in psymtab, but not in symtab.) warning: (Internal error: pc 0x8048100 in read in psymtab, but not in symtab.) Program received signal SIGTTIN, Stopped (tty input). 0xffffe410 in __kernel_vsyscall () (gdb) c Program received signal SIGTTIN, Stopped (tty input). 0xffffe410 in __kernel_vsyscall () Note: the 'in psymtab, but not in symtab' warning appears to be triggered by a separate bug in gold, but that's irrelevant: there could be any other warning, and the effect would be the same. Proposed patch below. Thanks, -- Paul Pluzhnikov -------------------------------------------------------------------------------- 2008-04-21 Paul Pluzhnikov <ppluzhnikov@google.com> * gdb/infrun.c (wait_for_inferior): Call target_terminal_inferior before blocking.
Attachment:
patch.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |