1 /**
2  * Code to handle debugger expression evaluation
3  *
4  * Compiler implementation of the
5  * $(LINK2 https://www.dlang.org, D programming language).
6  *
7  * Copyright:   Copyright (C) 1995-1998 by Symantec
8  *              Copyright (C) 2000-2023 by The D Language Foundation, All Rights Reserved
9  * Authors:     $(LINK2 https://www.digitalmars.com, Walter Bright)
10  * License:     $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
11  * Source:      $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/backend/ee.d, backend/ee.d)
12  */
13 module dmd.backend.ee;
14 
15 import core.stdc.stdio;
16 import core.stdc.string;
17 import core.stdc.time;
18 import dmd.backend.cc;
19 import dmd.backend.cdef;
20 import dmd.backend.global;
21 import dmd.backend.symtab;
22 import dmd.backend.type;
23 import dmd.backend.oper;
24 import dmd.backend.el;
25 import dmd.backend.cgcv;
26 import dmd.backend.symtab;
27 
28 import dmd.backend.iasm;
29 
30 nothrow:
31 @safe:
32 
33 __gshared EEcontext eecontext;
34 
35 //////////////////////////////////////
36 // Convert any symbols generated for the debugger expression to SCstack
37 // storage class.
38 @trusted
39 void eecontext_convs(SYMIDX marksi)
40 {
41     symtab_t *ps;
42 
43     // Change all generated SC.auto's to SC.stack's
44     ps = cstate.CSpsymtab;
45     const top = ps.length;
46     //printf("eecontext_convs(%d,%d)\n",marksi,top);
47     foreach (u; marksi .. top)
48     {
49         auto s = (*ps)[u];
50         switch (s.Sclass)
51         {
52             case SC.auto_:
53             case SC.register:
54                 s.Sclass = SC.stack;
55                 s.Sfl = FLstack;
56                 break;
57             default:
58                 break;
59         }
60     }
61 }