[llvm-dev] LLD PDB Lines zero number issue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] LLD PDB Lines zero number issue

Jeremy Morse via llvm-dev

Hello Rui,

We meet an LLD PDB issue that if we link assembly code with C code and set >= -O1 level optimization in LTO, the executable’s PDB will contain wrong zero Lines for the assembly code in DEBUG_S_LINES subsection, and then our COFF source debuggers will fail to do the source-level debug on the executable.  This issue is same in both Linux and Windows, and I figure out a simple case in Linux to reproduce this issue as below. Please help to give us some advices on how to solve the zero Lines issue.

 

$ cat main.c

void assembly_fun();

int main()

{

  int Index1;

  for (Index1 = 0; Index1 == 0; assembly_fun(), Index1++){

    assembly_fun();

  }

  assembly_fun();

}

 

$ cat assembly.nasm

    DEFAULT REL

    SECTION .text

global assembly_fun

assembly_fun:

  ret

 

$ cat makefile_clanglto_Oz

CC_FLAGS= -g  -m64 -mcmodel=small -target x86_64-unknown-windows -gcodeview -flto -Oz

CC = /home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang

DLINK_FLAGS = /Machine:X64 /DLL /ENTRY:main /DEBUG:GHASH /lldmap

DLINK = /home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/lld-link

SLINK = /home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-lib

build:

        "$(CC)" $(CC_FLAGS) -c -o main.obj  main.c

        "nasm" -f win64 -o assembly.obj assembly.nasm

        "$(SLINK)" /OUT:main.lib main.obj

        "$(SLINK)" /OUT:assembly.lib assembly.obj

        "$(DLINK)" /OUT:main.dll $(DLINK_FLAGS) main.lib assembly.lib

clean:

        rm -f *.obj *.lib *.pdb *.dll *.map

 

$ make -f makefile_clanglto_Oz

$ llvm-pdbutil dump -l main.pdb

 

                           Lines

============================================================

Mod 0000 | `assembly.obj`:

Mod 0001 | `/home/jshi19/llvm/wrongcode/lld-link5/lto.tmp`:

/home/jshi19/llvm/wrongcode/lld-link5/main.c (MD5: 5F82BB79FE2DA0B0549B784CFDC37D05)

  0001:00000004-0000001E, line/addr entries = 5

     3 00000004 !    0 00000008 !    5 0000000D !    0 00000012 !    9 00000017 !

 

If we disable the optimization in the CC_FLAGS with -O0 as below, the PDB Lines will become correct non-zero numbers.

 

CC_FLAGS= -g  -m64 -mcmodel=small -target x86_64-unknown-windows -gcodeview -flto -O0

$ llvm-pdbutil dump -l main.pdb

 

                           Lines

============================================================

Mod 0000 | `assembly.obj`:

Mod 0001 | `/home/jshi19/llvm/wrongcode/lld_PDB_issue/lto.tmp`:

/home/jshi19/llvm/wrongcode/lld_PDB_issue/main.c (MD5: 5F82BB79FE2DA0B0549B784CFDC37D05)

  0001:00000010-00000050, line/addr entries = 6

     3 00000010 !    5 0000001C !    6 0000002B !    5 00000030 !    8 00000042 !    9 00000047 !

 

 

Thanks

Steven Shi

 

 


_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

lld_PDB_issue_4_rui.zip (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] LLD PDB Lines zero number issue

Jeremy Morse via llvm-dev
+rnk who works on COFF debugging things.

 My understanding is that this has nothing to do with the linker - but is a function of LLVM optimizations creating line zero debug locations. I believe rnk & folks have disabled line zero emission for CodeView debug info in some manner - perhaps that needs a flag? or Steven hasn't got a release with that change in it?

On Thu, Jan 9, 2020 at 4:47 AM Shi, Steven via llvm-dev <[hidden email]> wrote:

Hello Rui,

We meet an LLD PDB issue that if we link assembly code with C code and set >= -O1 level optimization in LTO, the executable’s PDB will contain wrong zero Lines for the assembly code in DEBUG_S_LINES subsection, and then our COFF source debuggers will fail to do the source-level debug on the executable.  This issue is same in both Linux and Windows, and I figure out a simple case in Linux to reproduce this issue as below. Please help to give us some advices on how to solve the zero Lines issue.

 

$ cat main.c

void assembly_fun();

int main()

{

  int Index1;

  for (Index1 = 0; Index1 == 0; assembly_fun(), Index1++){

    assembly_fun();

  }

  assembly_fun();

}

 

$ cat assembly.nasm

    DEFAULT REL

    SECTION .text

global assembly_fun

assembly_fun:

  ret

 

$ cat makefile_clanglto_Oz

CC_FLAGS= -g  -m64 -mcmodel=small -target x86_64-unknown-windows -gcodeview -flto -Oz

CC = /home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang

DLINK_FLAGS = /Machine:X64 /DLL /ENTRY:main /DEBUG:GHASH /lldmap

DLINK = /home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/lld-link

SLINK = /home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-lib

build:

        "$(CC)" $(CC_FLAGS) -c -o main.obj  main.c

        "nasm" -f win64 -o assembly.obj assembly.nasm

        "$(SLINK)" /OUT:main.lib main.obj

        "$(SLINK)" /OUT:assembly.lib assembly.obj

        "$(DLINK)" /OUT:main.dll $(DLINK_FLAGS) main.lib assembly.lib

clean:

        rm -f *.obj *.lib *.pdb *.dll *.map

 

$ make -f makefile_clanglto_Oz

