This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Add a new format letter to dump instructions backward
- From: Pedro Alves <palves at redhat dot com>
- To: Paul_Koning at Dell dot com, andrew dot burgess at embecosm dot com
- Cc: k dot toshihito at yahoo dot de, jhb at freebsd dot org, gdb-patches at sourceware dot org
- Date: Thu, 28 Jan 2016 11:53:35 +0000
- Subject: Re: [PATCH] Add a new format letter to dump instructions backward
- Authentication-results: sourceware.org; auth=none
- References: <F83BD80E-E1AA-4C1E-86BB-9A995B831256 at dell dot com> <1095889805 dot 138513 dot 1453786618993 dot JavaMail dot yahoo at mail dot yahoo dot com> <20160127160420 dot GM3338 at embecosm dot com> <AF6EBE4A-8B9B-4AB4-80D2-A38662F36F4A at dell dot com>
On 01/27/2016 07:49 PM, Paul_Koning@Dell.com wrote:
>
>> On Jan 27, 2016, at 11:04 AM, Andrew Burgess <andrew.burgess@embecosm.com> wrote:
>>
>> * Toshihito Kikuchi <k.toshihito@yahoo.de> [2016-01-26 05:36:58 +0000]:
>>
>>> To answer the question from Paul, Pedro's guess is correct. I used
>>> symbol's line info to solve a correct frame. And yes, this feature
>>> does not work without debug information unfortunately.
>>
>> If there's no debug information then just looking for symbols in the
>> same section would also be a reasonable guess. Most symbols appear
>> between instructions, not part way through an instruction.
>
> Yes. But if you have no symbols either, it can still work on Alpha, or on MIPS if you disregard the Thumb instruction set, or on any number of other RISC machines where every instruction is the same size
Agreed. We'd probably need to add a gdbarch hook to know whether
the target architecture has variable or fixed length instruction set.
That can always be done as a follow up incremental enhancement, though.
Thanks,
Pedro Alves