From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Siddhesh Poyarekar <siddhesh@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: bitpos expansion patches summary
Date: Mon, 13 Aug 2012 13:49:00 -0000 [thread overview]
Message-ID: <20120813134915.GA5960@host2.jankratochvil.net> (raw)
In-Reply-To: <20120813082124.2b80ffdf@spoyarek>
On Mon, 13 Aug 2012 04:51:24 +0200, Siddhesh Poyarekar wrote:
> > i] ENSURED_SIZET: (avr-tdep.c:1184): FUNC(xmalloc):
> > (LONGEST to size_t) [len]
> > - You do not, you have changed parameter len to ssize_t, you did
> > ENSURED_SIZET on line 1298.
> > - But that ENSURED_SIZET is redundant there as the code already
>
> OK, do you want me to add the check within the function?
I was requesting only to remove the redundant line
avr-tdep.c:1298:ensure_type_fits_sizet (type);
as on this line GDB already executed line
const bfd_byte *contents = value_contents (arg);
which would already abort for too large TYPE_LENGTH.
Unrelated to this specific case but to ensure_type_fits_sizet in general:
Could you change these calls of ensure_type_fits_sizet where we already deal
with the length itself and no longer the type?
ensure_type_fits_sizet (type);
si = push_stack_item (si, contents, len);
I would find it easier as:
ensure_length_fits_sizet (len);
si = push_stack_item (si, contents, len);
Here only LEN matters. LEN is LONGEST so we can verify whether LONGEST LEN
fits into SSIZE_T. Reintroducing here a dependency on TYPE is a needless
little complication of the code IMO.
Moreover even when we have TYPE we could use:
ensure_length_fits_sizet (TYPE_LENGTH (type));
ensure_type_fits_sizet uses only TYPE->LENGTH so it does not need to be passed
TYPE at all. It would make sense if ensure_type_fits_sizet prints TYPE_NAME
in the error case etc. - but it does not use TYPE_NAME anyway..
> I could just remove the type_is_size_t_or_error call here.
Yes.
> Likewise for other tdep instances.
I do not see how it can be generalized, I may not just see what do you mean.
> > (breakpoint.c:4624): FUNC(): (LONGEST to int)
> > [loc->length]
> > - That's not true, s390x can set arbitrary hardware watchpoint
> > memory range, see s390_fix_watch_points. WPFIXED(Expand
>
> Oh, then my assumption about watchpoint sizes would be wrong then
> wouldn't it? We then need to expand the ok_for_watchpoint as well as
> {insert|remove}_watchpoint. We could do it as a different changeset
> since only s390x would need it.
You are right. Sorry I did not remember this s390x feature when we discussed
it before.
Thanks,
Jan
next prev parent reply other threads:[~2012-08-13 13:49 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-04 19:24 Siddhesh Poyarekar
2012-08-07 14:39 ` Jan Kratochvil
2012-08-07 15:10 ` Siddhesh Poyarekar
2012-08-07 15:48 ` Siddhesh Poyarekar
2012-08-08 22:43 ` Jan Kratochvil
2012-08-08 22:50 ` Jan Kratochvil
2012-08-09 2:04 ` Siddhesh Poyarekar
2012-08-10 1:28 ` Siddhesh Poyarekar
2012-08-17 9:35 ` Siddhesh Poyarekar
2012-08-09 20:04 ` Jan Kratochvil
2012-08-10 1:44 ` Siddhesh Poyarekar
2012-08-10 7:51 ` Jan Kratochvil
2012-08-10 7:58 ` Siddhesh Poyarekar
2012-08-12 17:57 ` Jan Kratochvil
2012-08-13 2:52 ` Siddhesh Poyarekar
2012-08-13 13:49 ` Jan Kratochvil [this message]
2012-08-13 14:04 ` Siddhesh Poyarekar
2012-08-13 14:12 ` Jan Kratochvil
2012-08-13 14:24 ` Siddhesh Poyarekar
2012-08-17 9:35 ` [PATCH 4/3] bitpos: Expand parameters of watchpoint functions Siddhesh Poyarekar
2012-08-19 16:42 ` bitpos expansion patches summary Jan Kratochvil
2012-08-21 6:51 ` Siddhesh Poyarekar
2012-08-26 18:21 ` Jan Kratochvil
2012-08-27 8:10 ` Siddhesh Poyarekar
2012-08-27 14:02 ` Jan Kratochvil
2012-09-02 18:15 ` Jan Kratochvil
2012-09-07 10:52 ` Siddhesh Poyarekar
2012-09-11 19:04 ` Jan Kratochvil
2012-09-11 19:26 ` Tom Tromey
2012-09-11 19:37 ` Jan Kratochvil
2012-09-13 18:45 ` Jan Kratochvil
2012-09-13 16:48 ` Jan Kratochvil
2012-09-14 6:20 ` Siddhesh Poyarekar
2012-09-04 15:03 ` Jan Kratochvil
2012-09-04 15:09 ` Siddhesh Poyarekar
2012-09-07 11:10 ` Siddhesh Poyarekar
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=20120813134915.GA5960@host2.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=siddhesh@redhat.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