Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Antoine Tremblay <antoine.tremblay@ericsson.com>
To: Pedro Alves <palves@redhat.com>, <gdb-patches@sourceware.org>
Subject: Re: [PATCH v5 3/7] Refactor arm_software_single_step to use regcache.
Date: Fri, 04 Dec 2015 15:43:00 -0000	[thread overview]
Message-ID: <5661B490.5020309@ericsson.com> (raw)
In-Reply-To: <5661B1CA.3080503@ericsson.com>



On 12/04/2015 10:31 AM, Antoine Tremblay wrote:
>
>
> On 12/04/2015 10:10 AM, Pedro Alves wrote:
>> On 12/04/2015 01:12 PM, Antoine Tremblay wrote:
>>> @@ -4727,7 +4754,8 @@ thumb_get_next_pc_raw (struct frame_info
>>> *frame, CORE_ADDR pc)
>>>       {
>>>         /* CBNZ or CBZ.  */
>>>         int imm = (bit (inst1, 9) << 6) + (bits (inst1, 3, 7) << 1);
>>> -      ULONGEST reg = get_frame_register_unsigned (frame, bits
>>> (inst1, 0, 2));
>>> +      ULONGEST reg;
>>> +      regcache_raw_read_unsigned (regcache, bits (inst1, 0, 2), &reg);
>>
>> Missing empty line.
>
> Fixed.
>
>>
>> Note that get_frame_register_unsigned throws if the register is
>> unavailable, while regcache_raw_read_unsigned uses the return value as
>> status indication.
>>
>> Shouldn't really happen normally in get_next_pcs to see an unavailable
>> register, but, wouldn't it be nicer to add a small wrapper like:
>>
>> ULONGEST
>> get_regcache_raw_unsigned (struct regcache *regcache, int regnum)
>> {
>>    ULONGEST value;
>>    enum register_status status;
>>
>>    status = regcache_raw_read_unsigned (regcache, regnum, &value);
>>    if (status == REG_UNAVAILABLE)
>>      throw_error (NOT_AVAILABLE_ERROR,
>>                   _("Register %s is not available"), regnum);
>>    return value;
>> }
>>
>> ?
>
> OK.

However thinking about it since I will add this to regcache.h and then 
to common-regcache.h.

I think I will call it regcache_raw_read_unsigned_throw.

Thanks,
Antoine


  reply	other threads:[~2015-12-04 15:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04 13:13 [PATCH v5 0/6] Support software single step and conditional breakpoints on ARM in GDBServer Antoine Tremblay
2015-12-04 13:13 ` [PATCH v5 3/7] Refactor arm_software_single_step to use regcache Antoine Tremblay
2015-12-04 15:10   ` Pedro Alves
2015-12-04 15:31     ` Antoine Tremblay
2015-12-04 15:43       ` Antoine Tremblay [this message]
2015-12-04 13:13 ` [PATCH v5 4/7] Share regcache function regcache_raw_read_unsigned Antoine Tremblay
2015-12-04 14:20   ` Antoine Tremblay
2015-12-04 13:13 ` [PATCH v5 6/7] Enable software single stepping for while-stepping actions in GDBServer Antoine Tremblay
2015-12-04 13:13 ` [PATCH v5 2/7] Share some ARM target dependent code from GDB with GDBServer Antoine Tremblay
2015-12-04 13:13 ` [PATCH v5 7/7] Enable conditional breakpoints for targets that support software single step in GDBServer Antoine Tremblay
2015-12-04 13:13 ` [PATCH v5 1/7] Replace breakpoint_reinsert_addr by get_next_pcs operation " Antoine Tremblay
2015-12-04 13:14 ` [PATCH v5 5/7] Support software single step on ARM " Antoine Tremblay

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=5661B490.5020309@ericsson.com \
    --to=antoine.tremblay@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@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