Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: oza Pawandeep <oza.pawandeep@gmail.com>
To: "Petr Hluzín" <petr.hluzin@gmail.com>
Cc: paawan oza <paawan1982@yahoo.com>, Tom Tromey <tromey@redhat.com>,
		"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
		chandra krishnappa <chandra_roadking@yahoo.com>
Subject: Re: [PATCH] arm reversible : <phase_2_complete>
Date: Sat, 22 Oct 2011 15:42:00 -0000	[thread overview]
Message-ID: <CAK1A=4yA-kGtnS8BGU+9L7CHXCoMn5MG8sFr++hXvQjKEptrCw@mail.gmail.com> (raw)
In-Reply-To: <CAC=yr6D+d-Q4Yzfm6AoWSYgb4+Bopubg4wFDX9QDSUUFFcFtWg@mail.gmail.com>

Hi Petr,

Thanks for your comments again.

I have tried to take care of all your comments except

1) there is contradiction between yours and Tom's comment about
gdb_assert_not_reached.
I have changed back and forth earlier.
currently it return -1, indirectly gdb throws __error which results
into record stop completely.

2) the local variable usage as you sueggsted definately improves cache
line usage and performance
I want to leave it to regression probably in phase - 3; because other
changes from Yao and you have taken good amount of time.

please excuse me If you have to repeat he comments:
as this patch has grown too much that I miss something some or the other thing

the next patch update include the implementation of arm_extension_space insn.

Regards,
Oza.