$ llvm-pdbutil dump -l main.pdb

 

                           Lines

============================================================

Mod 0000 | `assembly.obj`:

Mod 0001 | `/home/jshi19/llvm/wrongcode/lld-link5/lto.tmp`:

/home/jshi19/llvm/wrongcode/lld-link5/main.c (MD5: 5F82BB79FE2DA0B0549B784CFDC37D05)

  0001:00000004-0000001E, line/addr entries = 5

     3 00000004 !    0 00000008 !    5 0000000D !    0 00000012 !    9 00000017 !

 

If we disable the optimization in the CC_FLAGS with -O0 as below, the PDB Lines will become correct non-zero numbers.

 

CC_FLAGS= -g  -m64 -mcmodel=small -target x86_64-unknown-windows -gcodeview -flto -O0

$ llvm-pdbutil dump -l main.pdb

 

                           Lines

============================================================

Mod 0000 | `assembly.obj`:

Mod 0001 | `/home/jshi19/llvm/wrongcode/lld_PDB_issue/lto.tmp`:

/home/jshi19/llvm/wrongcode/lld_PDB_issue/main.c (MD5: 5F82BB79FE2DA0B0549B784CFDC37D05)

  0001:00000010-00000050, line/addr entries = 6

     3 00000010 !    5 0000001C !    6 0000002B !    5 00000030 !    8 00000042 !    9 00000047 !

 

 

Thanks

Steven Shi

 

 

_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] LLD PDB Lines zero number issue

Jeremy Morse via llvm-dev
On Thu, 9 Jan 2020, David Blaikie via llvm-dev wrote:

> +rnk who works on COFF debugging things.
>
>  My understanding is that this has nothing to do with the linker - but is a
> function of LLVM optimizations creating line zero debug locations. I believe
> rnk & folks have disabled line zero emission for CodeView debug info in some
> manner - perhaps that needs a flag? or Steven hasn't got a release with that
> change in it?

I think I've run into that with dwarf as well, and there AFAIK it can be
gotten rid of by adding "-mllvm -use-unknown-locations=Disable".

// Martin

_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] LLD PDB Lines zero number issue

Jeremy Morse via llvm-dev

Hi Martin,

I tried your suggestion of adding "-mllvm -use-unknown-locations=Disable" in the clang CC flag to build test case in my previous email, but it looks still not work in my side with llvm 9.0.0.  Could you give me some more advices? Do I need to use the master LLVM instead of the 9.0.0?

 

$ make -f makefile_clanglto_Oz                                          

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang" -g  -m64 -mcmodel=small -target x86_64-unknown-windows -gcodeview -mllvm -use-unknown-locations=Disable -flto -Oz -c -o main.obj  main.c

"nasm" -f win64 -o assembly.obj assembly.nasm

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-lib" /OUT:main.lib main.obj

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-lib" /OUT:assembly.lib assembly.obj

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/lld-link" /OUT:main.dll /Machine:X64 /DLL /ENTRY:main /DEBUG:GHASH /lldmap main.lib assembly.lib

 

$ /home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-pdbutil dump -l main.pdb

                           Lines

============================================================

Mod 0000 | `assembly.obj`:

Mod 0001 | `/home/jshi19/llvm/wrongcode/lld-link5/lto.tmp`:

/home/jshi19/llvm/wrongcode/lld-link5/main.c (MD5: 5F82BB79FE2DA0B0549B784CFDC37D05)

  0001:00000004-0000001E, line/addr entries = 5

     3 00000004 !    0 00000008 !    5 0000000D !    0 00000012 !    9 00000017 !

 

 

Thanks

Steven Shi

 

 

> -----Original Message-----

> From: Martin Storsjö <[hidden email]>

> Sent: Friday, January 10, 2020 5:00 AM

> To: David Blaikie <[hidden email]>

> Cc: Shi, Steven <[hidden email]>; Reid Kleckner <[hidden email]>;

> llvm-dev <[hidden email]>

> Subject: Re: [llvm-dev] LLD PDB Lines zero number issue

>

> On Thu, 9 Jan 2020, David Blaikie via llvm-dev wrote:

>

> > +rnk who works on COFF debugging things.

> >

> >  My understanding is that this has nothing to do with the linker - but is a

> > function of LLVM optimizations creating line zero debug locations. I believe

> > rnk & folks have disabled line zero emission for CodeView debug info in

> some

> > manner - perhaps that needs a flag? or Steven hasn't got a release with

> that

> > change in it?

>

> I think I've run into that with dwarf as well, and there AFAIK it can be

> gotten rid of by adding "-mllvm -use-unknown-locations=Disable".

>

> // Martin


_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] LLD PDB Lines zero number issue

Jeremy Morse via llvm-dev

I checked the LLVM master code and find that the “-use-unknown-locations” option and its related logic is only supported for Dwarf debug info as below. These codes are missing in the Codeview side. It looks the “-use-unknown-locations” option logic is not complex, could we port the code logic into llvm\lib\CodeGen\AsmPrinter\CodeViewDebug.cpp as well? I’ve submitted a BZ for this requirment: https://bugs.llvm.org/show_bug.cgi?id=44522

 

llvm-project\llvm\lib\CodeGen\AsmPrinter\DwarfDebug.cpp :

static cl::opt<DefaultOnOff> UnknownLocations(

    "use-unknown-locations", cl::Hidden,

    cl::desc("Make an absence of debug location information explicit."),

    cl::values(clEnumVal(Default, "At top of block or after label"),

               clEnumVal(Enable, "In all cases"), clEnumVal(Disable, "Never")),

    cl::init(Default));

