📄 xpcline.cpp
字号:
/*This program is used to invert program error positions back to
a source line number. The input is a PC position (in hex) and
a module name (case sensitive).
*/
#include <iostream.h>
#include <Symbol.h>
#include <BaseIO.h>
#include <search.h>
#include <cstring.h>
void main()
{
Module m;
unsigned int pc, line;
long start, end;
char fileName[64];
char hexBuffer[64];
for ( ;; ) {
cout<<"enter fileName: ";
cin>>fileName;
if (strstr(fileName, ".rfc")<0) {
strcat(fileName, ".RFC");
};
cout<<fileName<<'\n';
if (Search(fileName) && Open(m, fileName,noKey)) {
cout<<"opened the module\n";
cout<<"Enter PC value (in hex): ";
cin>>hexBuffer;
StringToBit ( pc , hexBuffer , 16 ) ;
GetErrPosition(m, pc, start, end);
line = GetLineno(m, start);
cout<<"errStart="<<start<<" errStop="<<end<<'\n';
cout<<"line="<<line<<'\n';
Close(m);
} else {
cout<<"failed to open\n";
};
}; /*loop*/
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -