[Issue 7634] New: optlink creates bad debug info for a large number of modules

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 3 04:04:59 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7634

           Summary: optlink creates bad debug info for a large number of
                    modules
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Optlink
        AssignedTo: nobody at puremagic.com
        ReportedBy: r.sagitario at gmx.de


--- Comment #0 from Rainer Schuetze <r.sagitario at gmx.de> 2012-03-03 04:03:43 PST ---
Here's some code to generate 4000 functions:

import std.stdio;
import std.typetuple;

template countTuple(int n)
{
    static if (n > 0)
        alias TypeTuple!(countTuple!(n - 1), n - 1) countTuple;
    else
        alias TypeTuple!() countTuple;
}

void func(int i, int j)()
{
     writeln(i, j);
}

void fun()
{
    foreach(i; countTuple!(40))
        foreach(j; countTuple!(100))
            func!(i, j)();
}

When compiling it to a library with debug information:
>dmd -g -lib test.d

And linking it with a simple main.d:

import test;

void main()
{
    fun();
}

>dmd -g main.d test.lib

the linker generates bad sstModule information for modules #2730, #4095,
#6826,..., e.g.

Module #2730 (0074CB64)
  SubSection:            0000 (<undefined>)
  iMod:                  0
  lfo:                   76412
  cb:                    25
unsupported type 0

Module #2731 (0074CB70)
  SubSection:            0120 (sstModule)
  iMod:                  2731
  lfo:                   76440

The module numbers seem fixed, they also appear in completely different code.

BTW: if you increase the numbers of functions to 10000, optlink crashes. Maybe
some of the other reported crashes are related.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list