Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jiong Wang <jiwang@tilera.com>
To: Pedro Alves <palves@redhat.com>
Cc: Yao Qi <yao@codesourcery.com>,
	Joel Brobecker <brobecker@adacore.com>,
	<gdb-patches@sourceware.org>, Walter Lee <walt@tilera.com>
Subject: [COMMITTED][RFC/TileGX 2/6] simplify the handling of skip prologue for plt stub
Date: Sat, 02 Mar 2013 01:40:00 -0000	[thread overview]
Message-ID: <51315892.1020801@tilera.com> (raw)
In-Reply-To: <5130D06A.9000701@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 740 bytes --]

On 03/01/2013 11:59 PM, Pedro Alves wrote:
> "improve" is a "Why?", and subjective.  ChangeLogs are objective, and document
> the "What" changed.  I suggest:
>
>           * tilegx-tdep.c (tilegx_analyze_prologue): Limit bundle reading to END_ADDR.
>           (tilegx_skip_prologue): Limit prologue analysis to section end.
>
>>   tilegx_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
>>   {
>> -  CORE_ADDR func_start;
>> +  CORE_ADDR func_start, end_pc;
>> +  struct obj_section *s = NULL;
> No need to initialize 's' here, it's unconditionally initialized below.
>
>> +  s = find_pc_section (start_pc);
> OK with these changes.
>
> Thanks.
>
thanks, all fixed, and committed.

-- 
Regards,
Jiong. Wang
Tilera Corporation.


[-- Attachment #2: committed.patch --]
[-- Type: text/x-patch, Size: 2022 bytes --]

Index: gdb/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.15197
diff -u -r1.15197 ChangeLog
--- gdb/ChangeLog	1 Mar 2013 21:18:18 -0000	1.15197
+++ gdb/ChangeLog	2 Mar 2013 01:31:04 -0000
@@ -1,3 +1,10 @@
+2013-03-01  Jiong Wang  <jiwang@tilera.com>
+	    Pedro Alves  <palves@redhat.com>
+
+	* tilegx-tdep.c (tilegx_analyze_prologue): Limit bundle reading
+	to END_ADDR.
+	(tilegx_skip_prologue): Limit prologue analysis to section end.
+
 2013-03-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	* dwarf2loc.c (call_site_find_chain_1): New variable save_callee_pc,
Index: gdb/tilegx-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/tilegx-tdep.c,v
retrieving revision 1.9
diff -u -r1.9 tilegx-tdep.c
--- gdb/tilegx-tdep.c	1 Mar 2013 10:45:28 -0000	1.9
+++ gdb/tilegx-tdep.c	2 Mar 2013 01:31:29 -0000
@@ -433,6 +433,8 @@
 
 	  if (instbuf_size > size_on_same_page)
 	    instbuf_size = size_on_same_page;
+
+	  instbuf_size = min (instbuf_size, (end_addr - next_addr));
 	  instbuf_start = next_addr;
 
 	  status = safe_frame_unwind_memory (next_frame, instbuf_start,
@@ -745,7 +747,8 @@
 static CORE_ADDR
 tilegx_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
 {
-  CORE_ADDR func_start;
+  CORE_ADDR func_start, end_pc;
+  struct obj_section *s;
 
   /* This is the preferred method, find the end of the prologue by
      using the debugging information.  */
@@ -758,10 +761,16 @@
         return max (start_pc, post_prologue_pc);
     }
 
+  /* Don't straddle a section boundary.  */
+  s = find_pc_section (start_pc);
+  end_pc = start_pc + 8 * TILEGX_BUNDLE_SIZE_IN_BYTES;
+  if (s != NULL)
+    end_pc = min (end_pc, obj_section_endaddr (s));
+
   /* Otherwise, try to skip prologue the hard way.  */
   return tilegx_analyze_prologue (gdbarch,
 				  start_pc,
-				  start_pc + 8 * TILEGX_BUNDLE_SIZE_IN_BYTES,
+				  end_pc,
 				  NULL, NULL);
 }
 

      reply	other threads:[~2013-03-02  1:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-18  9:25 [RFC/TileGX " Jiong Wang
2013-01-18 13:15 ` Joel Brobecker
2013-01-18 15:12   ` Jiong Wang
2013-01-18 17:30     ` Pedro Alves
2013-02-15  3:22       ` Jiong Wang
2013-02-16  4:50     ` Yao Qi
2013-02-20  2:49       ` Jiong Wang
2013-02-20  4:11         ` Yao Qi
2013-02-21 13:40           ` Jiong Wang
2013-03-01 10:35             ` Jiong Wang
2013-03-01 11:31             ` Pedro Alves
2013-03-01 14:08               ` Jiong Wang
2013-03-01 15:59                 ` Pedro Alves
2013-03-02  1:40                   ` Jiong Wang [this message]

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=51315892.1020801@tilera.com \
    --to=jiwang@tilera.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=walt@tilera.com \
    --cc=yao@codesourcery.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