... ...

    // If user said Don't Do That, don't do that.

    if (UnknownLocations == Disable)

      return;

 

 

This issue blocks the LLVM toolchain debugging capability for UEFI firmware. Please help to add the support. Thank you in advance!

 

 

Thanks

Steven Shi

 

From: Shi, Steven
Sent: Friday, January 10, 2020 9:43 AM
To: Martin Storsjö <[hidden email]>; David Blaikie <[hidden email]>
Cc: Reid Kleckner <[hidden email]>; llvm-dev <[hidden email]>; Rui Ueyama <[hidden email]>
Subject: RE: [llvm-dev] LLD PDB Lines zero number issue

 

Hi Martin,

I tried your suggestion of adding "-mllvm -use-unknown-locations=Disable" in the clang CC flag to build test case in my previous email, but it looks still not work in my side with llvm 9.0.0.  Could you give me some more advices? Do I need to use the master LLVM instead of the 9.0.0?

 

$ make -f makefile_clanglto_Oz                                          

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang" -g  -m64 -mcmodel=small -target x86_64-unknown-windows -gcodeview -mllvm -use-unknown-locations=Disable -flto -Oz -c -o main.obj  main.c

"nasm" -f win64 -o assembly.obj assembly.nasm

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-lib" /OUT:main.lib main.obj

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-lib" /OUT:assembly.lib assembly.obj

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/lld-link" /OUT:main.dll /Machine:X64 /DLL /ENTRY:main /DEBUG:GHASH /lldmap main.lib assembly.lib

 

$ /home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-pdbutil dump -l main.pdb

                           Lines

============================================================

Mod 0000 | `assembly.obj`:

Mod 0001 | `/home/jshi19/llvm/wrongcode/lld-link5/lto.tmp`:

/home/jshi19/llvm/wrongcode/lld-link5/main.c (MD5: 5F82BB79FE2DA0B0549B784CFDC37D05)

  0001:00000004-0000001E, line/addr entries = 5

     3 00000004 !    0 00000008 !    5 0000000D !    0 00000012 !    9 00000017 !

 

 

Thanks

Steven Shi

 

 

> -----Original Message-----

> From: Martin Storsjö <[hidden email]>

> Sent: Friday, January 10, 2020 5:00 AM

> To: David Blaikie <[hidden email]>

> Cc: Shi, Steven <[hidden email]>; Reid Kleckner <[hidden email]>;

> llvm-dev <[hidden email]>

> Subject: Re: [llvm-dev] LLD PDB Lines zero number issue

>

> On Thu, 9 Jan 2020, David Blaikie via llvm-dev wrote:

>

> > +rnk who works on COFF debugging things.

> >

> >  My understanding is that this has nothing to do with the linker - but is a

> > function of LLVM optimizations creating line zero debug locations. I believe

> > rnk & folks have disabled line zero emission for CodeView debug info in

> some

> > manner - perhaps that needs a flag? or Steven hasn't got a release with

> that

> > change in it?

>

> I think I've run into that with dwarf as well, and there AFAIK it can be

> gotten rid of by adding "-mllvm -use-unknown-locations=Disable".

>

> // Martin


_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] LLD PDB Lines zero number issue

Jeremy Morse via llvm-dev
Could you try putting together a prototype patch and testing it locally to see if it solves your problem?

On Sat, Jan 11, 2020 at 7:11 PM Shi, Steven via llvm-dev <[hidden email]> wrote:

I checked the LLVM master code and find that the “-use-unknown-locations” option and its related logic is only supported for Dwarf debug info as below. These codes are missing in the Codeview side. It looks the “-use-unknown-locations” option logic is not complex, could we port the code logic into llvm\lib\CodeGen\AsmPrinter\CodeViewDebug.cpp as well? I’ve submitted a BZ for this requirment: https://bugs.llvm.org/show_bug.cgi?id=44522

 

llvm-project\llvm\lib\CodeGen\AsmPrinter\DwarfDebug.cpp :

static cl::opt<DefaultOnOff> UnknownLocations(

    "use-unknown-locations", cl::Hidden,

    cl::desc("Make an absence of debug location information explicit."),

    cl::values(clEnumVal(Default, "At top of block or after label"),

               clEnumVal(Enable, "In all cases"), clEnumVal(Disable, "Never")),

    cl::init(Default));

... ...

    // If user said Don't Do That, don't do that.

    if (UnknownLocations == Disable)

      return;

 

 

This issue blocks the LLVM toolchain debugging capability for UEFI firmware. Please help to add the support. Thank you in advance!

 

 

Thanks

Steven Shi

 

From: Shi, Steven
Sent: Friday, January 10, 2020 9:43 AM
To: Martin Storsjö <[hidden email]>; David Blaikie <[hidden email]>
Cc: Reid Kleckner <[hidden email]>; llvm-dev <[hidden email]>; Rui Ueyama <[hidden email]>
Subject: RE: [llvm-dev] LLD PDB Lines zero number issue

 

Hi Martin,

I tried your suggestion of adding "-mllvm -use-unknown-locations=Disable" in the clang CC flag to build test case in my previous email, but it looks still not work in my side with llvm 9.0.0.  Could you give me some more advices? Do I need to use the master LLVM instead of the 9.0.0?

 

$ make -f makefile_clanglto_Oz                                          

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang" -g  -m64 -mcmodel=small -target x86_64-unknown-windows -gcodeview -mllvm -use-unknown-locations=Disable -flto -Oz -c -o main.obj  main.c

"nasm" -f win64 -o assembly.obj assembly.nasm

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-lib" /OUT:main.lib main.obj

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-lib" /OUT:assembly.lib assembly.obj

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/lld-link" /OUT:main.dll /Machine:X64 /DLL /ENTRY:main /DEBUG:GHASH /lldmap main.lib assembly.lib

 

$ /home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-pdbutil dump -l main.pdb

                           Lines

============================================================

Mod 0000 | `assembly.obj`:

Mod 0001 | `/home/jshi19/llvm/wrongcode/lld-link5/lto.tmp`:

/home/jshi19/llvm/wrongcode/lld-link5/main.c (MD5: 5F82BB79FE2DA0B0549B784CFDC37D05)

  0001:00000004-0000001E, line/addr entries = 5

     3 00000004 !    0 00000008 !    5 0000000D !    0 00000012 !    9 00000017 !

 

 

Thanks

Steven Shi

 

 

> -----Original Message-----

> From: Martin Storsjö <[hidden email]>

> Sent: Friday, January 10, 2020 5:00 AM

> To: David Blaikie <[hidden email]>

> Cc: Shi, Steven <[hidden email]>; Reid Kleckner <[hidden email]>;

> llvm-dev <[hidden email]>

> Subject: Re: [llvm-dev] LLD PDB Lines zero number issue

>

> On Thu, 9 Jan 2020, David Blaikie via llvm-dev wrote:

>

> > +rnk who works on COFF debugging things.

> >

> >  My understanding is that this has nothing to do with the linker - but is a

> > function of LLVM optimizations creating line zero debug locations. I believe

> > rnk & folks have disabled line zero emission for CodeView debug info in

> some

> > manner - perhaps that needs a flag? or Steven hasn't got a release with

> that

> > change in it?

>

> I think I've run into that with dwarf as well, and there AFAIK it can be

> gotten rid of by adding "-mllvm -use-unknown-locations=Disable".

>

> // Martin

_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] LLD PDB Lines zero number issue

Jeremy Morse via llvm-dev
In reply to this post by Jeremy Morse via llvm-dev

On Thu, Jan 9, 2020 at 10:01 AM David Blaikie <[hidden email]> wrote:
+rnk who works on COFF debugging things.

 My understanding is that this has nothing to do with the linker - but is a function of LLVM optimizations creating line zero debug locations. I believe rnk & folks have disabled line zero emission for CodeView debug info in some manner - perhaps that needs a flag? or Steven hasn't got a release with that change in it?

On Thu, Jan 9, 2020 at 4:47 AM Shi, Steven via llvm-dev <[hidden email]> wrote:

Hello Rui,

We meet an LLD PDB issue that if we link assembly code with C code and set >= -O1 level optimization in LTO, the executable’s PDB will contain wrong zero Lines for the assembly code in DEBUG_S_LINES subsection, and then our COFF source debuggers will fail to do the source-level debug on the executable.  This issue is same in both Linux and Windows, and I figure out a simple case in Linux to reproduce this issue as below. Please help to give us some advices on how to solve the zero Lines issue.

 

$ cat main.c

void assembly_fun();

int main()

{

  int Index1;

  for (Index1 = 0; Index1 == 0; assembly_fun(), Index1++){

    assembly_fun();

  }

  assembly_fun();

}

 

$ cat assembly.nasm

    DEFAULT REL

    SECTION .text

global assembly_fun

assembly_fun:

  ret

 

$ cat makefile_clanglto_Oz

CC_FLAGS= -g  -m64 -mcmodel=small -target x86_64-unknown-windows -gcodeview -flto -Oz

CC = /home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang

DLINK_FLAGS = /Machine:X64 /DLL /ENTRY:main /DEBUG:GHASH /lldmap

DLINK = /home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/lld-link

SLINK = /home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-lib

build:

        "$(CC)" $(CC_FLAGS) -c -o main.obj  main.c

        "nasm" -f win64 -o assembly.obj assembly.nasm

        "$(SLINK)" /OUT:main.lib main.obj

        "$(SLINK)" /OUT:assembly.lib assembly.obj

        "$(DLINK)" /OUT:main.dll $(DLINK_FLAGS) main.lib assembly.lib

clean:

        rm -f *.obj *.lib *.pdb *.dll *.map

 

$ make -f makefile_clanglto_Oz

$ llvm-pdbutil dump -l main.pdb

 

                           Lines

============================================================

Mod 0000 | `assembly.obj`:

Mod 0001 | `/home/jshi19/llvm/wrongcode/lld-link5/lto.tmp`:

/home/jshi19/llvm/wrongcode/lld-link5/main.c (MD5: 5F82BB79FE2DA0B0549B784CFDC37D05)

  0001:00000004-0000001E, line/addr entries = 5

     3 00000004 !    0 00000008 !    5 0000000D !    0 00000012 !    9 00000017 !

 

If we disable the optimization in the CC_FLAGS with -O0 as below, the PDB Lines will become correct non-zero numbers.

 

CC_FLAGS= -g  -m64 -mcmodel=small -target x86_64-unknown-windows -gcodeview -flto -O0

$ llvm-pdbutil dump -l main.pdb

 

                           Lines

============================================================

Mod 0000 | `assembly.obj`:

Mod 0001 | `/home/jshi19/llvm/wrongcode/lld_PDB_issue/lto.tmp`:

