Actually before the first error i got some errors which i ignored and
continued...
i got errors like:
"xxx.c line169, Upload the database First. reset then push the HOTSYNC"
Then i got the error 1)"*** just read from memory location 0x00000006, which
is in low memory."
and when i continue the debugger i get second error
2)"*** just read from memory location 0x47121113, causing a bus error."
Here is the code :
static UInt16 StartApplication(void)
{
Int16 error;
UInt16 mode=dmModeReadWrite;
LocalID dbID;
UInt16 cardNo;
UInt16 dbAttrs;
DataCollectorPreferenceType prefs;
UInt16 prefSize;
Int16 i=0;
Char* buffer;
UInt16 bufLen;
char pilotid[13];
UInt16 retval;
/*Here assign today's date format year/month/day as global variable; 5/27/98
*/
DateTimeType today;
char dateBuffer[longDateStrLength];
char year[4];
char realToday[10];
DateFormatType dateFormat;
MemHandle dateH;
MemPtr dateR;
MemHandle recordH;
SiteDeptRecordTypePtr recordP;
//Get User from the Palm Profession
UInt16 textLen;
MemHandle nameH;
Char* nameP;
//version number
UInt32 romVersion;
//draw busy icon
DrawBusyIcon();
dateFormat=dfYMDWithSlashes;
TimSecondsToDateTime(TimGetSeconds(), &today);
StrIToA(year, today.year);
realToday[0]=year[0];
realToday[1]=year[1];
realToday[2]='\0';
DateToAscii(today.month, today.day, today.year, dateFormat, dateBuffer);
StrCat(realToday, dateBuffer);
// StrCopy(ReadDate, realToday);
ReadDate=realToday;
//allocate dynamic memory here
dateH = MemHandleNew(17);
dateR = MemHandleLock(dateH);
StrCopy(dateR, realToday);
MemHandleUnlock(dateH);
DataCollectorDB = DmOpenDatabaseByTypeCreator(dataCollectorDBType,
dataCollectorAppType, mode);
if (! DataCollectorDB)
{
ErrDisplay("Upload the Database First. Reset then Push the
HOTSYNC");
}
GID=DmFindDatabase(0, dataCollectorDBName);
DmDatabaseProtect(0, GID, Protect);
DataCollectorUserDB= DmOpenDatabaseByTypeCreator (userDBType, creator,
dmModeReadWrite);
if (!DataCollectorUserDB)
{
ErrDisplay("Please reset, and push Hotsync to load databases!");
}
UID=DmFindDatabase(0, userDBName);
DmDatabaseProtect(0, UID, Protect);
DataCollectorSystemDB=DmOpenDatabaseByTypeCreator(systemDBType, creator,
dmModeReadWrite);
if (!DataCollectorSystemDB)
{
ErrDisplay("Push reset, and Hotsync to upload databases first");
}
SID=DmFindDatabase(0, systemDBName);
DmDatabaseProtect(0, SID, Protect);
DataCollectorAreaDB=DmOpenDatabaseByTypeCreator(areaDBType, creator,
dmModeReadWrite);
if (!DataCollectorAreaDB)
{
ErrDisplay("Push reset, and Hotsync to upload database first!");
}
MessageDB=DmOpenDatabaseByTypeCreator(MessageDBType, creator,
dmModeReadWrite);
if (!MessageDB)
{
ErrDisplay("Push reset, and Hotsync to upload database first!");
}
MID=DmFindDatabase(0, MessageDBName);
DmDatabaseProtect(0, MID, Protect);
// Warning
WarningDB=DmOpenDatabaseByTypeCreator(WarningDBType, creator,
dmModeReadWrite);
if (!WarningDB)
{
ErrDisplay("Push reset, and Hotsync to upload database first!");
}
WNID=DmFindDatabase(0, WarningDBName);
DmDatabaseProtect(0, WNID, Protect);
//SiteDB
SiteDB=DmOpenDatabaseByTypeCreator(SiteDeptDBType, creator,
dmModeReadWrite);
//Assign global variables SiteID, DeptID here
recordH = DmQueryRecord(SiteDB, 0);
recordP =(SiteDeptRecordTypePtr)MemHandleLock(recordH);
SiteID = recordP->siteID;
DeptID = recordP->deptID;
MemHandleUnlock(recordH);
if (!SiteDB)
{
ErrDisplay(" Push reset, and Hotsync to upload the Database first!");
}
//OpStatusDB
OpStatusDB = DmOpenDatabaseByTypeCreator(OpStatusDBType, creator,
dmModeReadWrite);
if(!OpStatusDB)
{
ErrDisplay("Push reset, and Hotsync to get data from the server");
}
//LogDB
DataCollectorLogDB=DmOpenDatabaseByTypeCreator(logDBType, creator,
dmModeReadWrite);
if (!DataCollectorLogDB)
{
ErrDisplay("Push reset, and Hotsync to get data from the server");
// error=DmCreateDatabase(0, logDBName, creator, logDBType, false);
// if (error) return (error);
// DataCollectorLogDB=DmOpenDatabaseByTypeCreator(logDBType, creator,
dmModeReadWrite);
// if (!DataCollectorLogDB) return (-1);
}
//ReadDB if not exist, create one
DataCollectorReadDB = DmOpenDatabaseByTypeCreator(dataCollectorReadDBType,
creator, dmModeReadWrite);
if (! DataCollectorReadDB)
{
error = DmCreateDatabase(0, dataCollectorReadDBName,
creator, dataCollectorReadDBType, false);
ErrFatalDisplayIf(error, "Could not create new database.");
DataCollectorReadDB = DmOpenDatabaseByTypeCreator(dataCollectorReadDBType,
creator, dmModeReadWrite);
}
RID=DmFindDatabase(0, dataCollectorReadDBName);
DmDatabaseProtect(0, RID, Funny);
//NoteDB if not exist, create one
NoteDB=DmOpenDatabaseByTypeCreator(NoteDBType, creator, dmModeReadWrite);
if(!NoteDB)
{
error = DmCreateDatabase(0, NoteDBName, creator, NoteDBType, false);
ErrFatalDisplayIf(error, "Could not create new database.");
NoteDB = DmOpenDatabaseByTypeCreator(NoteDBType, creator,
dmModeReadWrite);
}
//LogSeqDB
LogSeqDB=DmOpenDatabaseByTypeCreator(LogSeqDBType, creator,
dmModeReadWrite);
if(!LogSeqDB)
{
error = DmCreateDatabase(0, LogSeqDBName, creator, LogSeqDBType,
false);
ErrFatalDisplayIf(error, "Could not create new database.");
LogSeqDB = DmOpenDatabaseByTypeCreator(LogSeqDBType, creator,
dmModeReadWrite);
}
prefSize=sizeof(prefs);
if(PrefGetAppPreferences(dataCollectorAppType, dataCollectorPrefID,
&prefs,
&prefSize, true)==dataCollectorVersionNum)
{
PreviousUserID=prefs.UserID; // This is original code
// if(prefs.UserID !=NULL)
// StrCopy(PreviousUserID, prefs.UserID); //just added 9/10/98
if(prefs.WatchID!=NULL)
PreviousWatchID=prefs.WatchID;
// WatchID = PreviousWatchID + 1;
// if(prefs.LogSeqID != NULL)
// PreviousLogSeqID = prefs.LogSeqID;
if(prefs.ReadDate!=NULL)
PreviousReadDate=prefs.ReadDate; /*Just try to see what happen*/
// StrCopy(PreviousReadDate, prefs.ReadDate);
if(prefs.LogID !=NULL)
PreviousLogID = prefs.LogID;
if(prefs.StatusID !=NULL)
PreviousStatusID = prefs.StatusID;
}
else{
PrefSetPreference(prefHard1CharAppCreator, dataCollectorAppCreator);
PrefSetPreference(prefHard2CharAppCreator, dataCollectorAppCreator);
PrefSetPreference(prefHard3CharAppCreator, dataCollectorAppCreator);
PrefSetPreference(prefHard4CharAppCreator, dataCollectorAppCreator);
//Initilized LogSeqID
WatchID = 100;
}
WinEraseWindow();
CurrentView=DataCollectorLoginForm;
/*set time out value in secondd for auto-power-off */
SysSetAutoOffTime(300);
for( i=0; i<700; i++)
MainArray[i]=-1;
for ( i=0; i<50; i++)
{
AreaArray[i]=-1;
SystemArray[i]=-1;
}
return error;
}
"Tom Hoelscher" <[EMAIL PROTECTED]> wrote in message
news:62390@palm-dev-forum...
>
> What are you doing right before the first error?
>
> If you are reading from (or moving data from) some kind of handle, it's
> possible you are stepping outside the handle...
>
> You may also be manipulating a handle/var that you haven't allocated yet
(or
> have deallocated).
>
>
>
> on 9/13/01 15:42, Praveen Potineni at [EMAIL PROTECTED] wrote:
>
> > Hi All,
> >
> > I am trying to debug an application using pose 3.2 and i'm getting these
> > errors:
> >
> > 1)"*** just read from memory location 0x00000006, which is in low
memory."
> > and when i continue the debugger i get second error
> > 2)"*** just read from memory location 0x47121113, causing a bus error."
> >
> > Can u help me with this..i'm new to palm development and i'm not yet
quite
> > sure how to debug and find unintialized variables...
> >
> > Thanks
> > Praveen
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/