0
|
1 module dmd.backend.dt_t;
|
|
2
|
|
3 import dmd.backend.targ_types;
|
|
4 import dmd.backend.Symbol;
|
|
5
|
|
6 struct dt_t
|
|
7 {
|
|
8 dt_t* DTnext; // next in list
|
|
9 char dt; // type (DTxxxx)
|
|
10 ubyte Dty; // pointer type
|
|
11
|
|
12 union
|
|
13 {
|
|
14 struct // DTibytes
|
|
15 {
|
|
16 char DTn; // number of bytes
|
|
17 char DTdata[7]; // data
|
|
18 }
|
|
19
|
|
20 char DTonebyte; // DT1byte
|
|
21
|
|
22 targ_size_t DTazeros; // DTazeros,DTcommon,DTsymsize
|
|
23
|
|
24 struct // DTabytes
|
|
25 {
|
|
26 char* DTpbytes; // pointer to the bytes
|
|
27 uint DTnbytes; // # of bytes
|
|
28 version (TX86) {
|
|
29 int DTseg; // segment it went into
|
|
30 }
|
|
31 targ_size_t DTabytes; // offset of abytes for DTabytes
|
|
32 }
|
|
33
|
|
34 struct // DTxoff
|
|
35 {
|
|
36 Symbol* DTsym; // symbol pointer
|
|
37 targ_size_t DToffset; // offset from symbol
|
|
38 }
|
|
39 }
|
|
40 }
|
|
41
|
67
|
42 extern (C++) extern uint dt_size(dt_t* dtstart);
|
|
43
|
0
|
44 import std.stdio;
|
|
45
|
|
46 void dumpDt(dt_t* foo)
|
|
47 {
|
|
48 foreach (a, b; foo.tupleof)
|
|
49 {
|
|
50 std.stdio.writeln(foo.tupleof[a].stringof, " ", cast(char*)&foo.tupleof[a] - cast(char*)foo, " = ", foo.tupleof[a]);
|
|
51 //std.stdio.writeln("printf(\"", foo.tupleof[a].stringof, " %d = %d\\n\",(char*)(&", foo.tupleof[a].stringof, ")-(char*)foo, ", foo.tupleof[a].stringof, ");");
|
|
52 }
|
|
53 } |