Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* gc ONE_PROCESS_WRITETEXT
@ 2008-12-28 18:53 Pedro Alves
  2008-12-28 19:14 ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2008-12-28 18:53 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 2184 bytes --]

Hi guys,

This drops the last bits of ONE_PROCESS_WRITETEXT macro from the
codebase, since no target/host actually defines this by now.

The "It might be running in another process" notice in normal_stop
when breakpoints fail to be removed is quite likelly related to this, and
although wasn't conditionalized on ONE_PROCESS_WRITETEXT, should be dropped as
well IMO, as it is confusing.  Would anyone miss it?  This was the 
reason I haven't checked it in as obvious yet.

The most complete description I could find of this macro was in gdb 4.6
sources:

 gdb/xm-hp300bsd.h-64-/* Kernel is a bit tenacious about sharing text segments, disallowing bpts.  */
 gdb/xm-hp300bsd.h:65:#define    ONE_PROCESS_WRITETEXT

 @c FIXME: "cannot insert breakpoints" error, v unclear.
 @c        Q in pending mail to Gilmore. ---pesch@cygnus.com, 26mar91
 @c        some light may be shed by looking at instances of
 @c        ONE_PROCESS_WRITETEXT.  But error message seems possible otherwise
 @c        too.  pesch, 20sep91
 Under some operating systems, breakpoints cannot be used in a program if
 any other process is running that program.  In this situation,
 attempting to run or continue a program with a breakpoint causes _GDBN__
 to stop the other process.

 When this happens, you have three ways to proceed:

 @enumerate
 @item
 Remove or disable the breakpoints, then continue.

 @item
 Suspend _GDBN__, and copy the file containing your program to a new name.
 Resume _GDBN__ and use the @code{exec-file} command to specify that _GDBN__
 should run your program under that name.  Then start your program again.

 @c FIXME: RMS commented here "Show example".  Maybe when someone
 @c explains the first FIXME: in this section...

