Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Markus Deuling <deuling@de.ibm.com>
To: gdb-patches@sourceware.org
Cc: eliz@gnu.org, Joel Brobecker <brobecker@adacore.com>,
	        jimb@codesourcery.com, mark.kettenis@xs4all.nl,
	deuling@de.ibm.com,         pedro_alves@portugalmail.pt,
	Ulrich Weigand <uweigand@de.ibm.com>
Subject: Re: [Patch]: Little Cleanup
Date: Wed, 07 Mar 2007 07:36:00 -0000	[thread overview]
Message-ID: <45EE6B21.8060302@de.ibm.com> (raw)
In-Reply-To: <200703062210.l26MAEmv032467@d12av02.megacenter.de.ibm.com>

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

Ulrich Weigand wrote:
> Eli Zaretskii wrote:
>
>   
>> Fine with me.  Note that the original code had a local variable that
>> made this clear; this whole discussion was caused by a patch that
>> removed that variable.
>>     
>
> Actually, the original code had a *global* static variable that was
> used only at this single location -- cleaning this up was really the
> point of the patch, I guess.
>
> Bye,
> Ulrich
>
>   
The function "handle_inferior_event"'s length is >1450 (!!!) lines of 
code and I think its
a good idea to clean it up if possible. The patch removes an unnecessary
variable from that function. To increase the readability I added a 
comment to the patch.

Ok?

-- 
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com



[-- Attachment #2: cleanup_patch_1 --]
[-- Type: text/plain, Size: 1943 bytes --]

diff -urN src/gdb/breakpoint.c dev/gdb/breakpoint.c
--- src/gdb/breakpoint.c	2007-02-27 20:46:04.000000000 +0100
+++ dev/gdb/breakpoint.c	2007-03-07 08:23:06.000000000 +0100
@@ -3134,8 +3134,6 @@
   /* step_resume entries: a step resume breakpoint overrides another
      breakpoint of signal handling (see comment in wait_for_inferior
      at where we set the step_resume breakpoint).  */
-  /* We handle the through_sigtramp_breakpoint the same way; having both
-     one of those and a step_resume_breakpoint is probably very rare (?).  */
 
   static const enum bpstat_what_main_action
     table[(int) class_last][(int) BPSTAT_WHAT_LAST] =
diff -urN src/gdb/infrun.c dev/gdb/infrun.c
--- src/gdb/infrun.c	2007-03-01 06:45:40.000000000 +0100
+++ dev/gdb/infrun.c	2007-03-07 08:24:33.000000000 +0100
@@ -288,10 +288,6 @@
 
 struct regcache *stop_registers;
 
-/* Nonzero if program stopped due to error trying to insert breakpoints.  */
-
-static int breakpoints_failed;
-
 /* Nonzero after stop if current stack frame should be printed.  */
 
 static int stop_print_frame;
@@ -1830,7 +1826,6 @@
   stop_print_frame = 1;
   ecs->random_signal = 0;
   stopped_by_random_signal = 0;
-  breakpoints_failed = 0;
 
   if (stop_signal == TARGET_SIGNAL_TRAP
       && trap_expected
@@ -2126,9 +2121,7 @@
         if (debug_infrun)
 	  fprintf_unfiltered (gdb_stdlog, "infrun: BPSTAT_WHAT_SINGLE\n");
 	if (breakpoints_inserted)
-	  {
-	    remove_breakpoints ();
-	  }
+	  remove_breakpoints ();
 	breakpoints_inserted = 0;
 	ecs->another_trap = 1;
 	/* Still need to check other stuff, at least the case
@@ -2909,8 +2902,9 @@
 
       if (!breakpoints_inserted && !ecs->another_trap)
 	{
-	  breakpoints_failed = insert_breakpoints ();
-	  if (breakpoints_failed)
+          /* Stop stepping when inserting breakpoints
+             has failed.  */
+          if (insert_breakpoints () != 0)
 	    {
 	      stop_stepping (ecs);
 	      return;

  reply	other threads:[~2007-03-07  7:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-02  7:04 Markus Deuling
2007-03-03  9:08 ` Pedro Alves
2007-03-03 10:29   ` Eli Zaretskii
2007-03-05  5:59     ` Markus Deuling
2007-03-05 21:04       ` Eli Zaretskii
2007-03-05 21:23         ` Mark Kettenis
2007-03-05 21:23           ` Eli Zaretskii
2007-03-05 22:01             ` Jim Blandy
2007-03-06  4:22               ` Eli Zaretskii
2007-03-06 19:53                 ` Joel Brobecker
2007-03-06 20:40                   ` Michael Snyder
2007-03-06 21:03                   ` Eli Zaretskii
2007-03-06 22:10                     ` Ulrich Weigand
2007-03-07  7:36                       ` Markus Deuling [this message]
2007-03-07 12:15                         ` Daniel Jacobowitz
2007-03-07 16:34                         ` Eli Zaretskii
2007-03-09  4:48                           ` Markus Deuling
2007-03-09 16:21                             ` Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45EE6B21.8060302@de.ibm.com \
    --to=deuling@de.ibm.com \
    --cc=brobecker@adacore.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jimb@codesourcery.com \
    --cc=mark.kettenis@xs4all.nl \
    --cc=pedro_alves@portugalmail.pt \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox