dbStatic: Added -b option to dbExpand
-b turns off monotonic checking of breakpoint tables.
This commit is contained in:
@@ -13,6 +13,10 @@
|
||||
|
||||
<!-- Insert new items immediately below here ... -->
|
||||
|
||||
<h4>Added <tt>-b</tt> option to dbExpand</h4>
|
||||
|
||||
<p>This turns off monotonic checking of breakpoint tables.</p>
|
||||
|
||||
<h4>Launchpad Bugs Resolved</h4>
|
||||
|
||||
<p>The following are links to bugs in the Launchpad bug tracker that have been
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* Copyright (c) 2011 UChicago Argonne LLC, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/* dbExpand.c */
|
||||
/* Author: Marty Kraimer Date: 30NOV95 */
|
||||
/* Author: Marty Kraimer Date: 30NOV95 */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
@@ -24,25 +23,28 @@
|
||||
#include "gpHash.h"
|
||||
#include "osiFileName.h"
|
||||
|
||||
epicsShareExtern int dbBptNotMonotonic; /* from dbLexRoutines.c */
|
||||
|
||||
DBBASE *pdbbase = NULL;
|
||||
|
||||
|
||||
void usage(void)
|
||||
{
|
||||
fprintf(stderr, "Usage:\n\tdbExpand -Ipath -ooutfile "
|
||||
"-S macro=value file1.dbd file2.dbd ...\n");
|
||||
fprintf(stderr, "Usage:\n\tdbExpand -b -Ipath -ooutfile "
|
||||
"-S macro=value file1.dbd file2.dbd ...\n");
|
||||
fprintf(stderr,"Specifying any path will replace the default of '.'\n");
|
||||
fprintf(stderr,"The -b option enables relaxed breakpoint table checking\n");
|
||||
}
|
||||
|
||||
int main(int argc,char **argv)
|
||||
{
|
||||
char *path = NULL;
|
||||
char *sub = NULL;
|
||||
int pathLength = 0;
|
||||
int subLength = 0;
|
||||
char *path = NULL;
|
||||
char *sub = NULL;
|
||||
int pathLength = 0;
|
||||
int subLength = 0;
|
||||
char *outFilename = NULL;
|
||||
FILE *outFP = stdout;
|
||||
long status;
|
||||
long returnStatus = 0;
|
||||
long status;
|
||||
long returnStatus = 0;
|
||||
static char *pathSep = OSI_PATH_LIST_SEPARATOR;
|
||||
static char *subSep = ",";
|
||||
|
||||
@@ -53,8 +55,8 @@ int main(int argc,char **argv)
|
||||
while ((argc > 1) && (**argv == '-')) {
|
||||
char optLtr = (*argv)[1];
|
||||
char *optArg;
|
||||
|
||||
if (strlen(*argv) > 2) {
|
||||
|
||||
if (strlen(*argv) > 2 || optLtr == 'b') {
|
||||
optArg = *argv+2;
|
||||
++argv;
|
||||
--argc;
|
||||
@@ -63,36 +65,40 @@ int main(int argc,char **argv)
|
||||
argv += 2;
|
||||
argc -= 2;
|
||||
}
|
||||
|
||||
|
||||
switch (optLtr) {
|
||||
case 'o':
|
||||
outFilename = optArg;
|
||||
break;
|
||||
|
||||
|
||||
case 'I':
|
||||
dbCatString(&path, &pathLength, optArg, pathSep);
|
||||
break;
|
||||
|
||||
|
||||
case 'S':
|
||||
dbCatString(&sub, &subLength, optArg, subSep);
|
||||
break;
|
||||
|
||||
|
||||
case 'b':
|
||||
dbBptNotMonotonic = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "dbExpand: Unknown option '-%c'\n", optLtr);
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (argc < 1) {
|
||||
fprintf(stderr, "dbExpand: No input file specified\n");
|
||||
fprintf(stderr, "dbExpand: No input file specified\n");
|
||||
usage();
|
||||
exit(1);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
for (; argc>0; --argc, ++argv) {
|
||||
status = dbReadDatabase(&pdbbase,*argv,path,sub);
|
||||
if (status) returnStatus = status;
|
||||
status = dbReadDatabase(&pdbbase,*argv,path,sub);
|
||||
if (status) returnStatus = status;
|
||||
}
|
||||
if (returnStatus) {
|
||||
errlogFlush();
|
||||
@@ -106,7 +112,7 @@ int main(int argc,char **argv)
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
dbWriteMenuFP(pdbbase,outFP,0);
|
||||
dbWriteRecordTypeFP(pdbbase,outFP,0);
|
||||
dbWriteDeviceFP(pdbbase,outFP);
|
||||
@@ -116,7 +122,7 @@ int main(int argc,char **argv)
|
||||
dbWriteVariableFP(pdbbase,outFP);
|
||||
dbWriteBreaktableFP(pdbbase,outFP);
|
||||
dbWriteRecordFP(pdbbase,outFP,0,0);
|
||||
|
||||
|
||||
free((void *)path);
|
||||
free((void *)sub);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user