1 | /* $Id: kHll.cpp,v 1.2 2000-03-25 23:50:11 bird Exp $
|
---|
2 | *
|
---|
3 | * kHll - Implementation of the class kHll.
|
---|
4 | * That class is used to create HLL debuginfo.
|
---|
5 | *
|
---|
6 | * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
|
---|
7 | *
|
---|
8 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
9 | *
|
---|
10 | */
|
---|
11 |
|
---|
12 |
|
---|
13 | /*******************************************************************************
|
---|
14 | * Defined Constants And Macros *
|
---|
15 | *******************************************************************************/
|
---|
16 | #define INCL_TYPES
|
---|
17 | #define INCL_DOSERRORS
|
---|
18 | #define FOR_EXEHDR 1 /* exe386.h flag */
|
---|
19 | #define DWORD ULONG /* Used by exe386.h / newexe.h */
|
---|
20 | #define WORD USHORT /* Used by exe386.h / newexe.h */
|
---|
21 |
|
---|
22 |
|
---|
23 | /*******************************************************************************
|
---|
24 | * Internal Functions *
|
---|
25 | *******************************************************************************/
|
---|
26 | #include <os2.h>
|
---|
27 | #include <newexe.h>
|
---|
28 | #include <exe386.h>
|
---|
29 |
|
---|
30 | #include <malloc.h>
|
---|
31 | #include <stdio.h>
|
---|
32 | #include <string.h>
|
---|
33 | #include <stddef.h>
|
---|
34 | #include <assert.h>
|
---|
35 |
|
---|
36 | #include "hll.h"
|
---|
37 | #include "kList.h"
|
---|
38 | #include "kHll.h"
|
---|
39 |
|
---|
40 |
|
---|
41 |
|
---|
42 | kHLLPubSym::kHLLPubSym(
|
---|
43 | const char * pszName,
|
---|
44 | unsigned long off,
|
---|
45 | unsigned short iObj,
|
---|
46 | unsigned short iType
|
---|
47 | );
|
---|
48 |
|
---|
49 |
|
---|
50 | kHLLPubSym::~kHLLPubSym();
|
---|
51 |
|
---|
52 |
|
---|
53 | int kHLLPubSym::write(FILE *phFile)
|
---|
54 | {
|
---|
55 |
|
---|
56 | }
|
---|
57 |
|
---|
58 |
|
---|
59 |
|
---|
60 |
|
---|
61 |
|
---|
62 |
|
---|
63 |
|
---|
64 |
|
---|
65 |
|
---|
66 |
|
---|
67 |
|
---|
68 |
|
---|
69 | /**
|
---|
70 | * Constructor - Creates an empty HLL object.
|
---|
71 | */
|
---|
72 | kHll::kHll()
|
---|
73 | {
|
---|
74 | }
|
---|
75 |
|
---|
76 |
|
---|
77 | /**
|
---|
78 | * Destructor.
|
---|
79 | */
|
---|
80 | kHll::~kHll()
|
---|
81 | {
|
---|
82 | }
|
---|
83 |
|
---|
84 |
|
---|
85 | /**
|
---|
86 | * Adds an LX object to the HLL info.
|
---|
87 | * @returns Object handle. NULL on error.
|
---|
88 | * @param pszName Object name.
|
---|
89 | * @param cb Size of object.
|
---|
90 | */
|
---|
91 | const void * kHll::addObject(
|
---|
92 | const char * pszName,
|
---|
93 | unsigned long int cb
|
---|
94 | )
|
---|
95 | {
|
---|
96 | pszName = pszName;
|
---|
97 | cb = cb;
|
---|
98 | return NULL;
|
---|
99 | }
|
---|
100 |
|
---|
101 |
|
---|
102 | /**
|
---|
103 | * Adds a module.
|
---|
104 | * @returns Object handle. NULL on error.
|
---|
105 | * @param pszName Module name
|
---|
106 | * @param pvLib Library module handle.
|
---|
107 | * @param cObjects Number of objects in the array.
|
---|
108 | * @param paObjects Pointer to an array of objects.
|
---|
109 | */
|
---|
110 | const void * kHll::addModule(
|
---|
111 | const char * pszName,
|
---|
112 | const void * pvLib,
|
---|
113 | unsigned cObject,
|
---|
114 | PMODOBJECT paObjects)
|
---|
115 | {
|
---|
116 | return NULL;
|
---|
117 | }
|
---|
118 |
|
---|
119 |
|
---|
120 |
|
---|
121 | /**
|
---|
122 | * Adds a public symbol.
|
---|
123 | * @returns Handle to the symbol. NULL on error.
|
---|
124 | * @param pszName Symbol name.
|
---|
125 | * @param off Offset into the LX Object of the symbol.
|
---|
126 | * @param iObject LX Object index.
|
---|
127 | * @param pvType Type handle. NULL if not type.
|
---|
128 | */
|
---|
129 | const void * kHll::addPublicSymbol(
|
---|
130 | const char * pszName,
|
---|
131 | unsigned long int off,
|
---|
132 | unsigned short int iObject,
|
---|
133 | const void * pvType
|
---|
134 | )
|
---|
135 | {
|
---|
136 | PHLLPUBLICSYM pPubSym;
|
---|
137 |
|
---|
138 | assert(pszName != NULL);
|
---|
139 | pPubSym = (PHLLPUBLICSYM)malloc(sizeof(HLLPUBLICSYM) + strlen(pszName));
|
---|
140 | if (pPubSym != NULL)
|
---|
141 | {
|
---|
142 | strcpy(pPubSym->hll.achName, pszName);
|
---|
143 | pPubSym->hll.cchName = strlen(pszName);
|
---|
144 | pPubSym->hll.iObj = iObject;
|
---|
145 | pPubSym->hll.off = off;
|
---|
146 | pPubSym->hll.iType = pvType == NULL ? 0 : -1; //FIXME/TODO: Types->getIndex(pvType); check if 0 or -1.
|
---|
147 | PublicSymbols.insert(pPubSym);
|
---|
148 | free(pPubSym);
|
---|
149 | }
|
---|
150 |
|
---|
151 | return NULL;
|
---|
152 | }
|
---|
153 |
|
---|
154 |
|
---|
155 |
|
---|
156 | BOOL kHll::write(
|
---|
157 | const char *pszFilename
|
---|
158 | )
|
---|
159 | {
|
---|
160 | return FALSE;
|
---|
161 | }
|
---|
162 |
|
---|
163 |
|
---|