Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* A little patch for two comments in infrun.c
@ 2006-05-30 17:14 Wu Zhou
  2006-05-30 18:40 ` Jim Blandy
  2006-05-30 18:48 ` Daniel Jacobowitz
  0 siblings, 2 replies; 3+ messages in thread
From: Wu Zhou @ 2006-05-30 17:14 UTC (permalink / raw)
  To: gdb

Hi,

I am reading the source of infrun.c, and having a couple questions about 
two comments in the code:

First, in resume (int step, enum target_signal sig), one comment says:

  /* FIXME: calling breakpoint_here_p (read_pc ()) three times! */

Does this still make sense?  In function resume, there does exist three 
call for breakpoint_here_p (read_pc ()).  But read_pc () might return 
various values at various points.  The breakpoint chain maintained in 
this function might also change as the execution proceeds.  So I am 
thinking this comment doesn't make sense here.  Am I right?  Any error, 
feel free to correct me.

I also think the comment in the following code (in handle_inferior_event) 
should be changed.
  
  /* If it's a new process, add it to the thread database */

  ecs->new_thread_event = (!ptid_equal (ecs->ptid, inferior_ptid)
                           && !ptid_equal (ecs->ptid, minus_one_ptid)
                           && !in_thread_list (ecs->ptid));

IMHO, "new thread" describes more properly about the code.

I have a patch for the above two comments.

--- infrun.c.orig	2006-05-29 23:52:47.000000000 -0700
+++ infrun.c	2006-05-29 23:53:24.000000000 -0700
@@ -531,9 +531,6 @@ resume (int step, enum target_signal sig
     fprintf_unfiltered (gdb_stdlog, "infrun: resume (step=%d, signal=%d)\n",
 			step, sig);
 
-  /* FIXME: calling breakpoint_here_p (read_pc ()) three times! */
-
-
   /* Some targets (e.g. Solaris x86) have a kernel bug when stepping
      over an instruction that causes a page fault without triggering
      a hardware watchpoint. The kernel properly notices that it shouldn't
@@ -1290,7 +1287,7 @@ handle_inferior_event (struct execution_
 
   flush_cached_frames ();
 
-  /* If it's a new process, add it to the thread database */
+  /* If it's a new thread, add it to the thread database */
 
   ecs->new_thread_event = (!ptid_equal (ecs->ptid, inferior_ptid)
 			   && !ptid_equal (ecs->ptid, minus_one_ptid)

OK to commit?

Regards
- Wu Zhou


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

end of thread, other threads:[~2006-05-30 18:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-30 17:14 A little patch for two comments in infrun.c Wu Zhou
2006-05-30 18:40 ` Jim Blandy
2006-05-30 18:48 ` Daniel Jacobowitz

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