This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix ptype.exp fail in MIPS
- From: Pedro Alves <palves at redhat dot com>
- To: Doug Evans <xdje42 at gmail dot com>, Hui Zhu <teawater at gmail dot com>
- Cc: Hui Zhu <hui_zhu at mentor dot com>, gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Tue, 27 May 2014 19:25:45 +0100
- Subject: Re: [PATCH] Fix ptype.exp fail in MIPS
- Authentication-results: sourceware.org; auth=none
- References: <53719B17 dot 5000208 at mentor dot com> <5374FF0D dot 6060608 at redhat dot com> <CANFwon3zoYs8ZJO4HGHc+bAR+eRUQSt2A-CcdwtVq8e9v3Cd+A at mail dot gmail dot com> <CAP9bCMQ-JM=2DKCywZkn6=qOWtZnB8DPkLpkNuJDK2DtaGeBLw at mail dot gmail dot com>
On 05/19/2014 03:51 PM, Doug Evans wrote:
> On Fri, May 16, 2014 at 12:40 AM, Hui Zhu <teawater@gmail.com> wrote:
>> On Fri, May 16, 2014 at 1:53 AM, Pedro Alves <palves@redhat.com> wrote:
>>> On 05/13/2014 05:09 AM, Hui Zhu wrote:
>>>> ptype $pc
>>>> type = int32_t
>>>> (gdb) FAIL: gdb.base/ptype.exp: ptype $pc
>>>> This is because the $pc register in MIPS is set to int but not code_ptr.
>>>> And according to the discussion in
>>>> https://sourceware.org/ml/gdb/2013-06/msg00020.html, the type cannot be
>>>> changed.
>>>
>>> Hmm, that's not what I get from this branch of the discussion:
>>>
>>> https://sourceware.org/ml/gdb/2013-06/msg00021.html
>>>
>>> --
>>
>> https://sourceware.org/ml/gdb/2013-06/msg00032.html
>> Do you think add ptr64 or $_xx is OK for you to handle this issue?
>
> IIUC it's not just adding $_xx but changing the type of $pc so that
> ptype.exp will pass as is.
> Is that correct?
Yeah. As listed at the bottom of that url, $pc would be
changed to be the ABI function pointer width (32-bit pointer),
as a pseudo-register, and $_pc/$rNN would be mapped to the
machine's full 64-bit contents, as an integer.
I'm not certain this is a good idea of not in terms of user
interface. I know _I_ wouldn't be confused, and I know I have
been confused by $sp/$esp/$rsp on x86 before ($sp is not really
what one would expect if one doesn't know about GDB's special
magic stack pointer register), but I'm not really representative
of a regular gdb user.
--
Pedro Alves