[1/2] Remove pst from dwarf_decode_lines_1

Message ID 1407307813-5321-1-git-send-email-yao@codesourcery.com
State Committed
Headers

Commit Message

Yao Qi Aug. 6, 2014, 6:50 a.m. UTC
  Hi,
Parameter 'pst' of function dwarf_decode_lines_1 isn't used except
to compute decode_for_pst_p, which has been got in the caller
dwarf_decode_lines.  I wonder it would be good if we just pass
'decode_for_pst_p'.

gdb:

2014-08-06  Yao Qi  <yao@codesourcery.com>

	* dwarf2read.c (dwarf_decode_lines_1): Remove parameter 'pst'.
	Add parameter 'decode_for_pst_p'.  Callers update.
---
 gdb/dwarf2read.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
  

Comments

Yao Qi Aug. 13, 2014, 11:57 a.m. UTC | #1
On 08/06/2014 02:50 PM, Yao Qi wrote:
> gdb:
> 
> 2014-08-06  Yao Qi  <yao@codesourcery.com>
> 
> 	* dwarf2read.c (dwarf_decode_lines_1): Remove parameter 'pst'.
> 	Add parameter 'decode_for_pst_p'.  Callers update.

Ping.
  
Doug Evans Aug. 13, 2014, 6:58 p.m. UTC | #2
On Wed, Aug 13, 2014 at 4:57 AM, Yao Qi <yao@codesourcery.com> wrote:
> On 08/06/2014 02:50 PM, Yao Qi wrote:
>> gdb:
>>
>> 2014-08-06  Yao Qi  <yao@codesourcery.com>
>>
>>       * dwarf2read.c (dwarf_decode_lines_1): Remove parameter 'pst'.
>>       Add parameter 'decode_for_pst_p'.  Callers update.
>
> Ping.

LGTM
  
Yao Qi Aug. 14, 2014, 11:50 p.m. UTC | #3
On 08/14/2014 02:58 AM, Doug Evans wrote:
> On Wed, Aug 13, 2014 at 4:57 AM, Yao Qi <yao@codesourcery.com> wrote:
>> On 08/06/2014 02:50 PM, Yao Qi wrote:
>>> gdb:
>>>
>>> 2014-08-06  Yao Qi  <yao@codesourcery.com>
>>>
>>>       * dwarf2read.c (dwarf_decode_lines_1): Remove parameter 'pst'.
>>>       Add parameter 'decode_for_pst_p'.  Callers update.
>>
>> Ping.
> 
> LGTM
> 

Patch is pushed in.  Thanks for the review.  Could you review
this patch too?

  [PATCH 2/2] Check function is GC'ed
  https://sourceware.org/ml/gdb-patches/2014-08/msg00067.html

They are in one series.
  
Yao Qi Aug. 15, 2014, 1:59 a.m. UTC | #4
On 08/15/2014 07:50 AM, Yao Qi wrote:
> Could you review
> this patch too?
> 
>   [PATCH 2/2] Check function is GC'ed
>   https://sourceware.org/ml/gdb-patches/2014-08/msg00067.html
> 
> They are in one series.

Doug, if you haven't started review, could you please pause for a while?
I find some other places in dwarf2read.c need the similar fix too.  I'll
post an updated version.
  

Patch

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 8f5d9d4..8011e4e 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -17179,7 +17179,7 @@  noop_record_line (struct subfile *subfile, int line, CORE_ADDR pc)
 
 static void
 dwarf_decode_lines_1 (struct line_header *lh, const char *comp_dir,
-		      struct dwarf2_cu *cu, struct partial_symtab *pst)
+		      struct dwarf2_cu *cu, const int decode_for_pst_p)
 {
   const gdb_byte *line_ptr, *extended_end;
   const gdb_byte *line_end;
@@ -17189,7 +17189,6 @@  dwarf_decode_lines_1 (struct line_header *lh, const char *comp_dir,
   struct objfile *objfile = cu->objfile;
   bfd *abfd = objfile->obfd;
   struct gdbarch *gdbarch = get_objfile_arch (objfile);
-  const int decode_for_pst_p = (pst != NULL);
   struct subfile *last_subfile = NULL;
   void (*p_record_line) (struct subfile *subfile, int line, CORE_ADDR pc)
     = record_line;
@@ -17507,7 +17506,7 @@  dwarf_decode_lines (struct line_header *lh, const char *comp_dir,
   struct subfile *first_subfile = current_subfile;
 
   if (want_line_info)
-    dwarf_decode_lines_1 (lh, comp_dir, cu, pst);
+    dwarf_decode_lines_1 (lh, comp_dir, cu, decode_for_pst_p);
 
   if (decode_for_pst_p)
     {