Test "gdb.dwarf2/dw2-case-insensitive.exp: p fuNC_lang" fails.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Linaro GDB |
Fix Released
|
Undecided
|
Thiago Jung Bauermann |
Bug Description
The handwritten DWARF information for FUNC_lang is wrong.
Ulrich explains:
In general, the last bit in *function
pointer values* indicates whether the target function is an ARM (if 0)
or Thumb (if 1) routine. The *PC address* however should in either case
refer to the actual address.
In the dw2-case-
.uleb128 3 /* Abbrev:
DW_TAG_subprogram */
.byte 1 /* DW_AT_external */
.ascii "FUNC_lang\0" /* DW_AT_name */
.4byte FUNC_lang /* DW_AT_low_pc */
.4byte main /* DW_AT_high_pc */
.byte 1 /* DW_AT_prototyped */
.4byte .Ltype - .Lcu1_begin /* DW_AT_type */
Now this reference (via a data operation) to a Thumb function symbol
FUNC_lang is interpreted by binutils as creating a function pointer
value, and therefore it sets the low bit.
This is actually *incorrect*. The DWARF DW_AT_low_
should refer to the actual PC range the function spans, so it should
*not* have any low bits set.
If you were to generate DWARF by the compiler itself, this would actually
work out correctly, this the compiler does:
.global FUNC_lang
.thumb
.thumb_func
.type FUNC_lang, %function
FUNC_lang:
.LFB0:
.file 1
"/home/
@ /home/uweigand/
.loc 1 22 0
[...]
.uleb128 0x2 @ (DIE (0x21) DW_TAG_subprogram)
.byte 0x1 @ DW_AT_external
.4byte .LASF0 @ DW_AT_name: "FUNC_lang"
.byte 0x1 @ DW_AT_decl_file
(/home/
.byte 0x15 @ DW_AT_decl_line
.byte 0x1 @ DW_AT_prototyped
.4byte .LFB0 @ DW_AT_low_pc
.4byte .LFE0 @ DW_AT_high_pc
.4byte .LLST0 @ DW_AT_frame_base
Note that while FUNC_lang is marked as .thumb_func (which will
cause the assembler/linker to set the low bit where necessary),
the .LFB0 symbol is not; thus the reference to .LFB0 in the
DW_AT_low_pc attribute will not have the low bit set.
Changed in gdb-linaro: | |
status: | Confirmed → Fix Released |
This is on gdb-linaro- 7.4-2012. 02.