This is the mail archive of the gdb-patches@sourceware.cygnus.com 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]

[RFC]: internal_error should call target_terminal_ours


I just encountered a situation where internal_error was called
while the target program was running, resulting in the following:

gdb-internal-error: gdbarch: gdbarch_breakpoint_from_pc invalid
An internal GDB error was detected.  This may make make further
debugging unreliable.  Continue this debugging session? (y or n) 
Suspended (tty input)
%] msnyder<547>% 

As you can see, instead of waiting for my input, GDB suspended
because it didn't own the tty.

It's probably a bad thing (tm) to call internal_error while the
inferior is running, but in case it does happen, I wonder what
people think about the following?

Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.5
diff -C5 -r1.5 utils.c
*** utils.c     2000/03/20 22:15:58     1.5
--- utils.c     2000/03/29 20:09:24
***************
*** 717,726 ****
--- 717,727 ----
  NORETURN void
  internal_error (char *string, ...)
  {
    va_list ap;
    va_start (ap, string);
+   target_terminal_ours ();
    internal_verror (string, ap);
    va_end (ap);
  }
  
  /* The strerror() function can return NULL for errno values that are

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]