This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

Re: [RFA]: Clean up debug printing of pc in gdbserver


> The debug printing of pc in linux-i386-low.c/linux-x86-64-low.c can
> use some clean up.
> 
> - why restrict the printing to just x86?
> - the text that is printed for linux_resume_one_lwp is confusing
> 
> Ok to check in?
> 
> 2009-05-06 ?Doug Evans ?<dje@google.com>
> 
> ????????* linux-x86-64-low.c (debug_threads): Remove declaration.
> ????????(x86_64_get_pc,x86_64_set_pc): Remove debug printing of pc.
> ????????* linux-i386-low.c (debug_threads): Remove declaration.
> ????????(i386_get_pc,i386_set_pc): Remove debug printing of pc.
> ????????* linux-low.c (get_stop_pc): Print pc if debug_threads.
> ????????(check_removed_breakpoint, linux_wait_for_lwp): Ditto.
> ????????(linux_resume_one_lwp): Ditto.

Looks OK to me.  Small nit below.

On Thursday 07 May 2009 04:11:08, Doug Evans wrote:
>    if (debug_threads
> -      && WIFSTOPPED (*wstatp))
> +      && WIFSTOPPED (*wstatp)
> +      && the_low_target.get_pc != NULL)
>      {
>        struct thread_info *saved_inferior = current_inferior;
> +      CORE_ADDR stop_pc = (*the_low_target.get_pc) ();
>        current_inferior = (struct thread_info *)
>         find_inferior_id (&all_threads, child->head.id);
> -      /* For testing only; i386_stop_pc prints out a diagnostic.  */
> -      if (the_low_target.get_pc != NULL)
> -       get_stop_pc ();
> +      fprintf (stderr, "linux_wait_for_lwp: pc is %08lx\n", (long) stop_pc);
>        current_inferior = saved_inferior;
>      }

Can we rename that `stop_pc' variable to, say, `pc', so we're
consistent throughout?  We can think of the `stop_pc' as having
always the decr_pc_after_break adjustment applied.

-- 
Pedro Alves


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