public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [Patch]: bfd/dwarf2.c: ignore DW_LNE_HP_source_file_correlation
@ 2012-04-20 10:04 Tristan Gingold
  2012-04-26 13:27 ` Alan Modra
  0 siblings, 1 reply; 3+ messages in thread
From: Tristan Gingold @ 2012-04-20 10:04 UTC (permalink / raw)
  To: binutils Development

Hi,

HP compilers (I think only on VMS) have added a private extended opcode to LN.
Currently, the dwarf2 reader in bfd emits an error message for unknown LNE and fails.
With this patch, it will ignore this private opcode.

No regressions while cross testing for x86_64-elf.

Ok for trunk ?

Tristan.

bfd/
2012-02-06  Tristan Gingold  <gingold@adacore.com>

	* dwarf2.c (decode_line_info): Ignore
	DW_LNE_HP_source_file_correlation.

diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 66fd16f..dc71073 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -1401,6 +1401,7 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
   unsigned int i, bytes_read, offset_size;
   char *cur_file, *cur_dir;
   unsigned char op_code, extended_op, adj_opcode;
+  unsigned int exop_len;
   bfd_size_type amt;
 
   if (! read_section (abfd, &stash->debug_sections[debug_line],
@@ -1604,8 +1605,8 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
 	  else switch (op_code)
 	    {
 	    case DW_LNS_extended_op:
-	      /* Ignore length.  */
-	      line_ptr += 1;
+              exop_len = read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+	      line_ptr += bytes_read;
 	      extended_op = read_1_byte (abfd, line_ptr);
 	      line_ptr += 1;
 
@@ -1658,6 +1659,9 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash)
 		  (void) read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
 		  line_ptr += bytes_read;
 		  break;
+                case DW_LNE_HP_source_file_correlation:
+                  line_ptr += exop_len - 1;
+                  break;
 		default:
 		  (*_bfd_error_handler) (_("Dwarf Error: mangled line number section."));
 		  bfd_set_error (bfd_error_bad_value);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch]: bfd/dwarf2.c: ignore DW_LNE_HP_source_file_correlation
  2012-04-20 10:04 [Patch]: bfd/dwarf2.c: ignore DW_LNE_HP_source_file_correlation Tristan Gingold
@ 2012-04-26 13:27 ` Alan Modra
  2012-05-03 12:49   ` Tristan Gingold
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Modra @ 2012-04-26 13:27 UTC (permalink / raw)
  To: Tristan Gingold; +Cc: binutils Development

On Fri, Apr 20, 2012 at 11:59:50AM +0200, Tristan Gingold wrote:
> 	* dwarf2.c (decode_line_info): Ignore
> 	DW_LNE_HP_source_file_correlation.

OK.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch]: bfd/dwarf2.c: ignore DW_LNE_HP_source_file_correlation
  2012-04-26 13:27 ` Alan Modra
@ 2012-05-03 12:49   ` Tristan Gingold
  0 siblings, 0 replies; 3+ messages in thread
From: Tristan Gingold @ 2012-05-03 12:49 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils Development


On Apr 26, 2012, at 3:17 PM, Alan Modra wrote:

> On Fri, Apr 20, 2012 at 11:59:50AM +0200, Tristan Gingold wrote:
>> 	* dwarf2.c (decode_line_info): Ignore
>> 	DW_LNE_HP_source_file_correlation.
> 
> OK.

Thanks, committed.

Tristan.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-03 12:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-20 10:04 [Patch]: bfd/dwarf2.c: ignore DW_LNE_HP_source_file_correlation Tristan Gingold
2012-04-26 13:27 ` Alan Modra
2012-05-03 12:49   ` Tristan Gingold

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).