/home/jshi19/llvm/wrongcode/lld_PDB_issue/main.c (MD5: 5F82BB79FE2DA0B0549B784CFDC37D05)

  0001:00000010-00000050, line/addr entries = 6

     3 00000010 !    5 0000001C !    6 0000002B !    5 00000030 !    8 00000042 !    9 00000047 !

 

 

Thanks

Steven Shi

 

 

_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] LLD PDB Lines zero number issue

Jeremy Morse via llvm-dev
In reply to this post by Jeremy Morse via llvm-dev

OK, maybe I was wrong and the “-use-unknown-locations” option is not the issue root cause.

I'm not familiar with the LLVM codebase and I appreciate any suggestion on how to debug this issue. I'd like to know is it a clang issue or a lld issue? Is there a tool which can dump the obj file debug location info?

 

 

Let me simplify the previous test case to reproduce this issue. All what you need is just a C function to invoke an empty assembly function as below.

 

  1. An empty assembly function file:

$ cat assembly.nasm

    DEFAULT REL

    SECTION .text

global assembly_fun

assembly_fun:

  ret

 

  1. A file of a C function to invoke the empty assembly function but not inline the assembly function:

$ cat main.c

void assembly_fun();

int main()

{

  int Index1;

  for (Index1 = 0; Index1 == 0; assembly_fun(), Index1++){

    assembly_fun();

  }

  assembly_fun();

}

 

Then link the assembly and c functions together as below:

$ clang -g -m64 -target x86_64-unknown-windows -gcodeview -O1 -c -o main.obj  main.c

$ nasm -f win64 -o assembly.obj assembly.nasm

$ lld-link /OUT:main.dll /Machine:X64 /DLL /ENTRY:main /DEBUG:GHASH /lldmap main.obj assembly.obj

 

Check to see that there are line zeros in the pdb file:

$ llvm-pdbutil" dump -l main.pdb

                           Lines

============================================================

Mod 0000 | `/home/jshi19/llvm/wrongcode/lld_PDB_issue/main.obj`:

/home/jshi19/llvm/wrongcode/lld_PDB_issue/main.c (MD5: 5F82BB79FE2DA0B0549B784CFDC37D05)

  0001:00000000-0000001A, line/addr entries = 5

     3 00000000 !    0 00000004 !    5 00000009 !    0 0000000E !    9 00000013 !

 

 

Thanks

Shi, Steven

 

From: Zachary Turner <[hidden email]>
Sent: Tuesday, January 14, 2020 2:56 AM
To: Shi, Steven <[hidden email]>
Cc: Martin Storsjö <[hidden email]>; David Blaikie <[hidden email]>; Rui Ueyama <[hidden email]>; llvm-dev <[hidden email]>
Subject: Re: [llvm-dev] LLD PDB Lines zero number issue

 

Could you try putting together a prototype patch and testing it locally to see if it solves your problem?

 

On Sat, Jan 11, 2020 at 7:11 PM Shi, Steven via llvm-dev <[hidden email]> wrote:

I checked the LLVM master code and find that the “-use-unknown-locations” option and its related logic is only supported for Dwarf debug info as below. These codes are missing in the Codeview side. It looks the “-use-unknown-locations” option logic is not complex, could we port the code logic into llvm\lib\CodeGen\AsmPrinter\CodeViewDebug.cpp as well? I’ve submitted a BZ for this requirment: https://bugs.llvm.org/show_bug.cgi?id=44522

 

llvm-project\llvm\lib\CodeGen\AsmPrinter\DwarfDebug.cpp :

static cl::opt<DefaultOnOff> UnknownLocations(

    "use-unknown-locations", cl::Hidden,

    cl::desc("Make an absence of debug location information explicit."),

    cl::values(clEnumVal(Default, "At top of block or after label"),

               clEnumVal(Enable, "In all cases"), clEnumVal(Disable, "Never")),

    cl::init(Default));

... ...

    // If user said Don't Do That, don't do that.

    if (UnknownLocations == Disable)

      return;

 

 

This issue blocks the LLVM toolchain debugging capability for UEFI firmware. Please help to add the support. Thank you in advance!

 

 

Thanks

Steven Shi

 

From: Shi, Steven
Sent: Friday, January 10, 2020 9:43 AM
To: Martin Storsjö <[hidden email]>; David Blaikie <[hidden email]>
Cc: Reid Kleckner <[hidden email]>; llvm-dev <[hidden email]>; Rui Ueyama <[hidden email]>
Subject: RE: [llvm-dev] LLD PDB Lines zero number issue

 

Hi Martin,

I tried your suggestion of adding "-mllvm -use-unknown-locations=Disable" in the clang CC flag to build test case in my previous email, but it looks still not work in my side with llvm 9.0.0.  Could you give me some more advices? Do I need to use the master LLVM instead of the 9.0.0?

 

$ make -f makefile_clanglto_Oz                                          

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang" -g  -m64 -mcmodel=small -target x86_64-unknown-windows -gcodeview -mllvm -use-unknown-locations=Disable -flto -Oz -c -o main.obj  main.c

"nasm" -f win64 -o assembly.obj assembly.nasm

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-lib" /OUT:main.lib main.obj

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-lib" /OUT:assembly.lib assembly.obj

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/lld-link" /OUT:main.dll /Machine:X64 /DLL /ENTRY:main /DEBUG:GHASH /lldmap main.lib assembly.lib

 

$ /home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-pdbutil dump -l main.pdb

                           Lines

============================================================

Mod 0000 | `assembly.obj`:

Mod 0001 | `/home/jshi19/llvm/wrongcode/lld-link5/lto.tmp`:

/home/jshi19/llvm/wrongcode/lld-link5/main.c (MD5: 5F82BB79FE2DA0B0549B784CFDC37D05)

  0001:00000004-0000001E, line/addr entries = 5

     3 00000004 !    0 00000008 !    5 0000000D !    0 00000012 !    9 00000017 !

 

 

Thanks

Steven Shi

 

 

> -----Original Message-----

> From: Martin Storsjö <[hidden email]>

> Sent: Friday, January 10, 2020 5:00 AM

> To: David Blaikie <[hidden email]>

> Cc: Shi, Steven <[hidden email]>; Reid Kleckner <[hidden email]>;

> llvm-dev <[hidden email]>

> Subject: Re: [llvm-dev] LLD PDB Lines zero number issue

>

> On Thu, 9 Jan 2020, David Blaikie via llvm-dev wrote:

>

> > +rnk who works on COFF debugging things.

> >

> >  My understanding is that this has nothing to do with the linker - but is a

> > function of LLVM optimizations creating line zero debug locations. I believe

> > rnk & folks have disabled line zero emission for CodeView debug info in

> some

> > manner - perhaps that needs a flag? or Steven hasn't got a release with

> that

> > change in it?

>

> I think I've run into that with dwarf as well, and there AFAIK it can be

> gotten rid of by adding "-mllvm -use-unknown-locations=Disable".

>

> // Martin

_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] LLD PDB Lines zero number issue

Jeremy Morse via llvm-dev
Are you using clang 9? If so, it doesn't have the fix. When I do what you are doing locally, I see this line table in the object file:
$ llvm-pdbutil dump -l main.obj
                           Lines                            
============================================================
Mod 0000 | `.debug$S`:
/usr/local/google/home/rnk/llvm-project/build/t.cpp (MD5: 87CCDBA652A1F79A159CCE31252B66B1)
  0000:00000000-0000001A, line/addr entries = 3
     3 00000000 !    5 00000009 !    9 00000013 ! 

The zero entries are missing. This will be fixed in the next release.

On Tue, Jan 14, 2020, 4:53 AM Shi, Steven <[hidden email]> wrote:

OK, maybe I was wrong and the “-use-unknown-locations” option is not the issue root cause.

I'm not familiar with the LLVM codebase and I appreciate any suggestion on how to debug this issue. I'd like to know is it a clang issue or a lld issue? Is there a tool which can dump the obj file debug location info?

 

 

Let me simplify the previous test case to reproduce this issue. All what you need is just a C function to invoke an empty assembly function as below.

 

  1. An empty assembly function file:

$ cat assembly.nasm

    DEFAULT REL

    SECTION .text

global assembly_fun

assembly_fun:

  ret

 

  1. A file of a C function to invoke the empty assembly function but not inline the assembly function:

$ cat main.c

void assembly_fun();

int main()

{

  int Index1;

  for (Index1 = 0; Index1 == 0; assembly_fun(), Index1++){

    assembly_fun();

  }

  assembly_fun();

}

 

Then link the assembly and c functions together as below:

$ clang -g -m64 -target x86_64-unknown-windows -gcodeview -O1 -c -o main.obj  main.c

$ nasm -f win64 -o assembly.obj assembly.nasm

$ lld-link /OUT:main.dll /Machine:X64 /DLL /ENTRY:main /DEBUG:GHASH /lldmap main.obj assembly.obj

 

Check to see that there are line zeros in the pdb file:

$ llvm-pdbutil" dump -l main.pdb

                           Lines

============================================================

Mod 0000 | `/home/jshi19/llvm/wrongcode/lld_PDB_issue/main.obj`:

/home/jshi19/llvm/wrongcode/lld_PDB_issue/main.c (MD5: 5F82BB79FE2DA0B0549B784CFDC37D05)

  0001:00000000-0000001A, line/addr entries = 5

     3 00000000 !    0 00000004 !    5 00000009 !    0 0000000E !    9 00000013 !

 

 

Thanks

Shi, Steven

 

From: Zachary Turner <[hidden email]>
Sent: Tuesday, January 14, 2020 2:56 AM
To: Shi, Steven <[hidden email]>
Cc: Martin Storsjö <[hidden email]>; David Blaikie <[hidden email]>; Rui Ueyama <[hidden email]>; llvm-dev <[hidden email]>
Subject: Re: [llvm-dev] LLD PDB Lines zero number issue

 

Could you try putting together a prototype patch and testing it locally to see if it solves your problem?

 

On Sat, Jan 11, 2020 at 7:11 PM Shi, Steven via llvm-dev <[hidden email]> wrote:

I checked the LLVM master code and find that the “-use-unknown-locations” option and its related logic is only supported for Dwarf debug info as below. These codes are missing in the Codeview side. It looks the “-use-unknown-locations” option logic is not complex, could we port the code logic into llvm\lib\CodeGen\AsmPrinter\CodeViewDebug.cpp as well? I’ve submitted a BZ for this requirment: https://bugs.llvm.org/show_bug.cgi?id=44522

 

llvm-project\llvm\lib\CodeGen\AsmPrinter\DwarfDebug.cpp :

static cl::opt<DefaultOnOff> UnknownLocations(

    "use-unknown-locations", cl::Hidden,

    cl::desc("Make an absence of debug location information explicit."),

    cl::values(clEnumVal(Default, "At top of block or after label"),

               clEnumVal(Enable, "In all cases"), clEnumVal(Disable, "Never")),

    cl::init(Default));