And in this 1991 ChangeLog entry:

 Mon Sep  9 13:45:57 1991  John Gilmore  (gnu at cygint.cygnus.com)

        * breakpoint.c (insert_breakpoints):  Restore warning about
        the program might be running in another process, but only for
        systems with this brain death (#ifdef ONE_PROCESS_WRITETEXT).
        * xm-hp300bsd.h, xm-mips.h, xm-vax.h:  Define it.

I don't think we care about systems with this brain death anymore ...

-- 
Pedro Alves

[-- Attachment #2: one_process_writetext.diff --]
[-- Type: text/x-diff, Size: 4616 bytes --]

gdb/
2008-12-28  Pedro Alves  <pedro@codesourcery.com>

	Delete ONE_PROCESS_WRITETEXT leftovers.

	* breakpoint.c (insert_bp_location): Delete process_warning
	argument.  Adjust.
	(insert_breakpoint_locations): Adjust.
	(reattach_breakpoints): Adjust.
	* infrun.c (normal_stop): Drop "It might be running in another
	process" notice.

gdb/doc/
2008-12-28  Pedro Alves  <pedro@codesourcery.com>

	* gdbint.texinfo (Native Conditionals): Delete
	ONE_PROCESS_WRITETEXT description.

---
 gdb/breakpoint.c       |   19 +++++--------------
 gdb/doc/gdbint.texinfo |    5 -----
 gdb/infrun.c           |    1 -
 3 files changed, 5 insertions(+), 20 deletions(-)

Index: src/gdb/breakpoint.c
===================================================================
--- src.orig/gdb/breakpoint.c	2008-12-28 18:14:28.000000000 +0000
+++ src/gdb/breakpoint.c	2008-12-28 18:14:37.000000000 +0000
@@ -1009,14 +1009,14 @@ should_be_inserted (struct bp_location *
 
 /* Insert a low-level "breakpoint" of some type.  BPT is the breakpoint.
    Any error messages are printed to TMP_ERROR_STREAM; and DISABLED_BREAKS,
-   PROCESS_WARNING, and HW_BREAKPOINT_ERROR are used to report problems.
+   and HW_BREAKPOINT_ERROR are used to report problems.
 
    NOTE drow/2003-09-09: This routine could be broken down to an object-style
    method for each breakpoint or catchpoint type.  */
 static int
 insert_bp_location (struct bp_location *bpt,
 		    struct ui_file *tmp_error_stream,
-		    int *disabled_breaks, int *process_warning,
+		    int *disabled_breaks,
 		    int *hw_breakpoint_error)
 {
   int val = 0;
@@ -1159,9 +1159,6 @@ Note: automatically using hardware break
 	    }
 	  else
 	    {
-#ifdef ONE_PROCESS_WRITETEXT
-	      *process_warning = 1;
-#endif
 	      if (bpt->loc_type == bp_loc_hardware_breakpoint)
 		{
 		  *hw_breakpoint_error = 1;
@@ -1259,7 +1256,6 @@ insert_breakpoint_locations (void)
   int val = 0;
   int disabled_breaks = 0;
   int hw_breakpoint_error = 0;
-  int process_warning = 0;
 
   struct ui_file *tmp_error_stream = mem_fileopen ();
   make_cleanup_ui_file_delete (tmp_error_stream);
@@ -1280,7 +1276,7 @@ insert_breakpoint_locations (void)
 	continue;
 
       val = insert_bp_location (b, tmp_error_stream,
-				    &disabled_breaks, &process_warning,
+				    &disabled_breaks,
 				    &hw_breakpoint_error);
       if (val)
 	error = val;
@@ -1332,11 +1328,6 @@ insert_breakpoint_locations (void)
 			      "Could not insert hardware breakpoints:\n\
 You may have requested too many hardware breakpoints/watchpoints.\n");
 	}
-#ifdef ONE_PROCESS_WRITETEXT
-      if (process_warning)
-	fprintf_unfiltered (tmp_error_stream,
-			    "The same program may be running in another process.");
-#endif
       target_terminal_ours_for_output ();
       error_stream (tmp_error_stream);
     }
@@ -1385,7 +1376,7 @@ reattach_breakpoints (int pid)
   int val;
   struct cleanup *old_chain = save_inferior_ptid ();
   struct ui_file *tmp_error_stream = mem_fileopen ();
-  int dummy1 = 0, dummy2 = 0, dummy3 = 0;
+  int dummy1 = 0, dummy2 = 0;
 
   make_cleanup_ui_file_delete (tmp_error_stream);
 
@@ -1396,7 +1387,7 @@ reattach_breakpoints (int pid)
       {
 	b->inserted = 0;
 	val = insert_bp_location (b, tmp_error_stream,
-				  &dummy1, &dummy2, &dummy3);
+				  &dummy1, &dummy2);
 	if (val != 0)
 	  {
 	    do_cleanups (old_chain);
Index: src/gdb/infrun.c
===================================================================
--- src.orig/gdb/infrun.c	2008-12-28 18:14:28.000000000 +0000
+++ src/gdb/infrun.c	2008-12-28 18:14:37.000000000 +0000
@@ -4207,7 +4207,6 @@ normal_stop (void)
 	  target_terminal_ours_for_output ();
 	  printf_filtered (_("\
 Cannot remove breakpoints because program is no longer writable.\n\
-It might be running in another process.\n\
 Further execution is probably impossible.\n"));
 	}
     }
Index: src/gdb/doc/gdbint.texinfo
===================================================================
--- src.orig/gdb/doc/gdbint.texinfo	2008-12-28 18:14:29.000000000 +0000
+++ src/gdb/doc/gdbint.texinfo	2008-12-28 18:14:37.000000000 +0000
@@ -4552,11 +4552,6 @@ pointer.  It examines the current state 
 An x86-based machine can define this to use the generic x86 watchpoint
 support; see @ref{Algorithms, I386_USE_GENERIC_WATCHPOINTS}.
 
-@item ONE_PROCESS_WRITETEXT
-@findex ONE_PROCESS_WRITETEXT
-Define this to be able to, when a breakpoint insertion fails, warn the
-user that another process may be running with the same executable.
-
 @item PROC_NAME_FMT
 @findex PROC_NAME_FMT
 Defines the format for the name of a @file{/proc} device.  Should be

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gc ONE_PROCESS_WRITETEXT
  2008-12-28 18:53 gc ONE_PROCESS_WRITETEXT Pedro Alves
@ 2008-12-28 19:14 ` Pedro Alves
  2008-12-28 20:08   ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2008-12-28 19:14 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 2502 bytes --]

On Sunday 28 December 2008 18:52:29, Pedro Alves wrote:
> Hi guys,
> 
> This drops the last bits of ONE_PROCESS_WRITETEXT macro from the
> codebase, since no target/host actually defines this by now.
> 

Updated patch attached.  This one really deletes all traces of it, I
think.  I had forgotten to delete the bit I quoted below
from the user manual.  :-)

> The "It might be running in another process" notice in normal_stop
> when breakpoints fail to be removed is quite likelly related to this, and
> although wasn't conditionalized on ONE_PROCESS_WRITETEXT, should be dropped as
> well IMO, as it is confusing.  Would anyone miss it?  This was the 
> reason I haven't checked it in as obvious yet.
> 
> The most complete description I could find of this macro was in gdb 4.6
> sources:
> 
>  gdb/xm-hp300bsd.h-64-/* Kernel is a bit tenacious about sharing text segments, disallowing bpts.  */
>  gdb/xm-hp300bsd.h:65:#define    ONE_PROCESS_WRITETEXT
> 
>  @c FIXME: "cannot insert breakpoints" error, v unclear.
>  @c        Q in pending mail to Gilmore. ---pesch@cygnus.com, 26mar91
>  @c        some light may be shed by looking at instances of
>  @c        ONE_PROCESS_WRITETEXT.  But error message seems possible otherwise
>  @c        too.  pesch, 20sep91
>  Under some operating systems, breakpoints cannot be used in a program if
>  any other process is running that program.  In this situation,
>  attempting to run or continue a program with a breakpoint causes _GDBN__
>  to stop the other process.
> 
>  When this happens, you have three ways to proceed:
> 
>  @enumerate
>  @item
>  Remove or disable the breakpoints, then continue.
> 
>  @item
>  Suspend _GDBN__, and copy the file containing your program to a new name.
>  Resume _GDBN__ and use the @code{exec-file} command to specify that _GDBN__
>  should run your program under that name.  Then start your program again.
> 
>  @c FIXME: RMS commented here "Show example".  Maybe when someone
>  @c explains the first FIXME: in this section...
> 
> And in this 1991 ChangeLog entry:
> 
>  Mon Sep  9 13:45:57 1991  John Gilmore  (gnu at cygint.cygnus.com)
> 
>         * breakpoint.c (insert_breakpoints):  Restore warning about
>         the program might be running in another process, but only for
>         systems with this brain death (#ifdef ONE_PROCESS_WRITETEXT).
>         * xm-hp300bsd.h, xm-mips.h, xm-vax.h:  Define it.
> 
> I don't think we care about systems with this brain death anymore ...
> 



-- 
Pedro Alves

[-- Attachment #2: one_process_writetext.diff --]
[-- Type: text/x-diff, Size: 6547 bytes --]

gdb/
2008-12-28  Pedro Alves  <pedro@codesourcery.com>

	Delete ONE_PROCESS_WRITETEXT leftovers.

	* breakpoint.c (insert_bp_location): Delete process_warning
	argument.  Adjust.
	(insert_breakpoint_locations): Adjust.
	(reattach_breakpoints): Adjust.
	* infrun.c (normal_stop): Drop "It might be running in another
	process" notice.

gdb/doc/
2008-12-28  Pedro Alves  <pedro@codesourcery.com>

	* gdb.texinfo (Error in Breakpoints): Delete mention of "The same
	program may be running in another process" errors.
	* gdbint.texinfo (Native Conditionals): Delete
	ONE_PROCESS_WRITETEXT description.

---
 gdb/breakpoint.c       |   19 +++++--------------
 gdb/doc/gdb.texinfo    |   35 ++---------------------------------
 gdb/doc/gdbint.texinfo |    5 -----
 gdb/infrun.c           |    1 -
 4 files changed, 7 insertions(+), 53 deletions(-)

Index: src/gdb/breakpoint.c
===================================================================
--- src.orig/gdb/breakpoint.c	2008-12-28 18:14:28.000000000 +0000
+++ src/gdb/breakpoint.c	2008-12-28 18:14:37.000000000 +0000
@@ -1009,14 +1009,14 @@ should_be_inserted (struct bp_location *
 
 /* Insert a low-level "breakpoint" of some type.  BPT is the breakpoint.
    Any error messages are printed to TMP_ERROR_STREAM; and DISABLED_BREAKS,
-   PROCESS_WARNING, and HW_BREAKPOINT_ERROR are used to report problems.
+   and HW_BREAKPOINT_ERROR are used to report problems.
 
    NOTE drow/2003-09-09: This routine could be broken down to an object-style
    method for each breakpoint or catchpoint type.  */
 static int
 insert_bp_location (struct bp_location *bpt,
 		    struct ui_file *tmp_error_stream,
-		    int *disabled_breaks, int *process_warning,
+		    int *disabled_breaks,
 		    int *hw_breakpoint_error)
 {
   int val = 0;
@@ -1159,9 +1159,6 @@ Note: automatically using hardware break
 	    }
 	  else
 	    {
-#ifdef ONE_PROCESS_WRITETEXT
-	      *process_warning = 1;
-#endif
 	      if (bpt->loc_type == bp_loc_hardware_breakpoint)
 		{
 		  *hw_breakpoint_error = 1;
@@ -1259,7 +1256,6 @@ insert_breakpoint_locations (void)
   int val = 0;
   int disabled_breaks = 0;
   int hw_breakpoint_error = 0;
-  int process_warning = 0;
 
   struct ui_file *tmp_error_stream = mem_fileopen ();
   make_cleanup_ui_file_delete (tmp_error_stream);
@@ -1280,7 +1276,7 @@ insert_breakpoint_locations (void)
 	continue;
 
       val = insert_bp_location (b, tmp_error_stream,
-				    &disabled_breaks, &process_warning,
+				    &disabled_breaks,
 				    &hw_breakpoint_error);
       if (val)
 	error = val;
@@ -1332,11 +1328,6 @@ insert_breakpoint_locations (void)
 			      "Could not insert hardware breakpoints:\n\
 You may have requested too many hardware breakpoints/watchpoints.\n");
 	}
-#ifdef ONE_PROCESS_WRITETEXT
-      if (process_warning)
-	fprintf_unfiltered (tmp_error_stream,
-			    "The same program may be running in another process.");
-#endif
       target_terminal_ours_for_output ();
       error_stream (tmp_error_stream);
     }
@@ -1385,7 +1376,7 @@ reattach_breakpoints (int pid)
   int val;
   struct cleanup *old_chain = save_inferior_ptid ();
   struct ui_file *tmp_error_stream = mem_fileopen ();
-  int dummy1 = 0, dummy2 = 0, dummy3 = 0;
+  int dummy1 = 0, dummy2 = 0;
 
   make_cleanup_ui_file_delete (tmp_error_stream);
 
@@ -1396,7 +1387,7 @@ reattach_breakpoints (int pid)
       {
 	b->inserted = 0;
 	val = insert_bp_location (b, tmp_error_stream,
-				  &dummy1, &dummy2, &dummy3);
+				  &dummy1, &dummy2);
 	if (val != 0)
 	  {
 	    do_cleanups (old_chain);
Index: src/gdb/infrun.c
===================================================================
--- src.orig/gdb/infrun.c	2008-12-28 18:14:28.000000000 +0000
+++ src/gdb/infrun.c	2008-12-28 18:14:37.000000000 +0000
@@ -4207,7 +4207,6 @@ normal_stop (void)
 	  target_terminal_ours_for_output ();
 	  printf_filtered (_("\
 Cannot remove breakpoints because program is no longer writable.\n\
-It might be running in another process.\n\
 Further execution is probably impossible.\n"));
 	}
     }
Index: src/gdb/doc/gdbint.texinfo
===================================================================
--- src.orig/gdb/doc/gdbint.texinfo	2008-12-28 18:14:29.000000000 +0000
+++ src/gdb/doc/gdbint.texinfo	2008-12-28 18:14:37.000000000 +0000
@@ -4552,11 +4552,6 @@ pointer.  It examines the current state 
 An x86-based machine can define this to use the generic x86 watchpoint
 support; see @ref{Algorithms, I386_USE_GENERIC_WATCHPOINTS}.
 
-@item ONE_PROCESS_WRITETEXT
-@findex ONE_PROCESS_WRITETEXT
-Define this to be able to, when a breakpoint insertion fails, warn the
-user that another process may be running with the same executable.
-
 @item PROC_NAME_FMT
 @findex PROC_NAME_FMT
 Defines the format for the name of a @file{/proc} device.  Should be
Index: src/gdb/doc/gdb.texinfo
===================================================================
--- src.orig/gdb/doc/gdb.texinfo	2008-12-28 19:02:36.000000000 +0000
+++ src/gdb/doc/gdb.texinfo	2008-12-28 19:07:32.000000000 +0000
@@ -4035,40 +4035,9 @@ end
 @c  @ifclear BARETARGET
 @node Error in Breakpoints
 @subsection ``Cannot insert breakpoints''
-@c
-@c  FIXME!! 14/6/95  Is there a real example of this?  Let's use it.
-@c
-Under some operating systems, breakpoints cannot be used in a program if
-any other process is running that program.  In this situation,
-attempting to run or continue a program with a breakpoint causes
-@value{GDBN} to print an error message:
-
-@smallexample
-Cannot insert breakpoints.
-The same program may be running in another process.
-@end smallexample
-
-When this happens, you have three ways to proceed:
-
-@enumerate
-@item
-Remove or disable the breakpoints, then continue.
-
-@item
-Suspend @value{GDBN}, and copy the file containing your program to a new
-name.  Resume @value{GDBN} and use the @code{exec-file} command to specify
-that @value{GDBN} should run your program under that name.
-Then start your program again.
-
-@item
-Relink your program so that the text segment is nonsharable, using the
-linker option @samp{-N}.  The operating system limitation may not apply
-to nonsharable executables.
-@end enumerate
-@c  @end ifclear
 
-A similar message can be printed if you request too many active
-hardware-assisted breakpoints and watchpoints:
+If you request too many active hardware-assisted breakpoints and
+watchpoints, you will see this error message:
 
 @c FIXME: the precise wording of this message may change; the relevant
 @c source change is not committed yet (Sep 3, 1999).

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gc ONE_PROCESS_WRITETEXT
  2008-12-28 19:14 ` Pedro Alves
@ 2008-12-28 20:08   ` Eli Zaretskii
  2009-01-07 21:43     ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2008-12-28 20:08 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

> From: Pedro Alves <pedro@codesourcery.com>
> Date: Sun, 28 Dec 2008 19:13:25 +0000
> 
> gdb/doc/
> 2008-12-28  Pedro Alves  <pedro@codesourcery.com>
> 
> 	* gdb.texinfo (Error in Breakpoints): Delete mention of "The same
> 	program may be running in another process" errors.
> 	* gdbint.texinfo (Native Conditionals): Delete
> 	ONE_PROCESS_WRITETEXT description.

Thanks, these parts are approved.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gc ONE_PROCESS_WRITETEXT
  2008-12-28 20:08   ` Eli Zaretskii
@ 2009-01-07 21:43     ` Pedro Alves
  0 siblings, 0 replies; 4+ messages in thread
From: Pedro Alves @ 2009-01-07 21:43 UTC (permalink / raw)
  To: gdb-patches, Eli Zaretskii

On Sunday 28 December 2008 20:07:24, Eli Zaretskii wrote:
> > From: Pedro Alves <pedro@codesourcery.com>
> > Date: Sun, 28 Dec 2008 19:13:25 +0000
> > 
> > gdb/doc/
> > 2008-12-28  Pedro Alves  <pedro@codesourcery.com>
> > 
> > 	* gdb.texinfo (Error in Breakpoints): Delete mention of "The same
> > 	program may be running in another process" errors.
> > 	* gdbint.texinfo (Native Conditionals): Delete
> > 	ONE_PROCESS_WRITETEXT description.
> 
> Thanks, these parts are approved.

Thanks Eli.  I've checked in the whole patch.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-01-07 21:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-28 18:53 gc ONE_PROCESS_WRITETEXT Pedro Alves
2008-12-28 19:14 ` Pedro Alves
2008-12-28 20:08   ` Eli Zaretskii
2009-01-07 21:43     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox