Changeset 3441 for trunk/tools


Ignore:
Timestamp:
Apr 24, 2000, 11:38:12 PM (25 years ago)
Author:
bird
Message:

Fixed makefile, added missing sym.h and removed warnings in kHll.cpp and Sym2Hll.cpp.

Location:
trunk/tools/dbginfo
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/dbginfo/Sym2Hll.cpp

    r3334 r3441  
    1 /* $Id: Sym2Hll.cpp,v 1.4 2000-04-07 02:49:36 bird Exp $
     1/* $Id: Sym2Hll.cpp,v 1.5 2000-04-24 21:38:11 bird Exp $
    22 *
    33 * Sym2Hll - Symbol file to HLL debuginfo converter.
     
    3838*   Internal Functions                                                         *
    3939*******************************************************************************/
     40void            syntax(void);
    4041void *          readfile(const char *pszFilename);
    4142signed long     fsize(FILE *phFile);
     
    6061    if (argc != 3)
    6162    {
     63        syntax();
    6264        fprintf(stderr, "syntax error\n");
    6365        return -87;
     
    8385    if (pbSym != NULL)
    8486    {
    85         int             rc;
    86         kHllModuleEntry*pModule;
    87         PMAPDEF         pMapDef;             /* Mapfile header */
     87        APIRET              rc;
     88        kHllModuleEntry *   pModule;
     89        PMAPDEF             pMapDef;        /* Mapfile header */
    8890
    8991        pMapDef = (PMAPDEF)pbSym;
     
    9193        {
    9294            int         iSegment;
    93             PSEGDEF     pSegDef;             /* Segment header */
     95            PSEGDEF     pSegDef;            /* Segment header */
    9496
    9597            /*
     
    186188                 * Add segment to the module - FIXME - need info from the LX Object table...
    187189                 */
    188                 pLXObject = pFileLX->getObject(iSegment-1);
     190                pLXObject = pFileLX->getObject((USHORT)iSegment-1);
    189191                if (pLXObject)
    190192                {
    191                     if (!pModule->addSegInfo(iSegment, 0, pLXObject->o32_size))
     193                    if (!pModule->addSegInfo((USHORT)iSegment, 0, pLXObject->o32_size))
    192194                        fprintf(stderr, "warning: addseginfo failed!\n");
    193195                }
     
    228230                     * Add symbol - currently we define it as public - it's a symbol local to this module really.
    229231                     */
    230                     pModule->addPublicSymbol(pachName, cchName, offset, iSegment, 0);
     232                    pModule->addPublicSymbol(pachName, cchName, offset, (USHORT)iSegment, 0);
    231233                }
    232234
     
    293295
    294296
     297/**
     298 * Syntax.
     299 */
     300void syntax(void)
     301{
     302    printf("Sym2Hll.exe <symfile> <lxfile>\n");
     303}
     304
    295305
    296306
     
    314324        if (cbFile > 0)
    315325        {
    316             pvFile = malloc(cbFile + 1);
     326            pvFile = malloc((size_t)cbFile + 1);
    317327            if (pvFile != NULL)
    318328            {
    319                 memset(pvFile, 0, cbFile + 1);
    320                 if (fread(pvFile, 1, cbFile, phFile) == 0)
     329                memset(pvFile, 0, (size_t)cbFile + 1);
     330                if (fread(pvFile, 1, (size_t)cbFile, phFile) == 0)
    321331                {   /* failed! */
    322332                    free(pvFile);
  • trunk/tools/dbginfo/kHll.cpp

    r3344 r3441  
    1 /* $Id: kHll.cpp,v 1.11 2000-04-07 17:20:24 bird Exp $
     1/* $Id: kHll.cpp,v 1.12 2000-04-24 21:38:12 bird Exp $
    22 *
    33 * kHll - Implementation of the class kHll.
     
    122122    assert(pPubSym != NULL);
    123123
    124     pPubSym->cchName = cchName;
     124    pPubSym->cchName = (unsigned char)cchName;
    125125    pPubSym->achName[0] = '\0';
    126126    strncat((char*)&pPubSym->achName[0], pachName, cchName);
     
    402402    if ((cbFilenames + cchFilename + 1) >= cbFilenamesAllocated)
    403403    {
    404         void *pv = realloc(pachFilenames, cbFilenamesAllocated + 256);
     404        void *pv = realloc(pachFilenames, (size_t)cbFilenamesAllocated + 256);
    405405        assert(pv != NULL);
    406406        if (pv == NULL)
     
    414414     * Add filename
    415415     */
    416     pachFilenames[cbFilenames++] = cchFilename;
     416    pachFilenames[cbFilenames++] = (char)cchFilename;
    417417    memcpy(&pachFilenames[cbFilenames], pachFilename, cchFilename);
    418418    cbFilenames += cchFilename;
    419419
    420     return ++cFilenames;
     420    return (unsigned short)++cFilenames;
    421421}
    422422
     
    449449    FirstEntry.hll04.uchType = 3;       /* filename */
    450450    FirstEntry.hll04.uchReserved = 0;
    451     FirstEntry.hll04.cEntries = max(cFilenames, 1);
     451    FirstEntry.hll04.cEntries = (unsigned short)max(cFilenames, 1);
    452452    FirstEntry.hll04.iSeg = 0;
    453     FirstEntry.hll04.u1.cbFileNameTable = cbFilenames > 0 ? cbFilenames : 8;
     453    FirstEntry.hll04.u1.cbFileNameTable = cbFilenames != 0 ? cbFilenames : 8;
    454454    cb = sizeof(FirstEntry.hll04);
    455455    cbWritten = cbWrote = fwrite(&FirstEntry, 1, cb, phFile);
     
    465465        return -1;
    466466
    467     if (cbFilenames > 0)
     467    if (cbFilenames != 0)
    468468    {
    469469        cbWritten += cbWrote = fwrite(pachFilenames, 1, cbFilenames, phFile);
     
    543543    assert(pModule != NULL);
    544544    memset(pModule, 0, sizeof(*pModule));
    545     pModule->cchName = cchName;
     545    pModule->cchName = (unsigned char)cchName;
    546546    strcpy((char*)&pModule->achName[0], pszName);
    547547    pModule->chVerMajor = 4;
     
    554554
    555555    /* objects */
    556     if (cSegInfo > 0)
     556    if (cSegInfo != 0)
    557557    {
    558558        pModule->SegInfo0.iObject = paSegInfo->iObject;
     
    688688        off,
    689689        iObject,
    690         pvType == NULL ? 0 : -1 //FIXME/TODO: Types->getIndex(pvType); check if 0 or -1.
     690        (unsigned short)(pvType == NULL ? 0 : -1) //FIXME/TODO: Types->getIndex(pvType); check if 0 or -1.
    691691        );
    692692
     
    820820    cchWritten += cch;
    821821
    822     if (cbPublicSymbols > 0)
     822    if (cbPublicSymbols != 0)
    823823    {
    824824        hllDirEntry.usType  = HLL_DE_PUBLICS;
     
    858858    */
    859859
    860     if (cbSource > 0)
     860    if (cbSource != 0)
    861861    {
    862862        hllDirEntry.usType  = HLL_DE_IBMSRC;
     
    965965    while (pModule != NULL)
    966966    {
    967         cch = pModule->writeDirEntries(phFile, iMod);
     967        cch = pModule->writeDirEntries(phFile, (unsigned short)iMod);
    968968        if (cch == -1)
    969969            return -1;
     
    10491049    pEntry = new kHllModuleEntry(
    10501050        pszName,
    1051         pvLib == NULL ? 0 : -1, //FIXME/TODO: Libs->getIndex(pvLib); check if 0 or -1;
    1052         cSegInfo,
     1051        (unsigned short)(pvLib == NULL ? 0 : -1), //FIXME/TODO: Libs->getIndex(pvLib); check if 0 or -1;
     1052        (unsigned char) cSegInfo,
    10531053        paSegInfo);
    10541054
     
    10771077    char szModName[256];
    10781078    kHllModuleEntry *   pEntry;
    1079     assert(pachName != NULL && cchName > 0);
     1079    assert(pachName != NULL && cchName != 0);
    10801080
    10811081    szModName[0] = '\0';
     
    10831083    pEntry = new kHllModuleEntry(
    10841084        szModName,
    1085         pvLib == NULL ? 0 : -1, //FIXME/TODO: Libs->getIndex(pvLib); check if 0 or -1;
    1086         cSegInfo,
     1085        (unsigned short)(pvLib == NULL ? 0 : -1), //FIXME/TODO: Libs->getIndex(pvLib); check if 0 or -1;
     1086        (unsigned char)cSegInfo,
    10871087        paSegInfo);
    10881088
     
    12561256signed long fsize(FILE *phFile)
    12571257{
    1258     int ipos;
     1258    long ipos;
    12591259    signed long cb;
    12601260
  • trunk/tools/dbginfo/makefile

    r3286 r3441  
    1 # $Id: makefile,v 1.2 2000-03-31 15:35:10 bird Exp $
     1# $Id: makefile,v 1.3 2000-04-24 21:38:12 bird Exp $
     2#
     3# Makefile for debug info convertes - experimental.
     4#
     5# Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     6#
     7# Project Odin Software License can be found in LICENSE.TXT
     8#
    29
    310
    4 all: Sym2Hll dbgLXDumper.exe
    5 
    6 Sym2Hll:
    7     icc /Ti+ /Tm- /W3 /I..\common /B"/NOE" Sym2Hll.cpp kHll.cpp ..\common\commonicc.lib
     11# Directory macros.
     12PDWIN32_INCLUDE = ..\..\include
     13PDWIN32_LIB     = ..\..\lib
     14PDWIN32_BIN     = ..\..\$(OBJDIR)
     15PDWIN32_TOOLS   = ..\..\tools\bin
    816
    917
    10 dbgLXDumper.obj: dbgLXDumper.c hll.h
    11     icc -c /Ti+ dbgLXDumper.c
     18# Compiler, tools, and interference rules.
     19EXETARGET=1
     20!include $(PDWIN32_INCLUDE)/pdwin32.mk
    1221
     22
     23# Flag overloads and local macros.
     24CINCLUDES  = -I..\common
     25
     26CFLAGS     = $(CINCLUDES) $(CFLAGS) -DRING3 \
     27             -Ge+ -Wall+ppt-ppc-inl-cnv-gnr-vft-gen-uni-ext- -Gm- -Gn- -Ti+ -Rn -Tm-
     28CXXFLAGS   = $(CINCLUDES) $(CXXFLAGS) -DRING3 \
     29             -Ge+ -Wall+ppt-ppc-inl-cnv-gnr-vft- -Gm- -Gn- -Ti+ -Gx -Rn -Tm-
     30
     31
     32# All rule - build objs, target dll, copies dll to bin and makes libs.
     33all: Sym2Hll.exe dbgLXDumper.exe
     34
     35
     36#
     37# Sym2Hll executable rule.
     38#
     39Sym2Hll:
     40Sym2Hll.exe: Sym2Hll.obj kHll.obj ..\common\commonicc.lib
     41    $(LD2) $(LD2FLAGS) /PMTYPE:vio /EXEC:$@ $** $(RTLLIB) os2386.lib
     42
     43
     44#
     45# LX debug info dumper (HLL only) executable rule.
     46#
     47dbgLXDumper.exe: dbgLXDumper.obj dummy.obj
     48    $(LD2) $(LD2FLAGS) /PMTYPE:vio /EXEC:$@ $** $(RTLLIB) os2386.lib
     49
     50# Dummy source file rule
    1351dummy.c:
    1452    echo creating <<$@
     
    2058    icc -c  $**
    2159
    22 dbgLXDumper.exe: dbgLXDumper.obj dummy.obj
    23     icc /Ti+ dbgLXDumper.obj dummy.obj
    2460
    2561
     62
     63# Dep rule - makes depenencies for C, C++ and Asm files.
     64# -o- removes the object directory - for the time being.
     65dep:
     66    $(DEPEND) -o- -I$(PDWIN32_INCLUDE);$(PDWIN32_INCLUDE)\win; $(CINCLUDES) \
     67        *.c *.cpp *.h *.asm *.inc $(PDWIN32_INCLUDE)\*.h
     68
     69
     70# Includes the common rules.
     71!include $(PDWIN32_INCLUDE)/pdwin32.post
     72
     73
Note: See TracChangeset for help on using the changeset viewer.