This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA/dwarf2] Small problem scanning line table for included files


Hello,

I noticed that gdb.base/sep.exp fails with GCC 3.4. The attached
patch fixes it (the comment should explain how).

For the record, here is the line table generated by 3.4 for sep.c:

> The File Name Table:
>  Entry Dir     Time    Size    Name
>  1     0       0       0       sep-proc.c
>  2     0       0       0       sep.c
>
> Line Number Statements:
>  Extended opcode 2: set Address to 0x0
>  Advance Line by 23 to 24
>  Copy
>  Special opcode 90: advance Address by 6 to 0x6 and Line by 1 to 25
>  Special opcode 174: advance Address by 12 to 0x12 and Line by 1 to 26
>  Set File Name to entry 2 in the File Name Table
>  Special opcode 38: advance Address by 2 to 0x14 and Line by 5 to 31
>  Advance PC by constant 17 to 0x25
>  Special opcode 160: advance Address by 11 to 0x30 and Line by 1 to 32
>  Special opcode 76: advance Address by 5 to 0x35 and Line by 1 to 33
>  Special opcode 76: advance Address by 5 to 0x3a and Line by 1 to 34
>  Advance PC by 2 to 3c
>  Extended opcode 1: End of Sequence

And here is the line table generated by 3.2:

> The File Name Table:
>  Entry Dir     Time    Size    Name
>  1     0       0       0       sep.c
>  2     1       0       0       types.h
>  3     2       0       0       wchar.h
>  4     3       0       0       stddef.h
>  5     2       0       0       _G_config.h
>  6     2       0       0       gconv.h
>  7     2       0       0       libio.h
>  8     3       0       0       stdio.h
>  9     0       0       0       sep-proc.c
>  10    3       0       0       stdarg.h
>
> Line Number Statements:
>  Set File Name to entry 9 in the File Name Table
>  Extended opcode 2: set Address to 0x0
>  Advance Line by 23 to 24
>  Copy
>  Special opcode 90: advance Address by 6 to 0x6 and Line by 1 to 25
>  Special opcode 174: advance Address by 12 to 0x12 and Line by 1 to 26
>  Set File Name to entry 1 in the File Name Table
>  Special opcode 38: advance Address by 2 to 0x14 and Line by 5 to 31
>  Special opcode 230: advance Address by 16 to 0x24 and Line by 1 to 32
>  Special opcode 76: advance Address by 5 to 0x29 and Line by 1 to 33
>  Special opcode 76: advance Address by 5 to 0x2e and Line by 1 to 34
>  Advance PC by 2 to 30
>  Extended opcode 1: End of Sequence

The new line info with GCC 3.4 is much better, but tricks current GDB.

2004-07-25  Joel Brobecker  <brobecker@gnat.com>

        * dwarf2read.c (dwarf_decode_lines): Handle the case when a set_file
        instruction is not emitted for the first file, as it is implicit
        at the begining of the line number program.
        Fixes [D721-012].

Tested on x86-linux, fixes the 2 regressions in sep.exp.
OK to commit?

Thanks,
-- 
Joel

Attachment: dwarf2read.c.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]