... ...

    // If user said Don't Do That, don't do that.

    if (UnknownLocations == Disable)

      return;

 

 

This issue blocks the LLVM toolchain debugging capability for UEFI firmware. Please help to add the support. Thank you in advance!

 

 

Thanks

Steven Shi

 

From: Shi, Steven
Sent: Friday, January 10, 2020 9:43 AM
To: Martin Storsjö <[hidden email]>; David Blaikie <[hidden email]>
Cc: Reid Kleckner <[hidden email]>; llvm-dev <[hidden email]>; Rui Ueyama <[hidden email]>
Subject: RE: [llvm-dev] LLD PDB Lines zero number issue

 

Hi Martin,

I tried your suggestion of adding "-mllvm -use-unknown-locations=Disable" in the clang CC flag to build test case in my previous email, but it looks still not work in my side with llvm 9.0.0.  Could you give me some more advices? Do I need to use the master LLVM instead of the 9.0.0?

 

$ make -f makefile_clanglto_Oz                                          

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang" -g  -m64 -mcmodel=small -target x86_64-unknown-windows -gcodeview -mllvm -use-unknown-locations=Disable -flto -Oz -c -o main.obj  main.c

"nasm" -f win64 -o assembly.obj assembly.nasm

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-lib" /OUT:main.lib main.obj

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-lib" /OUT:assembly.lib assembly.obj

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/lld-link" /OUT:main.dll /Machine:X64 /DLL /ENTRY:main /DEBUG:GHASH /lldmap main.lib assembly.lib

 

$ /home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-pdbutil dump -l main.pdb

                           Lines

============================================================

Mod 0000 | `assembly.obj`:

Mod 0001 | `/home/jshi19/llvm/wrongcode/lld-link5/lto.tmp`:

/home/jshi19/llvm/wrongcode/lld-link5/main.c (MD5: 5F82BB79FE2DA0B0549B784CFDC37D05)

  0001:00000004-0000001E, line/addr entries = 5

     3 00000004 !    0 00000008 !    5 0000000D !    0 00000012 !    9 00000017 !

 

 

Thanks

Steven Shi

 

 

> -----Original Message-----

> From: Martin Storsjö <[hidden email]>

> Sent: Friday, January 10, 2020 5:00 AM

> To: David Blaikie <[hidden email]>

> Cc: Shi, Steven <[hidden email]>; Reid Kleckner <[hidden email]>;

> llvm-dev <[hidden email]>

> Subject: Re: [llvm-dev] LLD PDB Lines zero number issue

>

> On Thu, 9 Jan 2020, David Blaikie via llvm-dev wrote:

>

> > +rnk who works on COFF debugging things.

> >

> >  My understanding is that this has nothing to do with the linker - but is a

> > function of LLVM optimizations creating line zero debug locations. I believe

> > rnk & folks have disabled line zero emission for CodeView debug info in

> some

> > manner - perhaps that needs a flag? or Steven hasn't got a release with

> that

> > change in it?

>

> I think I've run into that with dwarf as well, and there AFAIK it can be

> gotten rid of by adding "-mllvm -use-unknown-locations=Disable".

>

> // Martin

_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] LLD PDB Lines zero number issue

Jeremy Morse via llvm-dev

> Are you using clang 9? If so, it doesn't have the fix.

> This will be fixed in the next release.

 

OK, got it. Thank you!

 

 

Thanks

Steven

 

 

From: Reid Kleckner <[hidden email]>
Sent: Wednesday, January 15, 2020 4:31 AM
To: Shi, Steven <[hidden email]>
Cc: Zachary Turner <[hidden email]>; Rui Ueyama <[hidden email]>; Martin Storsjö <[hidden email]>; David Blaikie <[hidden email]>; llvm-dev <[hidden email]>
Subject: Re: [llvm-dev] LLD PDB Lines zero number issue

 

Are you using clang 9? If so, it doesn't have the fix. When I do what you are doing locally, I see this line table in the object file:

$ llvm-pdbutil dump -l main.obj
                           Lines                            
============================================================
Mod 0000 | `.debug$S`:
/usr/local/google/home/rnk/llvm-project/build/t.cpp (MD5: 87CCDBA652A1F79A159CCE31252B66B1)
  0000:00000000-0000001A, line/addr entries = 3
     3 00000000 !    5 00000009 !    9 00000013 ! 

 

The zero entries are missing. This will be fixed in the next release.

 

On Tue, Jan 14, 2020, 4:53 AM Shi, Steven <[hidden email]> wrote:

OK, maybe I was wrong and the “-use-unknown-locations” option is not the issue root cause.

I'm not familiar with the LLVM codebase and I appreciate any suggestion on how to debug this issue. I'd like to know is it a clang issue or a lld issue? Is there a tool which can dump the obj file debug location info?

 

 

Let me simplify the previous test case to reproduce this issue. All what you need is just a C function to invoke an empty assembly function as below.

 

  1. An empty assembly function file:

$ cat assembly.nasm

    DEFAULT REL

    SECTION .text

global assembly_fun

assembly_fun:

  ret

 

  1. A file of a C function to invoke the empty assembly function but not inline the assembly function:

$ cat main.c

void assembly_fun();

int main()

{

  int Index1;

  for (Index1 = 0; Index1 == 0; assembly_fun(), Index1++){

    assembly_fun();

  }

  assembly_fun();

}

 

Then link the assembly and c functions together as below:

$ clang -g -m64 -target x86_64-unknown-windows -gcodeview -O1 -c -o main.obj  main.c