On Mon, Oct 17, 2011 at 2:32 AM, Petr Hluzín <petr.hluzin@gmail.com> wrote:
> On 15 October 2011 05:45, paawan oza <paawan1982@yahoo.com> wrote:
>> please find the patch below.
>
> I did not verify the style guidelines (spaces etc.), I am not familiar enough.
> However some places have a comma ',' at the beginning of new line - I
> think the "operator at newline" guideline does not apply to commas.
>
> I did not check ARM semantics. It looks plausible, though.
>
> The current patch (2011-10-15) is definitely an improvement to 2011-05-12.
> Only the assertion thing got worse:
>
> In arm_handle_ld_st_imm_offset_insn()
>>+   switch (arm_insn_r->opcode)
> In arm_handle_ld_st_reg_offset_insn():
>>+   switch (arm_insn_r->opcode)
>>+   switch (offset_12)
>>+   switch (arm_insn_r->opcode)
> In arm_handle_ld_st_multiple_insn()
>>+   switch (addr_mode)
>
> These switches seem to have `return -1;' in cases which are not
> reachable, therefore shoudl have gdb_assert_not_reached().
> The guideline - which I think Tom was reffering to - is that
> impossible states and coding bugs in gdb should trigger assertions
> however user's input (no matter how malformed) should trigger warning
> or error messages.
> (This would mean to turn the lines with `default:' to the previous
> revision. I understand this sucks.)
>
> Some situations are difficult to decide whether they are trigger-able
> by user input or not.
> If my code is not coded or intended to handle such situations I prefer
> to kill the process (or whatever are assertions configured to do) and
> get feedback from user.
> I am not familiar with GDB customs, though. Tom?
>
> Oza> +      gdb_assert_not_reached ("no decoding pattern found");
>>
> Tom> It seems wrong to use an assert in this code.  At least, it is not
> Tom> obvious to me that this represents a logic error in gdb as opposed to a
> Tom> merely unrecognized instruction.  An unrecognized instruction can occur
> Tom> for many reasons, e.g., a bad jump.
>
> The switch variable `arm_insn_r->opcode' cannot be initialized to any
> value different from 0..15 because of the expression:
> arm_insn_r->opcode = bits (arm_insn_r->arm_insn, 21, 24).
> The switch variable `offset_12' cannot be initialized to any value
> different from 0..3 because of the expression: offset_12 = bits
> (arm_insn_r->arm_insn, 5, 6).
> The switch variable `addr_mode' cannot be initialized to any value
> different from 0..3 because of the expression: addr_mode = bits
> (arm_insn_r->arm_insn, 23, 24).
> It would be bit easier to see that if the variables were local (as I suggested).
> Other values are not possible to create, even with corrupted input or
> unrecognized instructions.
>
> Paawan: If Tom and I give you contradicting suggestions then you
> should complain.
>
>
> Issues remaining from my previous reviews:
>
> In arm_handle_coproc_data_proc_insn()
> +   if (15 == arm_insn_r->opcode)
> ...
> +        /* Handle arm syscall insn.  */
> +        if (tdep->arm_swi_record != NULL)
> +          {
> +            tdep->arm_swi_record(reg_cache);
> +          }
> ...
> +   return -1;
>
> The function still returns -1 even when the instruction was recognized
> (15) and OS syscall support function is not NULL.
> Yes, there is no way to set it to non-NULL value yet but when it is
> implemented then you would have to do this change anyway:
> -   tdep->arm_swi_record(reg_cache);
> +   return tdep->arm_swi_record(reg_cache);
>
> I guess the function should use `arm_insn_r' argument to record the
> changes - which is missing.
> In thumb_handle_swi_insn() the situation is the opposite: it returns 0
> no matter what the arm_swi_record() returns.
>
>
> In arm_handle_data_proc_misc_ld_str_insn()
>>> +  struct
>>> +    {
>>> +      ULONGEST unsigned_regval;
>>> +    } u_buf[2];
>>>
>>> You can get the same result (and simpler code) with
>>> ULONGEST u_buf[2];
>>> or maybe also better name with
>>> ULONGEST u_regvals[2];
>>>
>>> The same applies to other functions.
>>
>> Oza: It is correct, it was mis-evolved as inistially it was union with 2 members
>> and I fixed Tom’s review comments for endianness. I will change this, but pelase
>> do not mind if it is not there in the immediate versions of patch, eventually
>> after testing it will be changed.
>
> This is still true.
>
>
>> Oza: please report as I don’t have any automated tool which reports them, if it
>> is not effort for you please report all if possible. Gcc also give some warning
>> about unused one, but not sure about gdb warning suppression.
>
> Unused local variables, as requested:
> arm_handle_ld_st_imm_offset_insn: reg_src2, immed_high, immed_low
> arm_handle_ld_st_reg_offset_insn: immed_high, immed_low
> arm_handle_ld_st_multiple_insn: shift_imm, reg_src2
> arm_handle_coproc_data_proc_insn - all of them: shift_imm, reg_src1,
> reg_src2, addr_mode, start_address
> thumb_handle_ld_st_imm_offset_insn: reg_val1
> thumb_handle_ld_st_stack_insn: reg_val1
> thumb_handle_misc_insn: reg_val1, reg_src1 - write-only in case `(2 ==
> opcode)', immed_8, immed_5
> thumb_handle_swi_insn: reg_val1
> thumb_handle_branch_insn: reg_val1, reg_src1, opcode, immed_5
>
> Typos:
> preccedded -> precceded (3x), Accorindly -> Accordingly (2x),
> addresing -> addressing, optmization -> optimization, Wihtout
> optmization  -> Without optimization,
>
> Otherwise the patch looks good.
>
> --
> Petr Hluzin
>


  reply	other threads:[~2011-10-22 14:48 UTC|newest]

Thread overview: 128+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-29 15:38 paawan oza
2011-05-31 18:05 ` Tom Tromey
2011-06-03  7:44   ` paawan oza
2011-06-03  7:51   ` paawan oza
2011-07-12 21:10     ` Tom Tromey
2011-07-13  3:17       ` chandra krishnappa
2011-07-13  5:36         ` paawan oza
2011-07-13 15:20         ` Tom Tromey
2011-07-14  4:49           ` chandra krishnappa
2011-07-14 15:01             ` Yao Qi
2011-07-13  6:57       ` paawan oza
     [not found]       ` <1316327455.23344.YahooMailNeo@web112509.mail.gq1.yahoo.com>
