From patchwork Wed Jul 5 16:07:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 21437 Received: (qmail 16741 invoked by alias); 5 Jul 2017 16:07:38 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 16717 invoked by uid 89); 5 Jul 2017 16:07:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:209.85.218.67, 18517, H*RU:209.85.218.67 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-oi0-f67.google.com Received: from mail-oi0-f67.google.com (HELO mail-oi0-f67.google.com) (209.85.218.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Jul 2017 16:07:35 +0000 Received: by mail-oi0-f67.google.com with SMTP id l130so28217518oib.2; Wed, 05 Jul 2017 09:07:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=P8zMoQCv9KVug7nv+6Lao9oxL5TvnsS++nrHQWqoTl4=; b=lxu0K8SUqKvMfHnQciDhBHkzvx0vRKXalQRr4VuU9vMRZDKupNnFn9f71eyY+uRnl4 6eYPJz/c5y+u3q0eeWmeLQmnaN0XwSKrjdTUkpIoUPTfeK2AipoZ2KVVKN8yhmSJ0HSm beGTb0+sqal5nG+d7eZcQaQ9iwTuw1gK11Ot2XP1GoW51lqea6jo492/0SRxV3AQLrSg rRIkssIePIHKi8rYd1y6cKTAXBOx+riibfDbmpd0gC6rau7kMKzEQ7ChcBW85gXzL1s/ 452dgbHB2CCtEoTpozXLKe+oMx5RZfqoaqqUsQl2zUvdEQ+uqoBiQ9hI5+bT5oDBh8Lm NB9w== X-Gm-Message-State: AKS2vOzSN/Y2lL4rJqOb7WDQrzx/txoNAJcvlZ7sDQU5386rjs13T3gJ W+aY7S1w36mj2TcQvIu7y9zlZxcqmQ== X-Received: by 10.202.83.74 with SMTP id h71mr23950379oib.135.1499270853825; Wed, 05 Jul 2017 09:07:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.141.84 with HTTP; Wed, 5 Jul 2017 09:07:33 -0700 (PDT) In-Reply-To: <20170704081018.GB27212@host1.jankratochvil.net> References: <20170701105702.GA31016@host1.jankratochvil.net> <20170704040325.GC14520@bubble.grove.modra.org> <20170704081018.GB27212@host1.jankratochvil.net> From: "H.J. Lu" Date: Wed, 5 Jul 2017 09:07:33 -0700 Message-ID: Subject: Re: [binutils commit] DWARF-5: Extend bfd/dwarf2.c parse_comp_unit() To: Jan Kratochvil Cc: Alan Modra , Binutils , GDB X-IsSubscribed: yes On Tue, Jul 4, 2017 at 1:10 AM, Jan Kratochvil wrote: > On Tue, 04 Jul 2017 06:03:25 +0200, Alan Modra wrote: >> On Sat, Jul 01, 2017 at 12:57:02PM +0200, Jan Kratochvil wrote: >> > 2017-07-01 Jan Kratochvil >> > >> > * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and >> > dwarf_line_str_size. >> > (struct attr_abbrev): Add field implicit_const. >> > (dwarf_debug_sections): Add .debug_line_str. >> > (enum dwarf_debug_section_enum): Add debug_line_str and debug_max. >> > (dwarf_debug_section_assert): Add static assertion. >> > (read_indirect_line_string): New. >> > (read_abbrevs): Support DW_FORM_implicit_const. >> > (is_str_attr): Support DW_FORM_line_strp. >> > (read_attribute_value): Support DW_FORM_line_strp and >> > DW_FORM_implicit_const. >> > (read_attribute): Support DW_FORM_implicit_const. >> > (line_info_add_include_dir, line_info_add_include_dir_stub): >> > (line_info_add_file_name, read_formatted_entries): New. >> > (decode_line_info, parse_comp_unit): Support DWARF 5. >> > (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer. >> >> OK. > > Checked in: > 0041f7df741692954ebc112c69e5326afb0115ba > I checked in this patch for GCC 4.2 build and will backport it to binutils 2.29. From 4a5c1e39e009d765cc094694fc1f1db8d52cc74c Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 5 Jul 2017 08:58:00 -0700 Subject: [PATCH] Fix build with GCC 4.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix GCC 4.2 warnings like: cc1: warnings being treated as errors binutils-gdb/bfd/dwarf2.c:1844: warning: declaration of ‘time’ shadows a global declaration /usr/include/time.h:187: warning: shadowed declaration is here binutils-gdb/bfd/dwarf2.c: In function ‘line_info_add_file_name’: binutils-gdb/bfd/dwarf2.c:1854: warning: declaration of ‘time’ shadows a global declaration /usr/include/time.h:187: warning: shadowed declaration is here bfd/ * dwarf2.c (line_info_add_include_dir_stub): Replace time with xtime. (line_info_add_file_name): Likewise. (decode_line_info): Likewise. binutils/ * dwarf.c (display_debug_names): Replace index with xindex. --- bfd/dwarf2.c | 13 +++++++------ binutils/dwarf.c | 16 +++++++++------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 5e674d4..04a2585 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -1841,7 +1841,7 @@ line_info_add_include_dir (struct line_info_table *table, char *cur_dir) static bfd_boolean line_info_add_include_dir_stub (struct line_info_table *table, char *cur_dir, unsigned int dir ATTRIBUTE_UNUSED, - unsigned int time ATTRIBUTE_UNUSED, + unsigned int xtime ATTRIBUTE_UNUSED, unsigned int size ATTRIBUTE_UNUSED) { return line_info_add_include_dir (table, cur_dir); @@ -1851,7 +1851,8 @@ line_info_add_include_dir_stub (struct line_info_table *table, char *cur_dir, static bfd_boolean line_info_add_file_name (struct line_info_table *table, char *cur_file, - unsigned int dir, unsigned int time, unsigned int size) + unsigned int dir, unsigned int xtime, + unsigned int size) { if ((table->num_files % FILE_ALLOC_CHUNK) == 0) { @@ -1869,7 +1870,7 @@ line_info_add_file_name (struct line_info_table *table, char *cur_file, table->files[table->num_files].name = cur_file; table->files[table->num_files].dir = dir; - table->files[table->num_files].time = time; + table->files[table->num_files].time = xtime; table->files[table->num_files].size = size; table->num_files++; return TRUE; @@ -2206,18 +2207,18 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) /* Read file name table. */ while ((cur_file = read_string (abfd, line_ptr, line_end, &bytes_read)) != NULL) { - unsigned int dir, time, size; + unsigned int dir, xtime, size; line_ptr += bytes_read; dir = _bfd_safe_read_leb128 (abfd, line_ptr, &bytes_read, FALSE, line_end); line_ptr += bytes_read; - time = _bfd_safe_read_leb128 (abfd, line_ptr, &bytes_read, FALSE, line_end); + xtime = _bfd_safe_read_leb128 (abfd, line_ptr, &bytes_read, FALSE, line_end); line_ptr += bytes_read; size = _bfd_safe_read_leb128 (abfd, line_ptr, &bytes_read, FALSE, line_end); line_ptr += bytes_read; - if (!line_info_add_file_name (table, cur_file, dir, time, size)) + if (!line_info_add_file_name (table, cur_file, dir, xtime, size)) goto fail; } diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 70aa011..5cada37 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -7887,13 +7887,14 @@ display_debug_names (struct dwarf_section *section, void *file) abbrevptr += bytes_read; for (;;) { - const dwarf_vma index = read_uleb128 (abbrevptr, &bytes_read, - abbrev_table_end); + const dwarf_vma xindex = read_uleb128 (abbrevptr, + &bytes_read, + abbrev_table_end); abbrevptr += bytes_read; const dwarf_vma form = read_uleb128 (abbrevptr, &bytes_read, abbrev_table_end); abbrevptr += bytes_read; - if (index == 0 && form == 0) + if (xindex == 0 && form == 0) break; } } @@ -7965,17 +7966,18 @@ display_debug_names (struct dwarf_section *section, void *file) printf (" %s", get_TAG_name (dwarf_tag)); for (;;) { - const dwarf_vma index = read_uleb128 (abbrevptr, &bytes_read, - abbrev_table_end); + const dwarf_vma xindex = read_uleb128 (abbrevptr, + &bytes_read, + abbrev_table_end); abbrevptr += bytes_read; const dwarf_vma form = read_uleb128 (abbrevptr, &bytes_read, abbrev_table_end); abbrevptr += bytes_read; - if (index == 0 && form == 0) + if (xindex == 0 && form == 0) break; if (tagno >= 0) - printf (" %s", get_IDX_name (index)); + printf (" %s", get_IDX_name (xindex)); entryptr = read_and_display_attr_value (0, form, 0, entryptr, unit_end, 0, 0, offset_size, -- 2.9.4