From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12977 invoked by alias); 16 Jun 2004 15:44:08 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 12907 invoked from network); 16 Jun 2004 15:44:05 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 16 Jun 2004 15:44:05 -0000 Received: from drow by nevyn.them.org with local (Exim 4.34 #1 (Debian)) id 1Baca3-0006gt-CS; Wed, 16 Jun 2004 11:44:03 -0400 Date: Wed, 16 Jun 2004 15:44:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Cc: Michael Coulter , Jim Blandy , Elena Zannoni Subject: [rfa/dwarf] Handle debug_line extended ops correctly Message-ID: <20040616154402.GA25649@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com, Michael Coulter , Jim Blandy , Elena Zannoni Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-06/txt/msg00375.txt.bz2 This has been hanging around in my tree for a while. The HP-UX ia64 compiler generates things like this in .debug_line: Extended opcode 32: UNKNOWN: length 51 Extended opcode 32: UNKNOWN: length 146 146 is different as a byte and as a uleb128, so we get confused. Of course, we're going to bail out shortly anyway because we don't accept unknown extended ops (probably for the best); but we might as well parse the length right. OK? -- Daniel Jacobowitz 2004-06-16 Daniel Jacobowitz PR gdb/1658 * dwarf2read.c (dwarf_decode_lines): Read the length of the extended operation as a uleb128. Found by Michael Coulter. Index: gdb/dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.153 diff -u -p -r1.153 dwarf2read.c --- gdb/dwarf2read.c 15 Jun 2004 01:04:19 -0000 1.153 +++ gdb/dwarf2read.c 16 Jun 2004 15:38:49 -0000 @@ -5986,7 +5986,8 @@ dwarf_decode_lines (struct line_header * else switch (op_code) { case DW_LNS_extended_op: - line_ptr += 1; /* ignore length */ + read_unsigned_leb128 (abfd, line_ptr, &bytes_read); + line_ptr += bytes_read; extended_op = read_1_byte (abfd, line_ptr); line_ptr += 1; switch (extended_op)