This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Fix dwarf debug line info crash
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: binutils at sources dot redhat dot com
- Date: Thu, 18 Sep 2003 11:17:59 +0100
- Subject: Fix dwarf debug line info crash
- Organization: Codesourcery LLC
Hi,
I met a compiler that emits dwarf line sections with an initially empty
filename table. One of the first things it does is to define a filename
entry.
Fixed thusly, ok?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2003-09-18 Nathan Sidwell <nathan@codesourcery.com>
* dwarf2.c (decode_line_info): Cope with an initially empty
filename table.
Index: bfd/dwarf2.c
===================================================================
RCS file: /cvs/src/src/bfd/dwarf2.c,v
retrieving revision 1.49
diff -c -3 -p -r1.49 dwarf2.c
*** bfd/dwarf2.c 16 Apr 2003 00:30:24 -0000 1.49
--- bfd/dwarf2.c 18 Sep 2003 10:14:23 -0000
*************** decode_line_info (unit, stash)
*** 1168,1174 ****
{
/* State machine registers. */
bfd_vma address = 0;
! char * filename = concat_filename (table, 1);
unsigned int line = 1;
unsigned int column = 0;
int is_stmt = lh.default_is_stmt;
--- 1168,1174 ----
{
/* State machine registers. */
bfd_vma address = 0;
! char * filename = table->num_files ? concat_filename (table, 1) : NULL;
unsigned int line = 1;
unsigned int column = 0;
int is_stmt = lh.default_is_stmt;