2011-09-19  7:37         ` paawan oza
2011-09-22 17:12           ` oza Pawandeep
2011-09-27  6:52             ` oza Pawandeep
2011-10-06 18:01               ` oza Pawandeep
     [not found]                 ` <CAK1A=4xuUT++WRzdUnZc0KodYF0AiukUyJa7Pr=wzb4i-OQ5eQ@mail.gmail.com>
2011-10-08  2:50                   ` Fwd: " paawan oza
2011-10-11 18:11                     ` [PATCH] arm reversible : <phase_2_complete> how to go ahead ? paawan oza
2011-10-11 19:02                       ` Tom Tromey
2011-10-14 20:13           ` [PATCH] arm reversible : <phase_2_complete> Tom Tromey
2011-10-15  3:46             ` paawan oza
2011-10-15  7:01               ` chandra krishnappa
2011-10-15  9:32               ` Yao Qi
2011-10-15 13:33                 ` Yao Qi
2011-10-15 16:34                   ` oza Pawandeep
2011-10-15 17:38                     ` oza Pawandeep
2011-10-16  8:00                       ` oza Pawandeep
2011-10-16  8:44                         ` oza Pawandeep
2011-10-17  4:25                         ` Yao Qi
2011-10-17  3:18                     ` Yao Qi
2011-10-17  4:28                       ` oza Pawandeep
2011-10-17 15:42                         ` chandra krishnappa
2011-11-03 17:10                 ` Tom Tromey
2011-11-04 16:27                   ` Yao Qi
2011-10-16 23:32               ` Petr Hluzín
2011-10-22 15:42                 ` oza Pawandeep [this message]
2011-10-23 10:17                   ` oza Pawandeep
2011-10-24  7:43                     ` Petr Hluzín
2011-10-25  7:20                     ` Yao Qi
2011-11-03 17:41                     ` Tom Tromey
2011-11-05 17:36                       ` Petr Hluzín
2011-11-03 17:38                 ` Tom Tromey
2011-11-05 17:35                   ` Petr Hluzín
2011-11-07 15:39                     ` Tom Tromey
2011-11-08  6:02                       ` oza Pawandeep
2011-11-08 10:17                         ` Yao Qi
2011-11-08 10:45                           ` oza Pawandeep
2011-11-09  5:28                         ` oza Pawandeep
2011-11-09  6:08                           ` oza Pawandeep
2011-11-17  9:24                             ` oza Pawandeep
2011-11-17  9:52                               ` Yao Qi
2011-11-17 20:40                             ` Tom Tromey
2011-11-18  3:18                               ` oza Pawandeep
2011-11-18 17:22                                 ` Tom Tromey
2011-11-19  9:43                               ` oza Pawandeep
2011-11-19 11:39                                 ` oza Pawandeep
2011-12-02 18:36                                   ` Tom Tromey
2011-12-03  8:20                                     ` oza Pawandeep
2011-12-03 14:18                                       ` oza Pawandeep
2011-12-03 16:32                                         ` Petr Hluzín
2011-12-03 18:46                                           ` oza Pawandeep
2011-12-03 19:02                                             ` oza Pawandeep
2011-12-03 20:30                                               ` Petr Hluzín
     [not found]                                                 ` <1322975560.12415.YahooMailNeo@web112518.mail.gq1.yahoo.com>
2011-12-04  7:09                                                   ` paawan oza
2011-12-04  1:47                                               ` Yao Qi
2011-12-04  8:26                                                 ` oza Pawandeep
2011-12-04 11:33                                                   ` oza Pawandeep
2011-12-04 13:29                                                     ` Petr Hluzín
2011-12-04 14:46                                                     ` Yao Qi
2011-12-04 17:00                                                       ` oza Pawandeep
2011-12-04 23:46                                                         ` Yao Qi
2011-12-05  5:35                                                           ` oza Pawandeep
2011-12-05  8:12                                                             ` Yao Qi
2011-12-05 16:02                                                               ` oza Pawandeep
2011-12-19  6:26                                                                 ` oza Pawandeep
2011-12-20 19:11                                                                 ` Tom Tromey
2011-12-28 12:43                                                                   ` oza Pawandeep
2012-01-05 11:01                                                                     ` oza Pawandeep
2012-01-05 12:03                                                                       ` Eli Zaretskii
2012-01-05 16:17                                                                       ` Tom Tromey
2012-01-05 18:17                                                                         ` oza Pawandeep
2012-01-06  8:06                                                                           ` oza Pawandeep
2012-01-06 19:13                                                                             ` Tom Tromey
2012-01-07  6:31                                                                               ` oza Pawandeep
2012-01-09 16:25                                                                                 ` Tom Tromey
2012-02-02  6:29                                                                                   ` oza Pawandeep
     [not found]                                                                                     ` <m38vkfoiut.fsf@fleche.redhat.com>
     [not found]                                                                                       ` <CAK1A=4xrUBzcG1i7NHyEtmAjwx0nbYmkePFS9_kQcS3E1gaduA@mail.gmail.com>
     [not found]                                                                                         ` <m3haz19ezl.fsf@fleche.redhat.com>
     [not found]                                                                                           ` <CAK1A=4w+yq9AvRMukPcKpZnGjrVnPbE3zdScwRd1Skubt0KHWA@mail.gmail.com>
