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