VirtualBox

source: kBuild/trunk/src/kmk/kmkbuiltin/kDepObj.c@ 3173

Last change on this file since 3173 was 3167, checked in by bird, 7 years ago

kDep*: no globals; dir-nt-bird.c: only main thread

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 42.6 KB
Line 
1/* $Id: kDepObj.c 3167 2018-03-20 21:47:25Z bird $ */
2/** @file
3 * kDepObj - Extract dependency information from an object file.
4 */
5
6/*
7 * Copyright (c) 2007-2010 knut st. osmundsen <[email protected]>
8 *
9 * This file is part of kBuild.
10 *
11 * kBuild is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * kBuild is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with kBuild. If not, see <http://www.gnu.org/licenses/>
23 *
24 */
25
26/*******************************************************************************
27* Header Files *
28*******************************************************************************/
29#define MSCFAKES_NO_WINDOWS_H
30#include <stdio.h>
31#include <stdlib.h>
32#include <stddef.h>
33#include <string.h>
34#include <errno.h>
35#include <ctype.h>
36#include <stdarg.h>
37#if !defined(_MSC_VER)
38# include <unistd.h>
39#else
40# include <io.h>
41#endif
42#include "k/kDefs.h"
43#include "k/kTypes.h"
44#include "k/kLdrFmts/pe.h"
45#include "kDep.h"
46#include "kmkbuiltin.h"
47
48
49/*******************************************************************************
50* Defined Constants And Macros *
51*******************************************************************************/
52#if 0
53# define dprintf(a) printf a
54# define dump(pb, cb, offBase) depHexDump(pb,cb,offBase)
55# define WITH_DPRINTF
56#else
57# define dprintf(a) do {} while (0)
58# define dump(pb, cb, offBase) do {} while (0)
59# undef WITH_DPRINTF
60#endif
61
62/** @name OMF defines
63 * @{ */
64#define KDEPOMF_THEADR 0x80
65#define KDEPOMF_LHEADR 0x82
66#define KDEPOMF_COMENT 0x88
67#define KDEPOMF_CMTCLS_DEPENDENCY 0xe9
68#define KDEPOMF_CMTCLS_DBGTYPE 0xa1
69#define KDEPOMF_LINNUM 0x94
70#define KDEPOMF_LINNUM32 0x95
71/** @} */
72
73
74/*******************************************************************************
75* Structures and Typedefs *
76*******************************************************************************/
77/** @name OMF Structures
78 * @{ */
79#pragma pack(1)
80/** OMF record header. */
81typedef struct KDEPOMFHDR
82{
83 /** The record type. */
84 KU8 bType;
85 /** The size of the record, excluding this header. */
86 KU16 cbRec;
87} KDEPOMFHDR;
88typedef KDEPOMFHDR *PKDEPOMFHDR;
89typedef const KDEPOMFHDR *PCKDEPOMFHDR;
90
91/** OMF string. */
92typedef struct KDEPOMFSTR
93{
94 KU8 cch;
95 char ach[1];
96} KDEPOMFSTR;
97typedef KDEPOMFSTR *PKDEPOMFSTR;
98typedef const KDEPOMFSTR *PCKDEPOMFSTR;
99
100/** THEADR/LHEADR. */
101typedef struct KDEPOMFTHEADR
102{
103 KDEPOMFHDR Hdr;
104 KDEPOMFSTR Name;
105} KDEPOMFTHEADR;
106typedef KDEPOMFTHEADR *PKDEPOMFTHEADR;
107typedef const KDEPOMFTHEADR *PCKDEPOMFTHEADR;
108
109/** Dependency File. */
110typedef struct KDEPOMFDEPFILE
111{
112 KDEPOMFHDR Hdr;
113 KU8 fType;
114 KU8 bClass;
115 KU16 wDosTime;
116 KU16 wDosDate;
117 KDEPOMFSTR Name;
118} KDEPOMFDEPFILE;
119typedef KDEPOMFDEPFILE *PKDEPOMFDEPFILE;
120typedef const KDEPOMFDEPFILE *PCKDEPOMFDEPFILE;
121
122#pragma pack()
123/** @} */
124
125
126/** @name COFF Structures
127 * @{ */
128#pragma pack(1)
129
130typedef struct KDEPCVSYMHDR
131{
132 /** The record size minus the size field. */
133 KU16 cb;
134 /** The record type. */
135 KU16 uType;
136} KDEPCVSYMHDR;
137typedef KDEPCVSYMHDR *PKDEPCVSYMHDR;
138typedef const KDEPCVSYMHDR *PCKDEPCVSYMHDR;
139
140/** @name Selection of KDEPCVSYMHDR::uType values.
141 * @{ */
142#define K_CV8_S_MSTOOL KU16_C(0x1116)
143/** @} */
144
145typedef struct KDEPCV8SYMHDR
146{
147 /** The record type. */
148 KU32 uType;
149 /** The record size minus the size field. */
150 KU32 cb;
151} KDEPCV8SYMHDR;
152typedef KDEPCV8SYMHDR *PKDEPCV8SYMHDR;
153typedef const KDEPCV8SYMHDR *PCKDEPCV8SYMHDR;
154
155/** @name Known KDEPCV8SYMHDR::uType Values.
156 * @{ */
157#define K_CV8_SYMBOL_INFO KU32_C(0x000000f1)
158#define K_CV8_LINE_NUMBERS KU32_C(0x000000f2)
159#define K_CV8_STRING_TABLE KU32_C(0x000000f3)
160#define K_CV8_SOURCE_FILES KU32_C(0x000000f4)
161#define K_CV8_COMDAT_XXXXX KU32_C(0x000000f5) /**< no idea about the format... */
162/** @} */
163
164#pragma pack()
165/** @} */
166
167/**
168 * Globals.
169 */
170typedef struct KDEPOBJGLOBALS
171{
172 /** Core instance. */
173 DEPGLOBALS Core;
174 /** the executable name. */
175 const char *argv0;
176 /** The file. */
177 const char *pszFile;
178} KDEPOBJGLOBALS;
179/** Pointer to kDepObj globals. */
180typedef KDEPOBJGLOBALS *PKDEPOBJGLOBALS;
181
182
183
184/**
185 * Prints an error message.
186 *
187 * @returns rc.
188 * @param pThis kObjDep instance data.
189 * @param rc The return code, for making one line return statements.
190 * @param pszFormat The message format string.
191 * @param ... Format arguments.
192 * @todo Promote this to kDep.c.
193 */
194static int kDepErr(PKDEPOBJGLOBALS pThis, int rc, const char *pszFormat, ...)
195{
196 va_list va;
197 const char *psz;
198 const char *pszName = pThis->argv0;
199
200 fflush(stdout);
201
202 /* The message prefix. */
203 while ((psz = strpbrk(pszName, "/\\:")) != NULL)
204 pszName = psz + 1;
205
206 if (pThis->pszFile)
207 fprintf(stderr, "%s: %s: error: ", pszName, pThis->pszFile);
208 else
209 fprintf(stderr, "%s: error: ", pszName);
210
211 /* The message. */
212 va_start(va, pszFormat);
213 vfprintf(stderr, pszFormat, va);
214 va_end(va);
215
216 return rc;
217}
218
219
220/**
221 * Gets an index from the data.
222 *
223 * @returns The index, KU16_MAX on buffer underflow.
224 * @param puData The current data stream position (in/out).
225 * @param pcbLeft Number of bytes left (in/out).
226 */
227static KU16 kDepObjOMFGetIndex(KPCUINT *puData, KU16 *pcbLeft)
228{
229 KU16 u16;
230
231 if (*pcbLeft >= 1 && *pcbLeft != KU16_MAX)
232 {
233 *pcbLeft -= 1;
234 u16 = *puData->pb++;
235 if (u16 & KU16_C(0x80))
236 {
237 if (*pcbLeft >= 1)
238 {
239 *pcbLeft -= 1;
240 u16 = ((u16 & KU16_C(0x7f)) << 8) | *puData->pb++;
241 }
242 else
243 u16 = KU16_MAX;
244 }
245 }
246 else
247 u16 = KU16_MAX;
248 return u16;
249}
250
251
252/**
253 * Parses the OMF file.
254 *
255 * @returns 0 on success, 1 on failure, 2 if no dependencies was found.
256 * @param pThis The kDepObj instance data.
257 * @param pbFile The start of the file.
258 * @param cbFile The file size.
259 */
260int kDepObjOMFParse(PKDEPOBJGLOBALS pThis, const KU8 *pbFile, KSIZE cbFile)
261{
262 PCKDEPOMFHDR pHdr = (PCKDEPOMFHDR)pbFile;
263 KSIZE cbLeft = cbFile;
264 char uDbgType = 0; /* H or C */
265 KU8 uDbgVer = KU8_MAX;
266 KU32 iSrc = 0;
267 KU32 iMaybeSrc = 0;
268 KU8 uLinNumType = KU8_MAX;
269 KU16 cLinNums = 0;
270 KU32 cLinFiles = 0;
271 KU32 iLinFile = 0;
272
273 /*
274 * Iterate thru the records until we hit the end or an invalid one.
275 */
276 while ( cbLeft >= sizeof(*pHdr)
277 && cbLeft >= pHdr->cbRec + sizeof(*pHdr))
278 {
279 KPCUINT uData;
280 uData.pv = pHdr + 1;
281
282 /* process selected record types. */
283 dprintf(("%#07" KUPTR_PRI ": %#04x %#05x\n", (const KU8*)pHdr - pbFile, pHdr->bType, pHdr->cbRec));
284 switch (pHdr->bType)
285 {
286 /*
287 * The T/L Header contains the source name. When emitting CodeView 4
288 * and earlier (like masm and watcom does), all includes used by the
289 * line number tables have their own THEADR record.
290 */
291 case KDEPOMF_THEADR:
292 case KDEPOMF_LHEADR:
293 {
294 PCKDEPOMFTHEADR pTHeadr = (PCKDEPOMFTHEADR)pHdr;
295 if (1 + pTHeadr->Name.cch + 1 != pHdr->cbRec)
296 return kDepErr(pThis, 1, "%#07x - Bad %cHEADR record, length mismatch.\n",
297 (const KU8*)pHdr - pbFile, pHdr->bType == KDEPOMF_THEADR ? 'T' : 'L');
298 if ( ( pTHeadr->Name.cch > 2
299 && pTHeadr->Name.ach[pTHeadr->Name.cch - 2] == '.'
300 && ( pTHeadr->Name.ach[pTHeadr->Name.cch - 1] == 'o'
301 || pTHeadr->Name.ach[pTHeadr->Name.cch - 1] == 'O'))
302 || ( pTHeadr->Name.cch > 4
303 && pTHeadr->Name.ach[pTHeadr->Name.cch - 4] == '.'
304 && ( pTHeadr->Name.ach[pTHeadr->Name.cch - 3] == 'o'
305 || pTHeadr->Name.ach[pTHeadr->Name.cch - 3] == 'O')
306 && ( pTHeadr->Name.ach[pTHeadr->Name.cch - 2] == 'b'
307 || pTHeadr->Name.ach[pTHeadr->Name.cch - 2] == 'B')
308 && ( pTHeadr->Name.ach[pTHeadr->Name.cch - 1] == 'j'
309 || pTHeadr->Name.ach[pTHeadr->Name.cch - 1] == 'J'))
310 )
311 dprintf(("%cHEADR: %.*s [ignored]\n", pHdr->bType == KDEPOMF_THEADR ? 'T' : 'L', pTHeadr->Name.cch, pTHeadr->Name.ach));
312 else
313 {
314 dprintf(("%cHEADR: %.*s\n", pHdr->bType == KDEPOMF_THEADR ? 'T' : 'L', pTHeadr->Name.cch, pTHeadr->Name.ach));
315 depAdd(&pThis->Core, pTHeadr->Name.ach, pTHeadr->Name.cch);
316 iMaybeSrc++;
317 }
318 uLinNumType = KU8_MAX;
319 break;
320 }
321
322 case KDEPOMF_COMENT:
323 {
324 KU8 uClass;
325
326 if (pHdr->cbRec < 2 + 1)
327 return kDepErr(pThis, 1, "%#07x - Bad COMMENT record, too small.\n", (const KU8*)pHdr - pbFile);
328 if (uData.pb[0] & 0x3f)
329 return kDepErr(pThis, 1, "%#07x - Bad COMMENT record, reserved flags set.\n", (const KU8*)pHdr - pbFile);
330 uClass = uData.pb[1];
331 uData.pb += 2;
332 switch (uClass)
333 {
334 /*
335 * Borland dependency file comment (famously used by wmake and Watcom).
336 */
337 case KDEPOMF_CMTCLS_DEPENDENCY:
338 {
339 PCKDEPOMFDEPFILE pDep = (PCKDEPOMFDEPFILE)pHdr;
340 if (K_OFFSETOF(KDEPOMFDEPFILE, Name.ach[pDep->Name.cch]) + 1 != pHdr->cbRec + sizeof(*pHdr))
341 {
342 /* Empty record indicates the end of the dependency files,
343 no need to go on. */
344 if (pHdr->cbRec == 2 + 1)
345 return 0;
346 return kDepErr(pThis, 1, "%#07lx - Bad DEPENDENCY FILE record, length mismatch. (%u/%u)\n",
347 (long)((const KU8 *)pHdr - pbFile),
348 K_OFFSETOF(KDEPOMFDEPFILE, Name.ach[pDep->Name.cch]) + 1,
349 (unsigned)(pHdr->cbRec + sizeof(*pHdr)));
350 }
351 depAdd(&pThis->Core, pDep->Name.ach, pDep->Name.cch);
352 iSrc++;
353 break;
354 }
355
356 /*
357 * Pick up the debug type so we can parse the LINNUM records.
358 */
359 case KDEPOMF_CMTCLS_DBGTYPE:
360 if (pHdr->cbRec < 2 + 3 + 1)
361 break; /* ignore, Borland used this for something else apparently. */
362 if ( !(uData.pb[1] == 'C' && uData.pb[2] == 'V')
363 && !(uData.pb[1] == 'H' && uData.pb[2] == 'L'))
364 {
365 dprintf(("Unknown debug type: %c%c (%u)\n", uData.pb[1], uData.pb[2], uData.pb[0]));
366 break;
367 }
368 uDbgType = uData.pb[1];
369 uDbgVer = uData.pb[0];
370 dprintf(("Debug Type %s ver %u\n", uDbgType == 'H' ? "HLL" : "CodeView", uDbgVer));
371 break;
372
373 }
374 break; /* COMENT */
375 }
376
377 /*
378 * LINNUM + THEADR == sigar.
379 */
380 case KDEPOMF_LINNUM:
381 if (uDbgType == 'C')
382 iMaybeSrc |= KU32_C(0x80000000);
383 dprintf(("LINNUM:\n"));
384 break;
385
386 /*
387 * The HLL v4 and v6 file names table will include all files when present, which
388 * is perfect for generating dependencies.
389 */
390 case KDEPOMF_LINNUM32:
391 if ( uDbgType == 'H'
392 && uDbgVer >= 3
393 && uDbgVer <= 6)
394 {
395 /* skip two indexes (group & segment) */
396 KU16 cbRecLeft = pHdr->cbRec - 1;
397 KU16 uGrp = kDepObjOMFGetIndex(&uData, &cbRecLeft);
398 KU16 uSeg = kDepObjOMFGetIndex(&uData, &cbRecLeft);
399 if (uSeg == KU16_MAX)
400 return kDepErr(pThis, 1, "%#07lx - Bad LINNUM32 record\n", (long)((const KU8 *)pHdr - pbFile));
401 K_NOREF(uGrp);
402
403 if (uLinNumType == KU8_MAX)
404 {
405#ifdef WITH_DPRINTF
406 static const char * const s_apsz[5] =
407 {
408 "source file", "listing file", "source & listing file", "file names table", "path table"
409 };
410#endif
411 KU16 uLine;
412 KU8 uReserved;
413 KU16 uSeg2;
414 KU32 cbLinNames;
415
416 if (cbRecLeft < 2+1+1+2+2+4)
417 return kDepErr(pThis, 1, "%#07lx - Bad LINNUM32 record, too short\n", (long)((const KU8 *)pHdr - pbFile));
418 cbRecLeft -= 2+1+1+2+2+4;
419 uLine = *uData.pu16++;
420 uLinNumType = *uData.pu8++;
421 uReserved = *uData.pu8++; K_NOREF(uReserved);
422 cLinNums = *uData.pu16++; K_NOREF(cLinNums);
423 uSeg2 = *uData.pu16++; K_NOREF(uSeg2);
424 cbLinNames = *uData.pu32++; K_NOREF(cbLinNames);
425
426 dprintf(("LINNUM32: uGrp=%#x uSeg=%#x uSeg2=%#x uLine=%#x (MBZ) uReserved=%#x\n",
427 uGrp, uSeg, uSeg2, uLine, uReserved));
428 dprintf(("LINNUM32: cLinNums=%#x (%u) cbLinNames=%#x (%u) uLinNumType=%#x (%s)\n",
429 cLinNums, cLinNums, cbLinNames, cbLinNames, uLinNumType,
430 uLinNumType < K_ELEMENTS(s_apsz) ? s_apsz[uLinNumType] : "??"));
431
432 if (uLine != 0)
433 return kDepErr(pThis, 1, "%#07lx - Bad LINNUM32 record, line %#x (MBZ)\n", (long)((const KU8 *)pHdr - pbFile), uLine);
434 cLinFiles = iLinFile = KU32_MAX;
435 if ( uLinNumType == 3 /* file names table */
436 || uLinNumType == 4 /* path table */)
437 cLinNums = 0; /* no line numbers */
438 else if (uLinNumType > 4)
439 return kDepErr(pThis, 1, "%#07lx - Bad LINNUM32 record, type %#x unknown\n", (long)((const KU8 *)pHdr - pbFile), uLinNumType);
440 }
441 else
442 dprintf(("LINNUM32: uGrp=%#x uSeg=%#x\n", uGrp, uSeg));
443
444
445 /* Skip file numbers (we parse them to follow the stream correctly). */
446 if (uLinNumType != 3 && uLinNumType != 4)
447 {
448 static const unsigned s_acbTypes[3] = { 2+2+4, 4+4+4, 2+2+4+4+4 };
449 unsigned cbEntry = s_acbTypes[uLinNumType];
450
451 while (cLinNums && cbRecLeft)
452 {
453 if (cbRecLeft < cbEntry)
454 return kDepErr(pThis, 1, "%#07lx - Bad LINNUM32 record, incomplete line entry\n", (long)((const KU8 *)pHdr - pbFile));
455
456 switch (uLinNumType)
457 {
458 case 0: /* source file */
459 dprintf((" Line %6" KU16_PRI " of file %2" KU16_PRI " at %#010" KX32_PRI "\n",
460 uData.pu16[0], uData.pu16[1], uData.pu32[1]));
461 break;
462 case 1: /* listing file */
463 dprintf((" Line %6" KU32_PRI ", statement %6" KU32_PRI " at %#010" KX32_PRI "\n",
464 uData.pu32[0], uData.pu32[1], uData.pu32[2]));
465 break;
466 case 2: /* source & listing file */
467 dprintf((" Line %6" KU16_PRI " of file %2" KU16_PRI ", listning line %6" KU32_PRI ", statement %6" KU32_PRI " at %#010" KX32_PRI "\n",
468 uData.pu16[0], uData.pu16[1], uData.pu32[1], uData.pu32[2], uData.pu32[3]));
469 break;
470 }
471 uData.pb += cbEntry;
472 cbRecLeft -= cbEntry;
473 cLinNums--;
474 }
475
476 /* If at end of the announced line number entiries, we may find a file names table
477 here (who is actually emitting this?). */
478 if (!cLinNums)
479 {
480 uLinNumType = cbRecLeft > 0 ? 3 : KU8_MAX;
481 dprintf(("End-of-line-numbers; uLinNumType=%u cbRecLeft=%#x\n", uLinNumType, cbRecLeft));
482 }
483 }
484
485 if (uLinNumType == 3 || uLinNumType == 4)
486 {
487 /* Read the file/path table header (first time only). */
488 if (cLinFiles == KU32_MAX && iLinFile == KU32_MAX)
489 {
490 KU32 iFirstCol;
491 KU32 cCols;
492
493 if (cbRecLeft < 4+4+4)
494 return kDepErr(pThis, 1, "%#07lx - Bad LINNUM32 record, incomplete file/path table header\n", (long)((const KU8 *)pHdr - pbFile));
495 cbRecLeft -= 4+4+4;
496
497 iFirstCol = *uData.pu32++; K_NOREF(iFirstCol);
498 cCols = *uData.pu32++; K_NOREF(cCols);
499 cLinFiles = *uData.pu32++;
500 dprintf(("%s table header: cLinFiles=%#" KX32_PRI " (%" KU32_PRI ") iFirstCol=%" KU32_PRI " cCols=%" KU32_PRI"\n",
501 uLinNumType == 3 ? "file names" : "path", cLinFiles, cLinFiles, iFirstCol, cCols));
502 if (cLinFiles == KU32_MAX)
503 return kDepErr(pThis, 1, "%#07lx - Bad LINNUM32 record, too many file/path table entries.\n", (long)((const KU8 *)pHdr - pbFile));
504 iLinFile = 0;
505 }
506
507 /* Parse the file names / path table. */
508 while (iLinFile < cLinFiles && cbRecLeft)
509 {
510 int cbName = *uData.pb++;
511 if (cbRecLeft < 1 + cbName)
512 return kDepErr(pThis, 1, "%#07lx - Bad LINNUM32 record, file/path table entry too long.\n", (long)((const KU8 *)pHdr - pbFile));
513 iLinFile++;
514 dprintf(("#%" KU32_PRI": %.*s\n", iLinFile, cbName, uData.pch));
515 if (uLinNumType == 3)
516 {
517 depAdd(&pThis->Core, uData.pch, cbName);
518 iSrc++;
519 }
520 cbRecLeft -= 1 + cbName;
521 uData.pb += cbName;
522 }
523
524 /* The end? */
525 if (iLinFile == cLinFiles)
526 {
527 uLinNumType = KU8_MAX;
528 dprintf(("End-of-file/path-table; cbRecLeft=%#x\n", cbRecLeft));
529 }
530 }
531 }
532 else
533 dprintf(("LINNUM32: Unknown or unsupported format\n"));
534 break;
535
536 }
537
538 /* advance */
539 cbLeft -= pHdr->cbRec + sizeof(*pHdr);
540 pHdr = (PCKDEPOMFHDR)((const KU8 *)(pHdr + 1) + pHdr->cbRec);
541 }
542
543 if (cbLeft)
544 return kDepErr(pThis, 1, "%#07x - Unexpected EOF. cbLeft=%#x\n", (const KU8*)pHdr - pbFile, cbLeft);
545
546 if (iSrc == 0 && iMaybeSrc <= 1)
547 {
548 dprintf(("kDepObjOMFParse: No cylindrical smoking thing: iSrc=0 iMaybeSrc=%#" KX32_PRI"\n", iMaybeSrc));
549 return 2;
550 }
551 dprintf(("kDepObjOMFParse: iSrc=%" KU32_PRI " iMaybeSrc=%#" KX32_PRI "\n", iSrc, iMaybeSrc));
552 return 0;
553}
554
555
556/**
557 * Checks if this file is an OMF file or not.
558 *
559 * @returns K_TRUE if it's OMF, K_FALSE otherwise.
560 *
561 * @param pb The start of the file.
562 * @param cb The file size.
563 */
564KBOOL kDepObjOMFTest(const KU8 *pbFile, KSIZE cbFile)
565{
566 PCKDEPOMFTHEADR pHdr = (PCKDEPOMFTHEADR)pbFile;
567
568 if (cbFile <= sizeof(*pHdr))
569 return K_FALSE;
570 if ( pHdr->Hdr.bType != KDEPOMF_THEADR
571 && pHdr->Hdr.bType != KDEPOMF_LHEADR)
572 return K_FALSE;
573 if (pHdr->Hdr.cbRec + sizeof(pHdr->Hdr) >= cbFile)
574 return K_FALSE;
575 if (pHdr->Hdr.cbRec != 1 + pHdr->Name.cch + 1)
576 return K_FALSE;
577
578 return K_TRUE;
579}
580
581
582/**
583 * Parses a CodeView 8 symbol section.
584 *
585 * @returns 0 on success, 1 on failure, 2 if no dependencies was found.
586 * @param pThis The kDepObj instance data.
587 * @param pbSyms Pointer to the start of the symbol section.
588 * @param cbSyms Size of the symbol section.
589 */
590int kDepObjCOFFParseCV8SymbolSection(PKDEPOBJGLOBALS pThis, const KU8 *pbSyms, KU32 cbSyms)
591{
592 char const * pchStrTab = NULL;
593 KU32 cbStrTab = 0;
594 KPCUINT uSrcFiles = {0};
595 KU32 cbSrcFiles = 0;
596 KU32 off = 4;
597 KU32 iSrc = 0;
598
599 if (cbSyms < 16)
600 return 1;
601
602 /*
603 * The parsing loop.
604 */
605 while (off < cbSyms)
606 {
607 PCKDEPCV8SYMHDR pHdr = (PCKDEPCV8SYMHDR)(pbSyms + off);
608 KPCUINT uData;
609 KU32 cbData;
610 uData.pv = pHdr + 1;
611
612 if (off + sizeof(*pHdr) >= cbSyms)
613 {
614 fprintf(stderr, "%s: CV symbol table entry at %08" KX32_PRI " is too long; cbSyms=%#" KX32_PRI "\n",
615 pThis->argv0, off, cbSyms);
616 return 1; /* FIXME */
617 }
618
619 cbData = pHdr->cb;
620 if (off + cbData + sizeof(*pHdr) > cbSyms)
621 {
622 fprintf(stderr, "%s: CV symbol table entry at %08" KX32_PRI " is too long; cbData=%#" KX32_PRI " cbSyms=%#" KX32_PRI "\n",
623 pThis->argv0, off, cbData, cbSyms);
624 return 1; /* FIXME */
625 }
626
627 /* If the size is 0, assume it covers the rest of the section. VC++ 2003 has
628 been observed doing thing. */
629 if (!cbData)
630 cbData = cbSyms - off;
631
632 switch (pHdr->uType)
633 {
634 case K_CV8_SYMBOL_INFO:
635 dprintf(("%06" KX32_PRI " %06" KX32_PRI ": Symbol Info\n", off, cbData));
636 /*dump(uData.pb, cbData, 0);*/
637 break;
638
639 case K_CV8_LINE_NUMBERS:
640 dprintf(("%06" KX32_PRI " %06" KX32_PRI ": Line numbers\n", off, cbData));
641 /*dump(uData.pb, cbData, 0);*/
642 break;
643
644 case K_CV8_STRING_TABLE:
645 dprintf(("%06" KX32_PRI " %06" KX32_PRI ": String table\n", off, cbData));
646 if (pchStrTab)
647 fprintf(stderr, "%s: warning: Found yet another string table!\n", pThis->argv0);
648 pchStrTab = uData.pch;
649 cbStrTab = cbData;
650 /*dump(uData.pb, cbData, 0);*/
651 break;
652
653 case K_CV8_SOURCE_FILES:
654 dprintf(("%06" KX32_PRI " %06" KX32_PRI ": Source files\n", off, cbData));
655 if (uSrcFiles.pb)
656 fprintf(stderr, "%s: warning: Found yet another source files table!\n", pThis->argv0);
657 uSrcFiles = uData;
658 cbSrcFiles = cbData;
659 /*dump(uData.pb, cbData, 0);*/
660 break;
661
662 case K_CV8_COMDAT_XXXXX:
663 dprintf(("%06" KX32_PRI " %06" KX32_PRI ": 0xf5 Unknown COMDAT stuff\n", off, cbData));
664 /*dump(uData.pb, cbData, 0);*/
665 break;
666
667 default:
668 dprintf(("%06" KX32_PRI " %06" KX32_PRI ": Unknown type %#" KX32_PRI "\n",
669 off, cbData, pHdr->uType));
670 dump(uData.pb, cbData, 0);
671 break;
672 }
673
674 /* next */
675 cbData = (cbData + 3) & ~KU32_C(3);
676 off += cbData + sizeof(*pHdr);
677 }
678
679 /*
680 * Did we find any source files and strings?
681 */
682 if (!pchStrTab || !uSrcFiles.pv)
683 {
684 dprintf(("kDepObjCOFFParseCV8SymbolSection: No cylindrical smoking thing: pchStrTab=%p uSrcFiles.pv=%p\n", pchStrTab, uSrcFiles.pv));
685 return 2;
686 }
687
688 /*
689 * Iterate the source file table.
690 */
691 off = 0;
692 while (off < cbSrcFiles)
693 {
694 KU32 offFile;
695 const char *pszFile;
696 KSIZE cchFile;
697 KU16 u16Type;
698 KPCUINT uSrc;
699 KU32 cbSrc;
700
701 /*
702 * Validate and parse the entry (variable length record are fun).
703 */
704 if (off + 8 > cbSrcFiles)
705 {
706 fprintf(stderr, "%s: CV source file entry at %08" KX32_PRI " is too long; cbSrcFiles=%#" KX32_PRI "\n",
707 pThis->argv0, off, cbSrcFiles);
708 return 1;
709 }
710 uSrc.pb = uSrcFiles.pb + off;
711 u16Type = uSrc.pu16[2];
712 cbSrc = u16Type == 0x0110 ? 6 + 16 + 2 : 6 + 2;
713 if (off + cbSrc > cbSrcFiles)
714 {
715 fprintf(stderr, "%s: CV source file entry at %08" KX32_PRI " is too long; cbSrc=%#" KX32_PRI " cbSrcFiles=%#" KX32_PRI "\n",
716 pThis->argv0, off, cbSrc, cbSrcFiles);
717 return 1;
718 }
719
720 offFile = *uSrc.pu32;
721 if (offFile > cbStrTab)
722 {
723 fprintf(stderr, "%s: CV source file entry at %08" KX32_PRI " is out side the string table; offFile=%#" KX32_PRI " cbStrTab=%#" KX32_PRI "\n",
724 pThis->argv0, off, offFile, cbStrTab);
725 return 1;
726 }
727 pszFile = pchStrTab + offFile;
728 cchFile = strlen(pszFile);
729 if (cchFile == 0)
730 {
731 fprintf(stderr, "%s: CV source file entry at %08" KX32_PRI " has an empty file name; offFile=%#x" KX32_PRI "\n",
732 pThis->argv0, off, offFile);
733 return 1;
734 }
735
736 /*
737 * Display the result and add it to the dependency database.
738 */
739 depAdd(&pThis->Core, pszFile, cchFile);
740 if (u16Type == 0x0110)
741 dprintf(("#%03" KU32_PRI ": {todo-md5-todo} '%s'\n",
742 iSrc, pszFile));
743 else
744 dprintf(("#%03" KU32_PRI ": type=%#06" KX16_PRI " '%s'\n", iSrc, u16Type, pszFile));
745
746
747 /* next */
748 iSrc++;
749 off += cbSrc;
750 }
751
752 if (iSrc == 0)
753 {
754 dprintf(("kDepObjCOFFParseCV8SymbolSection: No cylindrical smoking thing: iSrc=0\n"));
755 return 2;
756 }
757 dprintf(("kDepObjCOFFParseCV8SymbolSection: iSrc=%" KU32_PRI "\n", iSrc));
758 return 0;
759}
760
761
762/**
763 * Parses the OMF file.
764 *
765 * @returns 0 on success, 1 on failure, 2 if no dependencies was found.
766 * @param pThis The kDepObj instance data.
767 * @param pbFile The start of the file.
768 * @param cbFile The file size.
769 */
770int kDepObjCOFFParse(PKDEPOBJGLOBALS pThis, const KU8 *pbFile, KSIZE cbFile)
771{
772 IMAGE_FILE_HEADER const *pFileHdr = (IMAGE_FILE_HEADER const *)pbFile;
773 ANON_OBJECT_HEADER_BIGOBJ const *pBigObjHdr = (ANON_OBJECT_HEADER_BIGOBJ const *)pbFile;
774 IMAGE_SECTION_HEADER const *paSHdrs;
775 KU32 cSHdrs;
776 unsigned iSHdr;
777 KPCUINT u;
778 int rcRet = 2;
779 int rc;
780
781 if ( pBigObjHdr->Sig1 == 0
782 && pBigObjHdr->Sig2 == KU16_MAX)
783 {
784 paSHdrs = (IMAGE_SECTION_HEADER const *)(pBigObjHdr + 1);
785 cSHdrs = pBigObjHdr->NumberOfSections;
786 }
787 else
788 {
789 paSHdrs = (IMAGE_SECTION_HEADER const *)((KU8 const *)(pFileHdr + 1) + pFileHdr->SizeOfOptionalHeader);
790 cSHdrs = pFileHdr->NumberOfSections;
791 }
792
793
794 dprintf(("COFF file!\n"));
795
796 for (iSHdr = 0; iSHdr < cSHdrs; iSHdr++)
797 {
798 if ( !memcmp(paSHdrs[iSHdr].Name, ".debug$S", sizeof(".debug$S") - 1)
799 && paSHdrs[iSHdr].SizeOfRawData > 4)
800 {
801 u.pb = pbFile + paSHdrs[iSHdr].PointerToRawData;
802 dprintf(("CV symbol table: version=%x\n", *u.pu32));
803 if (*u.pu32 == 0x000000004)
804 rc = kDepObjCOFFParseCV8SymbolSection(pThis, u.pb, paSHdrs[iSHdr].SizeOfRawData);
805 else
806 rc = 2;
807 dprintf(("rc=%d\n", rc));
808 if (rcRet == 2)
809 rcRet = rc;
810 if (rcRet != 2)
811 return rc;
812 }
813 dprintf(("#%d: %.8s\n", iSHdr, paSHdrs[iSHdr].Name));
814 }
815 return rcRet;
816}
817
818
819/**
820 * Checks if this file is a COFF file or not.
821 *
822 * @returns K_TRUE if it's COFF, K_FALSE otherwise.
823 *
824 * @param pb The start of the file.
825 * @param cb The file size.
826 */
827KBOOL kDepObjCOFFTest(const KU8 *pbFile, KSIZE cbFile)
828{
829 IMAGE_FILE_HEADER const *pFileHdr = (IMAGE_FILE_HEADER const *)pbFile;
830 ANON_OBJECT_HEADER_BIGOBJ const *pBigObjHdr = (ANON_OBJECT_HEADER_BIGOBJ const *)pbFile;
831 IMAGE_SECTION_HEADER const *paSHdrs;
832 KU32 cSHdrs;
833 KU32 iSHdr;
834 KSIZE cbHdrs;
835
836 if (cbFile <= sizeof(*pFileHdr))
837 return K_FALSE;
838
839 /*
840 * Deal with -bigobj output first.
841 */
842 if ( pBigObjHdr->Sig1 == 0
843 && pBigObjHdr->Sig2 == KU16_MAX)
844 {
845 static const KU8 s_abClsId[16] = { ANON_OBJECT_HEADER_BIGOBJ_CLS_ID_BYTES };
846
847 paSHdrs = (IMAGE_SECTION_HEADER const *)(pBigObjHdr + 1);
848 cSHdrs = pBigObjHdr->NumberOfSections;
849 cbHdrs = sizeof(IMAGE_SECTION_HEADER) * cSHdrs;
850
851 if (cbFile <= sizeof(*pBigObjHdr))
852 return K_FALSE;
853
854 if (pBigObjHdr->Version != 2)
855 return K_FALSE;
856 if (memcmp(&pBigObjHdr->ClassID[0], s_abClsId, sizeof(pBigObjHdr->ClassID)) != 0)
857 return K_FALSE;
858
859 if ( pBigObjHdr->Machine != IMAGE_FILE_MACHINE_I386
860 && pBigObjHdr->Machine != IMAGE_FILE_MACHINE_AMD64
861 && pBigObjHdr->Machine != IMAGE_FILE_MACHINE_ARM
862 && pBigObjHdr->Machine != IMAGE_FILE_MACHINE_ARMNT
863 && pBigObjHdr->Machine != IMAGE_FILE_MACHINE_ARM64
864 && pBigObjHdr->Machine != IMAGE_FILE_MACHINE_EBC)
865 {
866 fprintf(stderr, "kDepObj: error: bigobj Machine not supported: %#x\n", pBigObjHdr->Machine);
867 return K_FALSE;
868 }
869 if (pBigObjHdr->Flags != 0)
870 {
871 fprintf(stderr, "kDepObj: error: bigobj Flags field is non-zero: %#x\n", pBigObjHdr->Flags);
872 return K_FALSE;
873 }
874 if (pBigObjHdr->SizeOfData != 0)
875 {
876 fprintf(stderr, "kDepObj: error: bigobj SizeOfData field is non-zero: %#x\n", pBigObjHdr->SizeOfData);
877 return K_FALSE;
878 }
879
880 if ( pBigObjHdr->PointerToSymbolTable != 0
881 && ( pBigObjHdr->PointerToSymbolTable < cbHdrs
882 || pBigObjHdr->PointerToSymbolTable > cbFile))
883 return K_FALSE;
884 if ( pBigObjHdr->PointerToSymbolTable == 0
885 && pBigObjHdr->NumberOfSymbols != 0)
886 return K_FALSE;
887 }
888 /*
889 * Look for normal COFF object.
890 */
891 else
892 {
893 paSHdrs = (IMAGE_SECTION_HEADER const *)((KU8 const *)(pFileHdr + 1) + pFileHdr->SizeOfOptionalHeader);
894 cSHdrs = pFileHdr->NumberOfSections;
895 cbHdrs = (const KU8 *)&paSHdrs[cSHdrs] - (const KU8 *)pbFile;
896
897 if ( pFileHdr->Machine != IMAGE_FILE_MACHINE_I386
898 && pFileHdr->Machine != IMAGE_FILE_MACHINE_AMD64
899 && pFileHdr->Machine != IMAGE_FILE_MACHINE_ARM
900 && pFileHdr->Machine != IMAGE_FILE_MACHINE_ARMNT
901 && pFileHdr->Machine != IMAGE_FILE_MACHINE_ARM64
902 && pFileHdr->Machine != IMAGE_FILE_MACHINE_EBC)
903 return K_FALSE;
904
905 if (pFileHdr->SizeOfOptionalHeader != 0)
906 return K_FALSE; /* COFF files doesn't have an optional header */
907
908 if ( pFileHdr->PointerToSymbolTable != 0
909 && ( pFileHdr->PointerToSymbolTable < cbHdrs
910 || pFileHdr->PointerToSymbolTable > cbFile))
911 return K_FALSE;
912 if ( pFileHdr->PointerToSymbolTable == 0
913 && pFileHdr->NumberOfSymbols != 0)
914 return K_FALSE;
915 if ( pFileHdr->Characteristics
916 & ( IMAGE_FILE_DLL
917 | IMAGE_FILE_SYSTEM
918 | IMAGE_FILE_UP_SYSTEM_ONLY
919 | IMAGE_FILE_NET_RUN_FROM_SWAP
920 | IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP
921 | IMAGE_FILE_EXECUTABLE_IMAGE
922 | IMAGE_FILE_RELOCS_STRIPPED))
923 return K_FALSE;
924 }
925 if ( cSHdrs <= 1
926 || cSHdrs > cbFile)
927 return K_FALSE;
928 if (cbHdrs >= cbFile)
929 return K_FALSE;
930
931 /*
932 * Check the section headers.
933 */
934 for (iSHdr = 0; iSHdr < cSHdrs; iSHdr++)
935 {
936 if ( paSHdrs[iSHdr].PointerToRawData != 0
937 && ( paSHdrs[iSHdr].PointerToRawData < cbHdrs
938 || paSHdrs[iSHdr].PointerToRawData >= cbFile
939 || paSHdrs[iSHdr].PointerToRawData + paSHdrs[iSHdr].SizeOfRawData > cbFile))
940 return K_FALSE;
941 if ( paSHdrs[iSHdr].PointerToRelocations != 0
942 && ( paSHdrs[iSHdr].PointerToRelocations < cbHdrs
943 || paSHdrs[iSHdr].PointerToRelocations >= cbFile
944 || paSHdrs[iSHdr].PointerToRelocations + paSHdrs[iSHdr].NumberOfRelocations * 10 > cbFile)) /* IMAGE_RELOCATION */
945 return K_FALSE;
946 if ( paSHdrs[iSHdr].PointerToLinenumbers != 0
947 && ( paSHdrs[iSHdr].PointerToLinenumbers < cbHdrs
948 || paSHdrs[iSHdr].PointerToLinenumbers >= cbFile
949 || paSHdrs[iSHdr].PointerToLinenumbers + paSHdrs[iSHdr].NumberOfLinenumbers * 6 > cbFile)) /* IMAGE_LINENUMBER */
950 return K_FALSE;
951 }
952
953 return K_TRUE;
954}
955
956
957/**
958 * Read the file into memory and parse it.
959 */
960static int kDepObjProcessFile(PKDEPOBJGLOBALS pThis, FILE *pInput)
961{
962 size_t cbFile;
963 KU8 *pbFile;
964 void *pvOpaque;
965 int rc = 0;
966
967 /*
968 * Read the file into memory.
969 */
970 pbFile = (KU8 *)depReadFileIntoMemory(pInput, &cbFile, &pvOpaque);
971 if (!pbFile)
972 return 1;
973
974 /*
975 * See if it's an OMF file, then process it.
976 */
977 if (kDepObjOMFTest(pbFile, cbFile))
978 rc = kDepObjOMFParse(pThis, pbFile, cbFile);
979 else if (kDepObjCOFFTest(pbFile, cbFile))
980 rc = kDepObjCOFFParse(pThis, pbFile, cbFile);
981 else
982 {
983 fprintf(stderr, "%s: error: Doesn't recognize the header of the OMF/COFF file.\n", pThis->argv0);
984 rc = 1;
985 }
986
987 depFreeFileMemory(pbFile, pvOpaque);
988 return rc;
989}
990
991
992static void kDebObjUsage(const char *a_argv0)
993{
994 printf("usage: %s -o <output> -t <target> [-fqs] [-e <ignore-ext>] <OMF or COFF file>\n"
995 " or: %s --help\n"
996 " or: %s --version\n",
997 a_argv0, a_argv0, a_argv0);
998}
999
1000
1001int kmk_builtin_kDepObj(int argc, char *argv[], char **envp)
1002{
1003 int i;
1004 KDEPOBJGLOBALS This;
1005
1006 /* Arguments. */
1007 FILE *pOutput = NULL;
1008 const char *pszOutput = NULL;
1009 FILE *pInput = NULL;
1010 const char *pszTarget = NULL;
1011 int fStubs = 0;
1012 int fFixCase = 0;
1013 const char *pszIgnoreExt = NULL;
1014 /* Argument parsing. */
1015 int fInput = 0; /* set when we've found input argument. */
1016 int fQuiet = 0;
1017
1018 /* Init instance data. */
1019 This.argv0 = argv[0];
1020 This.pszFile = NULL;
1021
1022 /*
1023 * Parse arguments.
1024 */
1025 if (argc <= 1)
1026 {
1027 kDebObjUsage(argv[0]);
1028 return 1;
1029 }
1030 for (i = 1; i < argc; i++)
1031 {
1032 if (argv[i][0] == '-')
1033 {
1034 const char *pszValue;
1035 const char *psz = &argv[i][1];
1036 char chOpt;
1037 chOpt = *psz++;
1038 if (chOpt == '-')
1039 {
1040 /* Convert long to short option. */
1041 if (!strcmp(psz, "quiet"))
1042 chOpt = 'q';
1043 else if (!strcmp(psz, "help"))
1044 chOpt = '?';
1045 else if (!strcmp(psz, "version"))
1046 chOpt = 'V';
1047 else
1048 {
1049 fprintf(stderr, "%s: syntax error: Invalid argument '%s'.\n", argv[0], argv[i]);
1050 kDebObjUsage(argv[0]);
1051 return 2;
1052 }
1053 psz = "";
1054 }
1055
1056 /*
1057 * Requires value?
1058 */
1059 switch (chOpt)
1060 {
1061 case 'o':
1062 case 't':
1063 case 'e':
1064 if (*psz)
1065 pszValue = psz;
1066 else if (++i < argc)
1067 pszValue = argv[i];
1068 else
1069 {
1070 fprintf(stderr, "%s: syntax error: The '-%c' option takes a value.\n", argv[0], chOpt);
1071 return 2;
1072 }
1073 break;
1074
1075 default:
1076 pszValue = NULL;
1077 break;
1078 }
1079
1080
1081 switch (chOpt)
1082 {
1083 /*
1084 * Output file.
1085 */
1086 case 'o':
1087 {
1088 if (pOutput)
1089 {
1090 fprintf(stderr, "%s: syntax error: only one output file!\n", argv[0]);
1091 return 2;
1092 }
1093 pszOutput = pszValue;
1094 if (pszOutput[0] == '-' && !pszOutput[1])
1095 pOutput = stdout;
1096 else
1097 pOutput = fopen(pszOutput, "w");
1098 if (!pOutput)
1099 {
1100 fprintf(stderr, "%s: error: Failed to create output file '%s'.\n", argv[0], pszOutput);
1101 return 1;
1102 }
1103 break;
1104 }
1105
1106 /*
1107 * Target name.
1108 */
1109 case 't':
1110 {
1111 if (pszTarget)
1112 {
1113 fprintf(stderr, "%s: syntax error: only one target!\n", argv[0]);
1114 return 1;
1115 }
1116 pszTarget = pszValue;
1117 break;
1118 }
1119
1120 /*
1121 * Fix case.
1122 */
1123 case 'f':
1124 {
1125 fFixCase = 1;
1126 break;
1127 }
1128
1129 /*
1130 * Quiet.
1131 */
1132 case 'q':
1133 {
1134 fQuiet = 1;
1135 break;
1136 }
1137
1138 /*
1139 * Generate stubs.
1140 */
1141 case 's':
1142 {
1143 fStubs = 1;
1144 break;
1145 }
1146
1147 /*
1148 * Extension to ignore.
1149 */
1150 case 'e':
1151 {
1152 if (pszIgnoreExt)
1153 {
1154 fprintf(stderr, "%s: syntax error: The '-e' option can only be used once!\n", argv[0]);
1155 return 2;
1156 }
1157 pszIgnoreExt = pszValue;
1158 break;
1159 }
1160
1161 /*
1162 * The mandatory version & help.
1163 */
1164 case '?':
1165 kDebObjUsage(argv[0]);
1166 return 0;
1167 case 'V':
1168 case 'v':
1169 return kbuild_version(argv[0]);
1170
1171 /*
1172 * Invalid argument.
1173 */
1174 default:
1175 fprintf(stderr, "%s: syntax error: Invalid argument '%s'.\n", argv[0], argv[i]);
1176 kDebObjUsage(argv[0]);
1177 return 2;
1178 }
1179 }
1180 else
1181 {
1182 pInput = fopen(argv[i], "rb");
1183 if (!pInput)
1184 {
1185 fprintf(stderr, "%s: error: Failed to open input file '%s'.\n", argv[0], argv[i]);
1186 return 1;
1187 }
1188 fInput = 1;
1189 }
1190
1191 /*
1192 * End of the line?
1193 */
1194 if (fInput)
1195 {
1196 if (++i < argc)
1197 {
1198 fprintf(stderr, "%s: syntax error: No arguments shall follow the input spec.\n", argv[0]);
1199 return 1;
1200 }
1201 break;
1202 }
1203 }
1204
1205 /*
1206 * Got all we require?
1207 */
1208 if (!pInput)
1209 {
1210 fprintf(stderr, "%s: syntax error: No input!\n", argv[0]);
1211 return 1;
1212 }
1213 if (!pOutput)
1214 {
1215 fprintf(stderr, "%s: syntax error: No output!\n", argv[0]);
1216 return 1;
1217 }
1218 if (!pszTarget)
1219 {
1220 fprintf(stderr, "%s: syntax error: No target!\n", argv[0]);
1221 return 1;
1222 }
1223
1224 /*
1225 * Do the parsing.
1226 */
1227 depInit(&This.Core);
1228 i = kDepObjProcessFile(&This, pInput);
1229 fclose(pInput);
1230
1231 /*
1232 * Write the dependecy file.
1233 */
1234 if (!i)
1235 {
1236 depOptimize(&This.Core, fFixCase, fQuiet, pszIgnoreExt);
1237 fprintf(pOutput, "%s:", pszTarget);
1238 depPrint(&This.Core, pOutput);
1239 if (fStubs)
1240 depPrintStubs(&This.Core, pOutput);
1241 }
1242
1243 /*
1244 * Close the output, delete output on failure.
1245 */
1246 if (!i && ferror(pOutput))
1247 {
1248 i = 1;
1249 fprintf(stderr, "%s: error: Error writing to '%s'.\n", argv[0], pszOutput);
1250 }
1251 fclose(pOutput);
1252 if (i)
1253 {
1254 if (unlink(pszOutput))
1255 fprintf(stderr, "%s: warning: failed to remove output file '%s' on failure.\n", argv[0], pszOutput);
1256 }
1257
1258 depCleanup(&This.Core);
1259 return i;
1260}
1261
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette