Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Andrew Burgess <aburgess@broadcom.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH [2/2] Convert the unavailable vector to be bit, not byte, based.
Date: Thu, 05 Dec 2013 16:18:00 -0000	[thread overview]
Message-ID: <52A0A760.8000509@redhat.com> (raw)
In-Reply-To: <529F498F.7060909@broadcom.com>

On 12/04/2013 03:26 PM, Andrew Burgess wrote:

>     	* gdb/dwarf2loc.c (read_pieced_value): Mark bits, not bytes
>     	unavailable, use correct bit length.

No "gdb/" prefix.


>     	(unpack_value_bits_as_long_1): Check availability in bits, bot
>     	bytes.

Typo: "bot".

>     	* gdb/value.h (int value_bits_available): Declare new function.

Stale "int".

>     	(mark_value_bits_unavailable): Declare new function.


>  *val1, int offset1,
>  	return 0;
>  
>        /* Compare the _available_ contents.  */
> -      if (memcmp (val1->contents + offset1,
> -		  val2->contents + offset2,
> -		  l1) != 0)
> +      if (memcmp (val1->contents + (offset1 / TARGET_CHAR_BIT),
> +		  val2->contents + (offset2 / TARGET_CHAR_BIT),
> +		  (l1 / TARGET_CHAR_BIT)) != 0)
>  	return 0;

As memcmp compares bytes, isn't this potentially comparing bits
at the beginning and end of the values' buffers, when it
should not?   That is, it looks like the
'offset1 % TARGET_CHAR_BIT != 0' and
'(offset1 + l1) % TARGET_CHAR_BIT' cases should be considered here?

> +    gdb_test "tfind 0" "Found trace frame 0, tracepoint .*"
> +    gdb_test "p x" "\\\$${decimal} = {a = 0 '\\\\000', b = <unavailable>, c = 0 '\\\\000', d = 0 '\\\\000', e = 0 '\\\\000', f = 0 '\\\\000', g = 0 '\\\\000', h = 0 '\\\\000', i = 0 '\\\\000', j = 0 '\\\\000'}"
> +    gdb_test "p y" "\\\$${decimal} = {a = 0 '\\\\000', b = 0 '\\\\000', c = 0 '\\\\000', d = 0 '\\\\000', e = <unavailable>, f = 0 '\\\\000', g = 0 '\\\\000', h = 0 '\\\\000', i = 0 '\\\\000', j = 0 '\\\\000'}"
> +    gdb_test "p z" "\\\$${decimal} = {a = 0 '\\\\000', b = 0 '\\\\000', c = 0 '\\\\000', d = 0 '\\\\000', e = 0 '\\\\000', f = 0 '\\\\000', g = 0 '\\\\000', h = 0 '\\\\000', i = <unavailable>, j = 0 '\\\\000'}"

(I think you could have used "p/d" or "p/x" to simplify the output.)

> +
> +    gdb_test "tfind none" "No longer looking at any trace frame.*"


> +void
> +end ()

end (void)

There are more instances.




> +  struct s v = { 0, 1, 2};

Missing space before }.

> +  struct t w = { 5, 0, 1, 0, 1, 0, 1, 0, 1, 7 };


Otherwise looks good to me.

-- 
Pedro Alves


  reply	other threads:[~2013-12-05 16:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-04 15:22 PATCH [0/2] Convert " Andrew Burgess
2013-12-04 15:25 ` [PATCH [1/2] Add support for DW_OP_bit_piece and DW_OP_plus_uconst to DWARF assembler Andrew Burgess
2013-12-05 16:23   ` Pedro Alves
2013-12-05 18:53     ` Tom Tromey
2013-12-06 13:30       ` Andrew Burgess
2013-12-04 15:26 ` [PATCH [0/2] Convert the unavailable vector to be bit, not byte, based Andrew Burgess
2013-12-05 16:18   ` Pedro Alves [this message]
2013-12-09 21:04     ` [PATCH [2/2] " Andrew Burgess
2013-12-10 11:32       ` Pedro Alves
2013-12-11 16:28   ` Andrew Burgess
2013-12-11 18:45     ` Pedro Alves
2013-12-17 17:30       ` Andrew Burgess
2013-12-05 16:18 ` PATCH [0/2] Convert " Pedro Alves
2013-12-05 18:14   ` 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=52A0A760.8000509@redhat.com \
    --to=palves@redhat.com \
    --cc=aburgess@broadcom.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