mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00
backend: dwarfdbginf: DW_TAG_subprogram should have DW_AT_decl_column
Fix issue #22423. Signed-off-by: Luís Ferreira <contact@lsferreira.net>
This commit is contained in:
parent
0befa1bc6a
commit
73c87a8acd
4 changed files with 23 additions and 2 deletions
|
@ -180,7 +180,7 @@ struct Srcpos
|
||||||
{
|
{
|
||||||
nothrow:
|
nothrow:
|
||||||
uint Slinnum; // 0 means no info available
|
uint Slinnum; // 0 means no info available
|
||||||
uint Scharnum;
|
uint Scharnum; // 0 means no info available
|
||||||
version (SCPP)
|
version (SCPP)
|
||||||
{
|
{
|
||||||
Sfile **Sfilptr; // file
|
Sfile **Sfilptr; // file
|
||||||
|
@ -203,7 +203,7 @@ nothrow:
|
||||||
|
|
||||||
const(char*) name() const { return Sfilename; }
|
const(char*) name() const { return Sfilename; }
|
||||||
|
|
||||||
static Srcpos create(const(char)* filename, uint linnum, int charnum)
|
static Srcpos create(const(char)* filename, uint linnum, uint charnum)
|
||||||
{
|
{
|
||||||
// Cannot have constructor because Srcpos is used in a union
|
// Cannot have constructor because Srcpos is used in a union
|
||||||
Srcpos sp;
|
Srcpos sp;
|
||||||
|
|
|
@ -1882,6 +1882,7 @@ static if (1)
|
||||||
|
|
||||||
abuf.writeByte(DW_AT_decl_file); abuf.writeByte(DW_FORM_data1);
|
abuf.writeByte(DW_AT_decl_file); abuf.writeByte(DW_FORM_data1);
|
||||||
abuf.writeByte(DW_AT_decl_line); abuf.writeByte(DW_FORM_data2);
|
abuf.writeByte(DW_AT_decl_line); abuf.writeByte(DW_FORM_data2);
|
||||||
|
abuf.writeByte(DW_AT_decl_column); abuf.writeByte(DW_FORM_data2);
|
||||||
if (ret_type)
|
if (ret_type)
|
||||||
{
|
{
|
||||||
abuf.writeByte(DW_AT_type); abuf.writeByte(DW_FORM_ref4);
|
abuf.writeByte(DW_AT_type); abuf.writeByte(DW_FORM_ref4);
|
||||||
|
@ -1923,6 +1924,7 @@ static if (1)
|
||||||
debug_info.buf.writeString(sfunc.Sident.ptr); // DW_AT_MIPS_linkage_name
|
debug_info.buf.writeString(sfunc.Sident.ptr); // DW_AT_MIPS_linkage_name
|
||||||
debug_info.buf.writeByte(filenum); // DW_AT_decl_file
|
debug_info.buf.writeByte(filenum); // DW_AT_decl_file
|
||||||
debug_info.buf.write16(sfunc.Sfunc.Fstartline.Slinnum); // DW_AT_decl_line
|
debug_info.buf.write16(sfunc.Sfunc.Fstartline.Slinnum); // DW_AT_decl_line
|
||||||
|
debug_info.buf.write16(sfunc.Sfunc.Fstartline.Scharnum); // DW_AT_decl_column
|
||||||
if (ret_type)
|
if (ret_type)
|
||||||
debug_info.buf.write32(ret_type); // DW_AT_type
|
debug_info.buf.write32(ret_type); // DW_AT_type
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
DW_AT_name : issue22423
|
||||||
|
DW_AT_name : issue22423.issue22423func
|
||||||
|
DW_AT_decl_line : 1000
|
||||||
|
DW_AT_decl_column : 10
|
||||||
|
DW_AT_decl_line : 2000
|
||||||
|
DW_AT_decl_column : 20
|
||||||
|
D main
|
||||||
|
issue22423._d_cmain!().main
|
11
test/dshell/extra-files/dwarf/issue22423.d
Executable file
11
test/dshell/extra-files/dwarf/issue22423.d
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#line 1000
|
||||||
|
void main() // col: 10
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#line 2000
|
||||||
|
void issue22423func() pure // col: 20
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue