Bug 15343 - Crash when setting a breakpoint in assembler file compiled by ARM tool chain
Summary: Crash when setting a breakpoint in assembler file compiled by ARM tool chain
Status: RESOLVED DUPLICATE of bug 14983
Alias: None
Product: gdb
Classification: Unclassified
Component: symtab (show other bugs)
Version: 7.5
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-08 07:57 UTC by Andreas Kaufmann
Modified: 2013-04-12 17:45 UTC (History)
1 user (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: arm-unknown-elf
Build: 7.5.1
Last reconfirmed:


Attachments
Elf file, which causes gdb crash (708 bytes, application/octet-stream)
2013-04-08 07:57 UTC, Andreas Kaufmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kaufmann 2013-04-08 07:57:49 UTC
Created attachment 6969 [details]
Elf file, which causes gdb crash

gdb crashes when trying to set a breakpoint in 
an assembler file compiled by ARM tool chain. This happens for part
of assembler code inside some assembler macro.

Here are the steps to reproduce the problem:

**** Use the following file gdb_crash.s: 
                MACRO
                MY_MACRO

                AREA    | Header CODE|, CODE
Start
                MOV     r1, #1
                MOV     r2, #1
                MOV     r3, #1
                B       Entry 

                AREA    |Main CODE|, CODE, ALIGN=12
Entry
                MOV     r0,  #0
                MEND

                MY_MACRO
        END

*** Compile it with ARM tool chain.
I see the problem when using ARM tool chain RVD4.0 or 
DS-5/v5.12 on Linux RedHat 4.
Compile the above file with the following commands:

* armasm --arm -g gdb_crash.s 
* armlink --elf --noremove \
    --ro-base 0x00000000 --entry 0x00000000 gdb_crash.o  -o gdb_crash.elf

The file gdb_crash.elf is attached.


*** Run gdb
Use gdb 7.5.1 configured as "--host=x86_64-unknown-linux-gnu --target=arm-unknown-elf".

* gdb gdb_crash.elf
* br *0x0
Segmentation fault

Apparently ARM assembler doesn't generate any debug line information for
included assembler macro and gdb fails to handle such situation.

This bug is probably the same issue as described in 
http://sourceware.org/bugzilla/show_bug.cgi?id=14983
I also see the crash in latest gdb 7.6 sources.

I will submit a patch for this crash.
Comment 1 Andreas Kaufmann 2013-04-08 08:27:40 UTC
Proposed patch for this issue:
http://sourceware.org/ml/gdb-patches/2013-04/msg00171.html
Comment 2 Tom Tromey 2013-04-12 17:45:35 UTC
Duplicate.

*** This bug has been marked as a duplicate of bug 14983 ***