Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Doug Evans <dje@google.com>
Subject: Re: [RFA]: Clean up debug printing of pc in gdbserver
Date: Sun, 24 May 2009 16:47:00 -0000	[thread overview]
Message-ID: <200905241747.58832.pedro@codesourcery.com> (raw)
In-Reply-To: <20090507031109.0CBFB84890@localhost>


> 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


  parent reply	other threads:[~2009-05-24 16:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-07  3:11 Doug Evans
2009-05-24  0:26 ` Doug Evans
2009-05-24 16:47 ` Pedro Alves [this message]
2009-05-24 17:35   ` Doug Evans

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=200905241747.58832.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    /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