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]

Re: [RFA] Don't talk about ptrace when there's none



>    Date: Sun, 9 Apr 2000 09:58:34 -0400 (EDT)
>    From: Eli Zaretskii <eliz@delorie.com>
> 
>    So what do people prefer, eventually?  I could:
> 
>      (a) install the changes posted by Elena, and have the error message
>      mention ptrace only if HAVE_PTRACE is defined;
> 
>    or
> 
>      (b) change the wording of the message so that it doesn't mention
>      ptrace at all, as suggested by Michael.
> 
>    I like the second alternative better, especially since, as I now
>    understand, ptrace is unused on many platforms.
> 
>    Comments?
> 
> I'm in favor for the second aternative too, especially since the Hurd
> does have ptrace that is only sporadically used in GDB.  It isn't used
> for inserting breakpoints, so mentioning ptrace in the error message
> would be misleading for the Hurd.

Okay, then how about the following patch?  Good enough to commit?


2000-04-11  Eli Zaretskii  <eliz@is.elta.co.il>

	* infrun.c (proceed, normal_stop): Change the error message about
	failure to insert breakpoints/watchpoints so that it makes sense
	even if ptrace is not used or no other processes can be active.


--- gdb/infrun.c~1	Sat Apr  1 19:41:12 2000
+++ gdb/infrun.c	Tue Apr 11 19:37:02 2000
@@ -1044,9 +1044,11 @@ proceed (CORE_ADDR addr, enum target_sig
       int temp = insert_breakpoints ();
       if (temp)
 	{
-	  print_sys_errmsg ("ptrace", temp);
+	  print_sys_errmsg ("insert_breakpoints", temp);
 	  error ("Cannot insert breakpoints.\n\
-The same program may be running in another process.");
+The same program may be running in another process,\n\
+or you may have requested too many hardware\n\
+breakpoints and/or watchpoints.\n");
 	}
 
       breakpoints_inserted = 1;
@@ -3384,9 +3386,11 @@ normal_stop (void)
   if (breakpoints_failed)
     {
       target_terminal_ours_for_output ();
-      print_sys_errmsg ("ptrace", breakpoints_failed);
+      print_sys_errmsg ("While inserting breakpoints", breakpoints_failed);
       printf_filtered ("Stopped; cannot insert breakpoints.\n\
-The same program may be running in another process.\n");
+The same program may be running in another process,\n\
+or you may have requested too many hardware breakpoints\n\
+and/or watchpoints.\n");
     }
 
   if (target_has_execution && breakpoints_inserted)

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