public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Nikola Prica <nikola.prica@rt-rk.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sourceware.org,
	"Ananthakrishna Sowda (asowda)" <asowda@cisco.com>,
	"Ivan Baev (ibaev)" <ibaev@cisco.com>,
	'Nemanja Popov' <nemanja.popov@rt-rk.com>,
	Djordje Todorovic <Djordje.Todorovic@rt-rk.com>
Subject: Re: [PING][PATCH] Fix for prologue processing on PowerPC
Date: Thu, 09 Nov 2017 18:15:00 -0000	[thread overview]
Message-ID: <8bf0014c-e83c-5988-4d06-173572f21186@rt-rk.com> (raw)
In-Reply-To: <20171108095850.394a48ca@pinnacle.lan>

Hi Kevin,

lr_reg could be also set to -2 in part of code which is reachable after 
shifting removal.

       /* Invalidate lr_reg, but don't set it to -1.
          That would mean that it had never been set.  */
       lr_reg = -2;

This part of the code which depends of non shifted lr_reg, and the part 
where shifting is removed are only two places where lr_reg is changed. 
As so, I've added last condition to set fdata->lr_register on -1 if 
lim_pc is not reached.

If it seems fine now could you pleas commit it because I don't have 
rights to do it.

Thanks,

Nikola Prica


From: Prica <nprica@rt-rk.com>
Date: Thu, 9 Nov 2017 13:10:48 +0100
Subject: Fix for prologue processing on PowerPC

One of conditions in skip_prologue() is never visited because it
expects non shifted `lr_reg`.  That condition is supposed to set PC
offset.  When body of this condition is visited PC offset is set and
there will be no need to look for it in next frames nor to use frame
unwind directives.

gdb/ChangeLog:

	*rs6000-tdep.c (skip_prologue): Remove shifting for lr_reg
   	and assign shifted lr_reg to fdata->lr_register when lr_reg is
   	set. If iteration do not hit lim_pc lr_register is set as -1.
---
  gdb/rs6000-tdep.c | 13 ++++++++-----
  1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 6c44995..6f05ef5 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -1655,9 +1655,12 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR 
pc, CORE_ADDR lim_pc,
  	     remember just the first one, but skip over additional
  	     ones.  */
  	  if (lr_reg == -1)
-	    lr_reg = (op & 0x03e00000) >> 21;
-          if (lr_reg == 0)
-            r0_contains_arg = 0;
+      {
+        lr_reg = (op & 0x03e00000);
+        fdata->lr_register = lr_reg >> 21;
+        if (lr_reg == 0)
+          r0_contains_arg = 0;
+      }
  	  continue;
  	}
        else if ((op & 0xfc1fffff) == 0x7c000026)
@@ -2180,8 +2183,8 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR 
pc, CORE_ADDR lim_pc,
      }
  #endif /* 0 */

-  if (pc == lim_pc && lr_reg >= 0)
-    fdata->lr_register = lr_reg;
+  if (pc != lim_pc)
+    fdata->lr_register = -1;

    fdata->offset = -fdata->offset;
    return last_prologue_pc;
-- 
2.7.4

  reply	other threads:[~2017-11-09 18:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-22 12:11 Nikola Prica
2017-10-05  2:01 ` Kevin Buettner
2017-10-26 10:02 ` [PING]Fix " Nikola Prica
2017-11-08 16:58   ` Kevin Buettner
2017-11-09 18:15     ` Nikola Prica [this message]
2017-12-01 19:37       ` [PING][PATCH] Fix " pedromfc
2017-12-19 15:57         ` Nikola Prica
2017-12-29 18:05           ` Pedro Franco de Carvalho
2018-01-09 11:22             ` Nikola Prica
2018-01-10 17:26               ` Pedro Franco de Carvalho
2018-01-11 15:12                 ` Nikola Prica
2018-01-19  7:49                   ` Nikola Prica
2018-01-19 19:01                     ` Pedro Franco de Carvalho
2018-01-19 19:08                     ` Pedro Franco de Carvalho
2018-01-27 14:32                       ` Nikola Prica
2018-01-31 18:04                         ` Pedro Franco de Carvalho
2018-01-31 18:28                           ` Ulrich Weigand
2018-02-01 13:09                             ` Nikola Prica
2018-01-02 10:29           ` Yao Qi

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=8bf0014c-e83c-5988-4d06-173572f21186@rt-rk.com \
    --to=nikola.prica@rt-rk.com \
    --cc=Djordje.Todorovic@rt-rk.com \
    --cc=asowda@cisco.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ibaev@cisco.com \
    --cc=kevinb@redhat.com \
    --cc=nemanja.popov@rt-rk.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).