From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13769 invoked by alias); 21 Aug 2002 04:56:59 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 13762 invoked from network); 21 Aug 2002 04:56:58 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 21 Aug 2002 04:56:58 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g7L4gcl28998 for ; Wed, 21 Aug 2002 00:42:38 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g7L4uvY10910 for ; Wed, 21 Aug 2002 00:56:57 -0400 Received: from localhost.localdomain (IDENT:nYAHVZ+TmUvAqHZK8Tp6v2IgA9W1KouN@romulus.sfbay.redhat.com [172.16.27.251]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g7L4uvW03490 for ; Wed, 21 Aug 2002 00:56:57 -0400 Content-Type: text/plain; charset="us-ascii" From: "Martin M. Hunt" Organization: Red Hat Inc To: gdb@sources.redhat.com Subject: DWARF2 line number problem Date: Tue, 20 Aug 2002 21:56:00 -0000 User-Agent: KMail/1.4.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200208202156.14042.hunt@redhat.com> X-SW-Source: 2002-08/txt/msg00240.txt.bz2 I have a problem and I'm not sure what the correct solution would be. I'm looking at gcc mips output. The compilation unit says pointer size is 4, but the DWARF line section is setting the address to a sign-extended 8-byte value. GDB cleverly ignores the actual size of the extended opcode and reads a 4-byte value then starts parsing the rest of the bytes as line opcodes! Is it OK for DWARF to have 8-byte sign-extended addresses in a CU where the pointer size is 4 bytes? How to fix GDB? The problem is in dwarf_decode_lines() and there is even a comment documenting the bug ("ignore length"). case DW_LNS_extended_op: line_ptr += 1; /* ignore length */ extended_op = read_1_byte (abfd, line_ptr); line_ptr += 1; Obviously we must check the length. If we decide we must accept 8-byte lengths, then I guess we simply advance the pointer by 4 bytes before reading (for big-endian) or after reading (for little endian). Any better suggestions? -- Martin Hunt GDB Engineer Red Hat, Inc.