* Re: [PATCH] Map registers to remote numbers when encoding an ax_reg or ax_reg_mask operation
[not found] <1456406745-27854-1-git-send-email-antoine.tremblay@ericsson.com>
@ 2016-02-25 14:26 ` Pedro Alves
2016-02-25 14:30 ` Antoine Tremblay
0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2016-02-25 14:26 UTC (permalink / raw)
To: Antoine Tremblay, gdb-patches
On 02/25/2016 01:25 PM, Antoine Tremblay wrote:
> When encoding the agent expression operation ax_reg or ax_reg_mask, the
> register number used is internal to GDB. However GDBServer expects a tdesc
> based number.
>
> This usually does not cause a problem since at the moment, for raw
> registers GDBServer R trace action ignores the register mask and just
> collects all registers.
>
> It can be a problem, however with pseudo registers on some platforms if the
> tdesc number doesn't match the GDB internal register number.
>
> This is the case with ARM, the upcoming ARM tracepoint support, fails
> these test cases without this patch:
>
> gdb.trace/collection.exp: collect register locals collectively:*
>
> GDBSever would exit with: unhandled register size
> Since the register number is not mapped.
>
> This patch fixes these issues by calling gdbarch_remote_register_number
> before encoding the register number in the ax_reg or ax_reg_mask operation.
>
> Tested on x86 native-gdbserver no regressions observed.
> else
> {
> - int byte = reg / 8;
> + int byte = 0;
No need to zero initialize.
> +
> + /* Get the remote register number. */
> + reg = gdbarch_remote_register_number (ax->gdbarch, reg);
> + byte = reg / 8;
>
> /* Grow the bit mask if necessary. */
> if (byte >= ax->reg_mask_len)
>
OK with ChangeLog entry.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Map registers to remote numbers when encoding an ax_reg or ax_reg_mask operation
2016-02-25 14:26 ` [PATCH] Map registers to remote numbers when encoding an ax_reg or ax_reg_mask operation Pedro Alves
@ 2016-02-25 14:30 ` Antoine Tremblay
2016-02-25 14:37 ` Antoine Tremblay
0 siblings, 1 reply; 3+ messages in thread
From: Antoine Tremblay @ 2016-02-25 14:30 UTC (permalink / raw)
To: Pedro Alves; +Cc: Antoine Tremblay, gdb-patches
Pedro Alves writes:
> On 02/25/2016 01:25 PM, Antoine Tremblay wrote:
>> When encoding the agent expression operation ax_reg or ax_reg_mask, the
>> register number used is internal to GDB. However GDBServer expects a tdesc
>> based number.
>>
>> This usually does not cause a problem since at the moment, for raw
>> registers GDBServer R trace action ignores the register mask and just
>> collects all registers.
>>
>> It can be a problem, however with pseudo registers on some platforms if the
>> tdesc number doesn't match the GDB internal register number.
>>
>> This is the case with ARM, the upcoming ARM tracepoint support, fails
>> these test cases without this patch:
>>
>> gdb.trace/collection.exp: collect register locals collectively:*
>>
>> GDBSever would exit with: unhandled register size
>> Since the register number is not mapped.
>>
>> This patch fixes these issues by calling gdbarch_remote_register_number
>> before encoding the register number in the ax_reg or ax_reg_mask operation.
>>
>> Tested on x86 native-gdbserver no regressions observed.
>
>> else
>> {
>> - int byte = reg / 8;
>> + int byte = 0;
>
> No need to zero initialize.
OK.
>
>> +
>> + /* Get the remote register number. */
>> + reg = gdbarch_remote_register_number (ax->gdbarch, reg);
>> + byte = reg / 8;
>>
>> /* Grow the bit mask if necessary. */
>> if (byte >= ax->reg_mask_len)
>>
>
> OK with ChangeLog entry.
Oops, yes I'll add a ChangeLog sorry about that.
Thanks,
Antoine
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Map registers to remote numbers when encoding an ax_reg or ax_reg_mask operation
2016-02-25 14:30 ` Antoine Tremblay
@ 2016-02-25 14:37 ` Antoine Tremblay
0 siblings, 0 replies; 3+ messages in thread
From: Antoine Tremblay @ 2016-02-25 14:37 UTC (permalink / raw)
To: Antoine Tremblay; +Cc: Pedro Alves, gdb-patches
Antoine Tremblay writes:
> Pedro Alves writes:
>
>> On 02/25/2016 01:25 PM, Antoine Tremblay wrote:
>>> When encoding the agent expression operation ax_reg or ax_reg_mask, the
>>> register number used is internal to GDB. However GDBServer expects a tdesc
>>> based number.
>>>
>>> This usually does not cause a problem since at the moment, for raw
>>> registers GDBServer R trace action ignores the register mask and just
>>> collects all registers.
>>>
>>> It can be a problem, however with pseudo registers on some platforms if the
>>> tdesc number doesn't match the GDB internal register number.
>>>
>>> This is the case with ARM, the upcoming ARM tracepoint support, fails
>>> these test cases without this patch:
>>>
>>> gdb.trace/collection.exp: collect register locals collectively:*
>>>
>>> GDBSever would exit with: unhandled register size
>>> Since the register number is not mapped.
>>>
>>> This patch fixes these issues by calling gdbarch_remote_register_number
>>> before encoding the register number in the ax_reg or ax_reg_mask operation.
>>>
>>> Tested on x86 native-gdbserver no regressions observed.
>>
>>> else
>>> {
>>> - int byte = reg / 8;
>>> + int byte = 0;
>>
>> No need to zero initialize.
>
> OK.
>
>>
>>> +
>>> + /* Get the remote register number. */
>>> + reg = gdbarch_remote_register_number (ax->gdbarch, reg);
>>> + byte = reg / 8;
>>>
>>> /* Grow the bit mask if necessary. */
>>> if (byte >= ax->reg_mask_len)
>>>
>>
>> OK with ChangeLog entry.
>
> Oops, yes I'll add a ChangeLog sorry about that.
>
Pushed.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-25 14:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1456406745-27854-1-git-send-email-antoine.tremblay@ericsson.com>
2016-02-25 14:26 ` [PATCH] Map registers to remote numbers when encoding an ax_reg or ax_reg_mask operation Pedro Alves
2016-02-25 14:30 ` Antoine Tremblay
2016-02-25 14:37 ` Antoine Tremblay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox