This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Negative repeat count for 'x' command


On 04/15/2016 01:29 AM, Toshihito Kikuchi wrote:

> Let me answer a couple of non-trivial questions.  Otherwise fixes will be
> included in V3.
> 
>>> +If a negative repeat count is specified for the formats @samp{s} or @samp{i},
>>> +the absolute value of the given number of null-terminated strings or
>>> +instructions before the address are displayed.  For the @samp{i} format,
>>> +we use line number information in the debug info to resolve a correct frame
>>> +while dissasembling backward. 
>>
>> What does "a correct frame" mean?
> 
> It seems that I was using a wrong term. Instead of 'frame', does 'procedure
> boundary' make sense?

Yes, that'd make sense.

>>> +const char TestStrings[] = {
>>> +  0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
>>
>> I wonder whether 'A', 'B', etc. would work?
> 
> These test strings contain non-alphabetical characters shown as
> "\u307B\u3052\u307B\u3052\0" above, and that syntax is not allowed without C99.
>  Also,
> I want to keep the same style for 1-byte, 2-bytes, and 4-bytes test strings.
> That's why I didn't use a character literals here. 

...

> Do you have any thoughts?

Nope.

BTW, aren't these tests dependent on the host's charset?  (show host-charset)

An idea to generalize the x/i tests to all archs would be to
let go of the asm, and instead write the test function in C.  Then
you'd first use forward x/i to store a few line's instructions in
a list/array, and afterwards you'd disassemble backwards, comparing
with the expected instructions stored in the stored list/array.
I wonder whether that'd work.

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]