2012-03-07  5:35                                                                                             ` oza Pawandeep
2012-03-08 16:32                                                                                               ` Tom Tromey
2012-03-09  9:30                                                                                                 ` oza Pawandeep
2012-03-09 16:47                                                                                                   ` Tom Tromey
2012-03-12  6:23                                                                                                     ` oza Pawandeep
2012-03-12  6:55                                                                                                       ` Yao Qi
2012-03-12  9:14                                                                                                         ` oza Pawandeep
2012-03-12 15:32                                                                                                           ` oza Pawandeep
2012-03-12 19:43                                                                                                             ` Tom Tromey
2012-03-13  5:41                                                                                                               ` oza Pawandeep
2011-12-03 15:06                                       ` oza Pawandeep
2011-12-20 19:05                                       ` Tom Tromey
  -- strict thread matches above, loose matches on Subject: below --
2011-08-10 17:09 chandra krishnappa
2011-08-11  1:34 ` Yao Qi
     [not found] <BANLkTins056mmtd_9U_4iYXEeC2jRZSRsA@mail.gmail.com>
2011-06-06 17:42 ` chandra krishnappa
2011-07-05  8:47   ` oza Pawandeep
2011-05-24  7:19 paawan oza
     [not found] <341905.10459.qm@web112513.mail.gq1.yahoo.com>
     [not found] ` <m3d3m8xdf7.fsf@fleche.redhat.com>
     [not found]   ` <208397.95006.qm@web112517.mail.gq1.yahoo.com>
     [not found]     ` <4DA27006.1080607@codesourcery.com>
2011-04-16 21:03       ` [PATCH] arm reversible : progress <phase_2_complete> paawan oza
2011-04-20 19:16         ` [PATCH] arm reversible : <phase_2_complete> paawan oza
2011-04-21 20:55           ` Petr Hluzín
2011-04-22  5:49             ` paawan oza
2011-04-22  5:55               ` oza Pawandeep
2011-04-25 14:03               ` paawan oza
2011-05-01  1:20                 ` Petr Hluzín
2011-05-02 14:47                   ` Tom Tromey
2011-05-04 21:33                     ` Petr Hluzín
2011-05-05 15:29                       ` Tom Tromey
2011-05-07 13:50                   ` paawan oza
2011-05-09 14:57                     ` Tom Tromey
2011-05-10  5:42                       ` paawan oza
2011-05-10 15:37                         ` Tom Tromey
2011-05-12  5:06                           ` paawan oza
2011-05-10  5:50                       ` paawan oza
2011-05-12 21:21                     ` Petr Hluzín
2011-05-24  6:44                       ` paawan oza
2011-05-07 13:56                   ` paawan oza
     [not found]               ` <172713.29831.qm__351.089161313389$1303740245$gmane$org@web112503.mail.gq1.yahoo.com>
2011-04-25 19:57                 ` Tom Tromey
2011-04-28 18:26                   ` paawan oza
2011-04-28 19:00                     ` Tom Tromey
2011-04-28 19:22                       ` paawan oza
     [not found]                       ` <727567.12089.qm__13056.408687453$1304018591$gmane$org@web112511.mail.gq1.yahoo.com>
2011-04-28 19:36                         ` Tom Tromey
2011-04-30 16:16                           ` paawan oza
2011-05-02 13:28                             ` Tom Tromey
2011-04-20 19:10 [PATCH] arm reversible <phase_2_complete> oza Pawandeep

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='CAK1A=4yA-kGtnS8BGU+9L7CHXCoMn5MG8sFr++hXvQjKEptrCw@mail.gmail.com' \
    --to=oza.pawandeep@gmail.com \
    --cc=chandra_roadking@yahoo.com \
    --cc=gdb-patches@sourceware.org \
    --cc=paawan1982@yahoo.com \
    --cc=petr.hluzin@gmail.com \
    --cc=tromey@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