Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Toshihito Kikuchi <k.toshihito@yahoo.de>
To: Pedro Alves <palves@redhat.com>, gdb-patches@sourceware.org
Cc: Paul_Koning@Dell.com, andrew.burgess@embecosm.com, jhb@freebsd.org
Subject: Re: [PATCH] Negative repeat count for 'x' command
Date: Fri, 15 Apr 2016 00:30:00 -0000	[thread overview]
Message-ID: <571035CC.7060802@yahoo.de> (raw)
In-Reply-To: <570B95AE.80406@redhat.com>

Hi Pedro,

We know we all are busy with our main work :).

I walked through all of your comments. Thank you for the thorough review.
Especially your suggestion for find_pc_sect_line gdb_insn_length is really
helpful. These functions are what I was looking for.

Well, I was not a patient person, so I've started a V2 thread two weeks ago.
(https://sourceware.org/ml/gdb-patches/2016-04/msg00023.html)
The difference between V1 and V2 was only NEWS file.  Please ignore it.  Once I
address all of the comments, I'll start a V3 thread.

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?

> Typo "previoius".  Double-space after periods.  This recursion sounds
> nasty -- sounds like if you request a high number of addresses, crossing
> many lines, we'll hit stack limits.  Can we do without recursion?

Yeah, actually this was a painful part. Let me rethink a better algorithm
without using recursive calls (and VEC if possible).

>> +    }
>> +
>>     /* Print as many objects as specified in COUNT, at most maxelts per line,
>>        with the address of the next one at the start of each line.  */
>>
>> @@ -913,6 +1164,9 @@ do_examine (struct format_data fmt, struct gdbarch *gdbarch, CORE_ADDR addr)
>>         printf_filtered ("\n");
>>         gdb_flush (gdb_stdout);
>>       }
>> +
>> +  if (addr_rewound)
> 
> addr_rewound != 0
> 
> But actually, please make sure that "address == 0" is treated as a
> valid address (not just here, but in the whole patch), as it is valid
> on non-MMU machines.  That may suggest using a separate boolean variable
> to represent "have address".

Thank you for the insightful comment! I never thought non-MMU architectures..

>> +
>> +  const char TestStrings[] = {
>> +      "ABCD"
>> +      "EFGHIJKLMNOPQRSTUVWXYZ\0"
>> +      "\0"
>> +      "\0"
>> +      "\u307B\u3052\u307B\u3052\0"
>> +      "012345678901234567890123456789\0"
>> +      "!!!!!!\0"
>> +  };
>> +*/
>> +
>> +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?

Thanks,
Toshihito


  reply	other threads:[~2016-04-15  0:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1827952218.466587.1453670934999.JavaMail.yahoo.ref@mail.yahoo.com>
2016-01-24 21:31 ` [PATCH] Add a new format letter to dump instructions backward Toshihito Kikuchi
2016-01-25 11:41   ` Pedro Alves
2016-01-25 18:10     ` John Baldwin
2016-01-25 18:22       ` Paul_Koning
2016-01-25 18:27         ` Pedro Alves
2016-01-25 20:11           ` Paul_Koning
2016-01-26  5:39             ` Toshihito Kikuchi
2016-01-27 16:04               ` Andrew Burgess
2016-01-27 20:09                 ` Paul_Koning
2016-01-28 11:53                   ` Pedro Alves
2016-02-07 23:19                     ` [PATCH] Negative repeat count for 'x' command Toshihito Kikuchi
2016-02-17 11:38                       ` Pedro Alves
2016-03-23  0:27                         ` Toshihito Kikuchi
2016-04-11 12:17                       ` Pedro Alves
2016-04-15  0:30                         ` Toshihito Kikuchi [this message]
     [not found]                           ` <5714DE73.5010104@redhat.com>
2016-04-28 18:06                             ` Toshihito Kikuchi

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=571035CC.7060802@yahoo.de \
    --to=k.toshihito@yahoo.de \
    --cc=Paul_Koning@Dell.com \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jhb@freebsd.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