$ nasm -f win64 -o assembly.obj assembly.nasm

$ lld-link /OUT:main.dll /Machine:X64 /DLL /ENTRY:main /DEBUG:GHASH /lldmap main.obj assembly.obj

 

Check to see that there are line zeros in the pdb file:

$ llvm-pdbutil" dump -l main.pdb

                           Lines

============================================================

Mod 0000 | `/home/jshi19/llvm/wrongcode/lld_PDB_issue/main.obj`:

/home/jshi19/llvm/wrongcode/lld_PDB_issue/main.c (MD5: 5F82BB79FE2DA0B0549B784CFDC37D05)

  0001:00000000-0000001A, line/addr entries = 5

     3 00000000 !    0 00000004 !    5 00000009 !    0 0000000E !    9 00000013 !

 

 

Thanks

Shi, Steven

 

From: Zachary Turner <[hidden email]>
Sent: Tuesday, January 14, 2020 2:56 AM
To: Shi, Steven <
[hidden email]>
Cc: Martin Storsjö <
[hidden email]>; David Blaikie <[hidden email]>; Rui Ueyama <[hidden email]>; llvm-dev <[hidden email]>
Subject: Re: [llvm-dev] LLD PDB Lines zero number issue

 

Could you try putting together a prototype patch and testing it locally to see if it solves your problem?

 

On Sat, Jan 11, 2020 at 7:11 PM Shi, Steven via llvm-dev <[hidden email]> wrote:

I checked the LLVM master code and find that the “-use-unknown-locations” option and its related logic is only supported for Dwarf debug info as below. These codes are missing in the Codeview side. It looks the “-use-unknown-locations” option logic is not complex, could we port the code logic into llvm\lib\CodeGen\AsmPrinter\CodeViewDebug.cpp as well? I’ve submitted a BZ for this requirment: https://bugs.llvm.org/show_bug.cgi?id=44522

 

llvm-project\llvm\lib\CodeGen\AsmPrinter\DwarfDebug.cpp :

static cl::opt<DefaultOnOff> UnknownLocations(

    "use-unknown-locations", cl::Hidden,

    cl::desc("Make an absence of debug location information explicit."),

    cl::values(clEnumVal(Default, "At top of block or after label"),

               clEnumVal(Enable, "In all cases"), clEnumVal(Disable, "Never")),

    cl::init(Default));

... ...

    // If user said Don't Do That, don't do that.

    if (UnknownLocations == Disable)

      return;

 

 

This issue blocks the LLVM toolchain debugging capability for UEFI firmware. Please help to add the support. Thank you in advance!

 

 

Thanks

Steven Shi

 

From: Shi, Steven
Sent: Friday, January 10, 2020 9:43 AM
To: Martin Storsjö <[hidden email]>; David Blaikie <[hidden email]>
Cc: Reid Kleckner <[hidden email]>; llvm-dev <[hidden email]>; Rui Ueyama <[hidden email]>
Subject: RE: [llvm-dev] LLD PDB Lines zero number issue

 

Hi Martin,

I tried your suggestion of adding "-mllvm -use-unknown-locations=Disable" in the clang CC flag to build test case in my previous email, but it looks still not work in my side with llvm 9.0.0.  Could you give me some more advices? Do I need to use the master LLVM instead of the 9.0.0?

 

$ make -f makefile_clanglto_Oz                                          

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang" -g  -m64 -mcmodel=small -target x86_64-unknown-windows -gcodeview -mllvm -use-unknown-locations=Disable -flto -Oz -c -o main.obj  main.c

"nasm" -f win64 -o assembly.obj assembly.nasm

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-lib" /OUT:main.lib main.obj

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-lib" /OUT:assembly.lib assembly.obj

"/home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/lld-link" /OUT:main.dll /Machine:X64 /DLL /ENTRY:main /DEBUG:GHASH /lldmap main.lib assembly.lib

 

$ /home/jshi19/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/llvm-pdbutil dump -l main.pdb

                           Lines

============================================================

Mod 0000 | `assembly.obj`:

Mod 0001 | `/home/jshi19/llvm/wrongcode/lld-link5/lto.tmp`:

/home/jshi19/llvm/wrongcode/lld-link5/main.c (MD5: 5F82BB79FE2DA0B0549B784CFDC37D05)

  0001:00000004-0000001E, line/addr entries = 5

     3 00000004 !    0 00000008 !    5 0000000D !    0 00000012 !    9 00000017 !

 

 

Thanks

Steven Shi

 

 

> -----Original Message-----

> From: Martin Storsjö <[hidden email]>

> Sent: Friday, January 10, 2020 5:00 AM

> To: David Blaikie <[hidden email]>

> Cc: Shi, Steven <[hidden email]>; Reid Kleckner <[hidden email]>;

> llvm-dev <[hidden email]>

> Subject: Re: [llvm-dev] LLD PDB Lines zero number issue

>

> On Thu, 9 Jan 2020, David Blaikie via llvm-dev wrote:

>

> > +rnk who works on COFF debugging things.

> >

> >  My understanding is that this has nothing to do with the linker - but is a

> > function of LLVM optimizations creating line zero debug locations. I believe

> > rnk & folks have disabled line zero emission for CodeView debug info in

> some

> > manner - perhaps that needs a flag? or Steven hasn't got a release with

> that

> > change in it?

>

> I think I've run into that with dwarf as well, and there AFAIK it can be

> gotten rid of by adding "-mllvm -use-unknown-locations=Disable".

>

> // Martin

_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev