Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org, ulrich.weigand@de.ibm.com,
	       rcardoso@linux.ibm.com
Subject: Re: [PATCH v2 3/3] [PowerPC] Fix debug register issues in ppc-linux-nat
Date: Tue, 18 Feb 2020 20:31:00 -0000	[thread overview]
Message-ID: <87lfoziqmw.fsf@linux.ibm.com> (raw)
In-Reply-To: <20200217174720.3CB09D802EA@oc3748833570.ibm.com>

"Ulrich Weigand" <uweigand@de.ibm.com> writes:

> Can we simply store the installed slots map in here, instead of requiring
> a whole new per-lwp map in m_installed_hw_bps?

I had considered doing this, however, low_new_fork needs to copy the
per-lwp state in case the debug registers are copied across forks, and
this function is called before the lwp_info object for the new forked
thread is constructed, which only happens in
linux_nat_target::follow_fork.

> But it would seem cleaner to make this explicit by having an
> explicit "initialize" or "detect" call, which gets called in
> those places we expect to be "first", and which gets passed
> a ptid_t to use (where the callers will still pass inferior_ptid,
> but then at least the dependency will be explicit.

Agreed.  I'm investigating the best way to do this.

> I'm wondering if it might be preferable to have a single map from pid_t
> to a "per-process HW break/watchpoint" structure, which tracks the
> lifetime of the process (cleaned up completely in low_forget_process),
> and holds all the data (list of ppc_hw_breakpoint structs, plus a WP
> value)?

Yes, that would probably be cleaner.

> [ *Maybe* (and I'm not sure here) it would even make sense to move the
> ppc_linux_dreg_interface into that per-process struct, to clearly
> associate it with the pid that was used to query the kernel? ]

I'm not yet sure about this one, I have to think a bit more.

>> +ppc_linux_nat_target::hwdebug_point_cmp
>> +(const struct ppc_hw_breakpoint &a, const struct ppc_hw_breakpoint &b)
>
> You're using this style in a number of places, but I don't think this
> complies with the GNU coding style ...   (The '(' should not be in the
> first column.)

I will change this.  I had done this because even if I broke the line
after the first argument, the line still had more than the soft limit of
columns (74):

ppc_linux_nat_target::hwdebug_point_cmp (const struct ppc_hw_breakpoint &a,
					 const struct ppc_hw_breakpoint &b)

Is this a reasonable reason to exceed the soft limit column limit?  It's
under the hard limit (80).  If it's not reasonable, I'll have to do
something like:

bool
ppc_linux_nat_target::hwdebug_point_cmp (const struct
					 ppc_hw_breakpoint &a,
					 const struct
					 ppc_hw_breakpoint &b)


Thanks a lot for the review!

--
Pedro Franco de Carvalho


  reply	other threads:[~2020-02-18 20:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 20:55 [PATCH v2 0/3] low_new_clone in linux-nat.c and powerpc watchpoint fixes Pedro Franco de Carvalho
2020-02-14 20:55 ` [PATCH v2 1/3] Add low_new_clone method to linux_nat_target Pedro Franco de Carvalho
2020-02-17 17:49   ` Ulrich Weigand
2020-02-14 20:55 ` [PATCH v2 3/3] [PowerPC] Fix debug register issues in ppc-linux-nat Pedro Franco de Carvalho
2020-02-17 17:47   ` Ulrich Weigand
2020-02-18 20:31     ` Pedro Franco de Carvalho [this message]
2020-02-19 13:46       ` Ulrich Weigand
2020-03-13 20:19     ` Pedro Franco de Carvalho
2020-03-27 18:50       ` Pedro Franco de Carvalho
2020-03-27 18:54         ` [PATCH] " Pedro Franco de Carvalho
2020-03-30 13:04           ` Ulrich Weigand
2020-03-30 13:03         ` [PATCH v2 3/3] " Ulrich Weigand
2020-03-30 15:13           ` Pedro Franco de Carvalho
2020-02-14 20:55 ` [PATCH v2 2/3] [PowerPC] Move up some register access routines Pedro Franco de Carvalho
2020-02-17 17:48   ` 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=87lfoziqmw.fsf@linux.ibm.com \
    --to=pedromfc@linux.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=rcardoso@linux.ibm.com \
    --cc=ulrich.weigand@de.ibm.com \
    --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