mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Porting pice. Intermediate checkin. Now compiles and runs a little bit.
svn path=/trunk/; revision=2516
This commit is contained in:
parent
793bbe0455
commit
3595be74a5
12 changed files with 170 additions and 63 deletions
|
@ -86,7 +86,7 @@ void process_stabs(
|
||||||
SymbolFileHeader.magic = PICE_MAGIC;
|
SymbolFileHeader.magic = PICE_MAGIC;
|
||||||
strcpy(temp,pExeName);
|
strcpy(temp,pExeName);
|
||||||
pSlash = strrchr(temp,'\\');
|
pSlash = strrchr(temp,'\\');
|
||||||
pDot = strrchr(temp,'.');
|
pDot = strchr(temp,'.');
|
||||||
if(pDot)
|
if(pDot)
|
||||||
{
|
{
|
||||||
*pDot = 0;
|
*pDot = 0;
|
||||||
|
@ -371,7 +371,7 @@ int process_pe(char* filename,int file,void* p,int len)
|
||||||
|
|
||||||
strcpy(szSymName,filename);
|
strcpy(szSymName,filename);
|
||||||
//printf("LOADER: file name = %s\n",szSymName);
|
//printf("LOADER: file name = %s\n",szSymName);
|
||||||
if((pDot = strrchr(szSymName,'.')))
|
if((pDot = strchr(szSymName,'.')))
|
||||||
{
|
{
|
||||||
*pDot = 0;
|
*pDot = 0;
|
||||||
strcat(pDot,".dbg");
|
strcat(pDot,".dbg");
|
||||||
|
|
|
@ -239,14 +239,14 @@ BOOLEAN InstallSWBreakpoint(ULONG ulAddress,BOOLEAN bPermanent,void (*SWBreakpoi
|
||||||
// TODO: must also check if it's a writable page
|
// TODO: must also check if it's a writable page
|
||||||
if(IsAddressValid(ulAddress) )
|
if(IsAddressValid(ulAddress) )
|
||||||
{
|
{
|
||||||
DPRINT((0,"InstallSWBreakpoint(): %.8X is valid\n",ulAddress));
|
DPRINT((0,"InstallSWBreakpoint(): %.8X is valid, writable? %d\n",ulAddress,IsAddressWriteable(ulAddress)));
|
||||||
if((p = FindSwBp(ulAddress))==NULL)
|
if((p = FindSwBp(ulAddress))==NULL)
|
||||||
{
|
{
|
||||||
DPRINT((0,"InstallSWBreakpoint(): %.8X is free\n",ulAddress));
|
DPRINT((0,"InstallSWBreakpoint(): %.8X is free\n",ulAddress));
|
||||||
if( (p=FindEmptySwBpSlot()) )
|
if( (p=FindEmptySwBpSlot()) )
|
||||||
{
|
{
|
||||||
DPRINT((0,"InstallSWBreakpoint(): found empty slot\n"));
|
DPRINT((0,"InstallSWBreakpoint(): found empty slot\n"));
|
||||||
|
DPRINT((0,"InstallSWBreakpoint(): %x value: %x", ulAddress, *(PUCHAR)ulAddress));
|
||||||
p->ucOriginalOpcode = *(PUCHAR)ulAddress;
|
p->ucOriginalOpcode = *(PUCHAR)ulAddress;
|
||||||
*(PUCHAR)ulAddress = 0xCC;
|
*(PUCHAR)ulAddress = 0xCC;
|
||||||
p->bUsed = TRUE;
|
p->bUsed = TRUE;
|
||||||
|
|
|
@ -67,13 +67,13 @@ VOID Pice_dprintf(ULONG DebugLevel, PCHAR DebugMessage, ...)
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start(ap, DebugMessage);
|
va_start(ap, DebugMessage);
|
||||||
if (DebugLevel <= lDebugLevel)
|
if (/*DebugLevel <= lDebugLevel*/ DebugLevel == 2)
|
||||||
{
|
{
|
||||||
save_flags(ulDebugFlags);
|
save_flags(ulDebugFlags);
|
||||||
cli();
|
cli();
|
||||||
PICE_vsprintf(tempDebug, DebugMessage, ap);
|
PICE_vsprintf(tempDebug, DebugMessage, ap);
|
||||||
//ei DebugSendString(tempDebug);
|
//ei DebugSendString(tempDebug);
|
||||||
DbgPrint("%s", tempDebug);
|
Print(OUTPUT_WINDOW, tempDebug);
|
||||||
restore_flags(ulDebugFlags);
|
restore_flags(ulDebugFlags);
|
||||||
}
|
}
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
|
@ -798,7 +798,7 @@ void Print(USHORT Window,LPSTR p)
|
||||||
{
|
{
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
|
||||||
DPRINT((5,"%s",p));
|
DPRINT((11,"%s",p));
|
||||||
|
|
||||||
//ENTER_FUNC();
|
//ENTER_FUNC();
|
||||||
if(!bConsoleIsInitialized)
|
if(!bConsoleIsInitialized)
|
||||||
|
|
|
@ -262,7 +262,8 @@ void InstallPrintkHook(void)
|
||||||
{
|
{
|
||||||
ENTER_FUNC();
|
ENTER_FUNC();
|
||||||
DPRINT((0,"installing PrintString hook\n"));
|
DPRINT((0,"installing PrintString hook\n"));
|
||||||
|
DPRINT((0,"installing PrintString hook. DISABLED for now!!!!!!!!!!!\n"));
|
||||||
|
/* ei fix later
|
||||||
ScanExports("_KdpPrintString",(PULONG)&ulPrintk);
|
ScanExports("_KdpPrintString",(PULONG)&ulPrintk);
|
||||||
|
|
||||||
ASSERT( ulPrintk ); // temporary
|
ASSERT( ulPrintk ); // temporary
|
||||||
|
@ -271,6 +272,7 @@ void InstallPrintkHook(void)
|
||||||
{
|
{
|
||||||
InstallSWBreakpoint(ulPrintk,TRUE,PrintkCallback);
|
InstallSWBreakpoint(ulPrintk,TRUE,PrintkCallback);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
LEAVE_FUNC();
|
LEAVE_FUNC();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1313,7 +1313,7 @@ void DisplaySourceFile(LPSTR pSrcLine,LPSTR pSrcEnd,ULONG ulLineNumber,ULONG ulL
|
||||||
LPSTR pTemp;
|
LPSTR pTemp;
|
||||||
ULONG j = ulLineNumber-1;
|
ULONG j = ulLineNumber-1;
|
||||||
|
|
||||||
DPRINT((0,"DisplaySourceFile(%.8X,%u,%u)\n",pSrcLine,ulLineNumber,ulLineNumberToInvert));
|
DPRINT((2,"DisplaySourceFile(%.8X,%u,%u)\n",pSrcLine,ulLineNumber,ulLineNumberToInvert));
|
||||||
|
|
||||||
// go to line
|
// go to line
|
||||||
while(j--)
|
while(j--)
|
||||||
|
@ -1411,16 +1411,16 @@ void UnassembleOneLineDown(void)
|
||||||
{
|
{
|
||||||
ULONG addr,addrorg;
|
ULONG addr,addrorg;
|
||||||
|
|
||||||
DPRINT((0,"UnassembleOneLineDown()\n"));
|
DPRINT((2,"UnassembleOneLineDown()\n"));
|
||||||
|
|
||||||
addrorg = addr = GetLinearAddress(usOldDisasmSegment,ulOldDisasmOffset);
|
addrorg = addr = GetLinearAddress(usOldDisasmSegment,ulOldDisasmOffset);
|
||||||
|
|
||||||
DPRINT((0,"UnassembleOneLineDown(): addr = %.8X\n",addr));
|
DPRINT((2,"UnassembleOneLineDown(): addr = %.8X\n",addr));
|
||||||
|
|
||||||
tempCmd[0]=0;
|
tempCmd[0]=0;
|
||||||
Disasm(&addr,tempCmd);
|
Disasm(&addr,tempCmd);
|
||||||
|
|
||||||
DPRINT((0,"UnassembleOneLineDown(): addr after = %.8X\n",addr));
|
DPRINT((2,"UnassembleOneLineDown(): addr after = %.8X\n",addr));
|
||||||
|
|
||||||
ulOldDisasmOffset += (addr - addrorg);
|
ulOldDisasmOffset += (addr - addrorg);
|
||||||
RepaintSource();
|
RepaintSource();
|
||||||
|
@ -1434,17 +1434,17 @@ void UnassembleOnePageDown(ULONG page)
|
||||||
{
|
{
|
||||||
ULONG addr,addrorg,i;
|
ULONG addr,addrorg,i;
|
||||||
|
|
||||||
DPRINT((0,"UnassembleOnePageDown()\n"));
|
DPRINT((2,"UnassembleOnePageDown()\n"));
|
||||||
|
|
||||||
addrorg = addr = GetLinearAddress(usOldDisasmSegment,ulOldDisasmOffset);
|
addrorg = addr = GetLinearAddress(usOldDisasmSegment,ulOldDisasmOffset);
|
||||||
|
|
||||||
DPRINT((0,"UnassembleOnePageDown(): addr = %.8X\n",addr));
|
DPRINT((2,"UnassembleOnePageDown(): addr = %.8X\n",addr));
|
||||||
|
|
||||||
tempCmd[0]=0;
|
tempCmd[0]=0;
|
||||||
for(i=0;i<page;i++)
|
for(i=0;i<page;i++)
|
||||||
Disasm(&addr,tempCmd);
|
Disasm(&addr,tempCmd);
|
||||||
|
|
||||||
DPRINT((0,"UnassembleOnePageDown(): addr after = %.8X\n",addr));
|
DPRINT((2,"UnassembleOnePageDown(): addr after = %.8X\n",addr));
|
||||||
|
|
||||||
ulOldDisasmOffset += (addr - addrorg);
|
ulOldDisasmOffset += (addr - addrorg);
|
||||||
RepaintSource();
|
RepaintSource();
|
||||||
|
@ -1460,18 +1460,18 @@ void UnassembleOneLineUp(void)
|
||||||
LONG offset;
|
LONG offset;
|
||||||
LPSTR pSymbol;
|
LPSTR pSymbol;
|
||||||
|
|
||||||
DPRINT((0,"UnassembleOneLineUp()\n"));
|
DPRINT((2,"UnassembleOneLineUp()\n"));
|
||||||
|
|
||||||
addrorg = addr = GetLinearAddress(usOldDisasmSegment,ulOldDisasmOffset);
|
addrorg = addr = GetLinearAddress(usOldDisasmSegment,ulOldDisasmOffset);
|
||||||
|
|
||||||
DPRINT((0,"UnassembleOneLineUp(): addrorg = %.8X\n",addr));
|
DPRINT((2,"UnassembleOneLineUp(): addrorg = %.8X\n",addr));
|
||||||
|
|
||||||
offset = 1;
|
offset = 1;
|
||||||
|
|
||||||
if((pSymbol = FindFunctionByAddress(addrorg-offset,&start,&end)) )
|
if((pSymbol = FindFunctionByAddress(addrorg-offset,&start,&end)) )
|
||||||
{
|
{
|
||||||
offset = addrorg - start;
|
offset = addrorg - start;
|
||||||
DPRINT((0,"UnassembleOneLineUp(): %s @ offset = %u\n",pSymbol,offset));
|
DPRINT((2,"UnassembleOneLineUp(): %s @ offset = %u\n",pSymbol,offset));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1485,12 +1485,12 @@ void UnassembleOneLineUp(void)
|
||||||
addr = addrorg - offset;
|
addr = addrorg - offset;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
DPRINT((0,"UnassembleOneLineUp(): offset = %u addrorg %x addr %x\n",offset,addrorg,addr));
|
DPRINT((2,"UnassembleOneLineUp(): offset = %u addrorg %x addr %x\n",offset,addrorg,addr));
|
||||||
// disassemble while not reaching current instruction
|
// disassemble while not reaching current instruction
|
||||||
addrbefore = addr;
|
addrbefore = addr;
|
||||||
tempCmd[0]=0;
|
tempCmd[0]=0;
|
||||||
Disasm(&addr,tempCmd);
|
Disasm(&addr,tempCmd);
|
||||||
DPRINT((0,"%.8X: %s\n",addrbefore,tempCmd));
|
DPRINT((2,"%.8X: %s\n",addrbefore,tempCmd));
|
||||||
}while((addr != addrorg) && (addrbefore < addrorg));
|
}while((addr != addrorg) && (addrbefore < addrorg));
|
||||||
|
|
||||||
if((addrorg - addrstart)<=0)
|
if((addrorg - addrstart)<=0)
|
||||||
|
@ -1498,7 +1498,7 @@ void UnassembleOneLineUp(void)
|
||||||
else
|
else
|
||||||
ulOldDisasmOffset -= (addrorg - addrbefore);
|
ulOldDisasmOffset -= (addrorg - addrbefore);
|
||||||
|
|
||||||
DPRINT((0,"UnassembleOneLineUp(): new addr = %.4X:%.8X\n",usOldDisasmSegment,ulOldDisasmOffset));
|
DPRINT((2,"UnassembleOneLineUp(): new addr = %.4X:%.8X\n",usOldDisasmSegment,ulOldDisasmOffset));
|
||||||
|
|
||||||
RepaintSource();
|
RepaintSource();
|
||||||
}
|
}
|
||||||
|
@ -1513,20 +1513,20 @@ void UnassembleOnePageUp(ULONG page)
|
||||||
LONG offset;
|
LONG offset;
|
||||||
LPSTR pSymbol;
|
LPSTR pSymbol;
|
||||||
|
|
||||||
DPRINT((0,"UnassembleOnePageUp()\n"));
|
DPRINT((2,"UnassembleOnePageUp()\n"));
|
||||||
|
|
||||||
for(i=0;i<page;i++)
|
for(i=0;i<page;i++)
|
||||||
{
|
{
|
||||||
addrorg = addr = GetLinearAddress(usOldDisasmSegment,ulOldDisasmOffset);
|
addrorg = addr = GetLinearAddress(usOldDisasmSegment,ulOldDisasmOffset);
|
||||||
|
|
||||||
DPRINT((0,"UnassembleOnePageUp(): addrorg = %.8X\n",addr));
|
DPRINT((2,"UnassembleOnePageUp(): addrorg = %.8X\n",addr));
|
||||||
|
|
||||||
offset = 1;
|
offset = 1;
|
||||||
|
|
||||||
if((pSymbol = FindFunctionByAddress(addrorg-offset,&start,&end)) )
|
if((pSymbol = FindFunctionByAddress(addrorg-offset,&start,&end)) )
|
||||||
{
|
{
|
||||||
offset = addrorg - start;
|
offset = addrorg - start;
|
||||||
DPRINT((0,"UnassembleOnePageUp(): %s @ offset = %u\n",pSymbol,offset));
|
DPRINT((2,"UnassembleOnePageUp(): %s @ offset = %u\n",pSymbol,offset));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1539,12 +1539,12 @@ void UnassembleOnePageUp(ULONG page)
|
||||||
addrstart = addrorg;
|
addrstart = addrorg;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
DPRINT((0,"UnassembleOnePageUp(): offset = %u addrorg %x addr %x\n",offset,addrorg,addr));
|
DPRINT((2,"UnassembleOnePageUp(): offset = %u addrorg %x addr %x\n",offset,addrorg,addr));
|
||||||
addrbefore = addr;
|
addrbefore = addr;
|
||||||
// disassemble while not reaching current instruction
|
// disassemble while not reaching current instruction
|
||||||
tempCmd[0]=0;
|
tempCmd[0]=0;
|
||||||
Disasm(&addr,tempCmd);
|
Disasm(&addr,tempCmd);
|
||||||
DPRINT((0,"%.8X: %s\n",addrbefore,tempCmd));
|
DPRINT((2,"%.8X: %s\n",addrbefore,tempCmd));
|
||||||
}while((addr != addrorg) && (addrbefore < addrorg));
|
}while((addr != addrorg) && (addrbefore < addrorg));
|
||||||
|
|
||||||
if((addrorg - addrstart)<=0)
|
if((addrorg - addrstart)<=0)
|
||||||
|
@ -1554,7 +1554,7 @@ void UnassembleOnePageUp(ULONG page)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT((0,"UnassembleOnePageUp(): new addr = %.4X:%.8X\n",usOldDisasmSegment,ulOldDisasmOffset));
|
DPRINT((2,"UnassembleOnePageUp(): new addr = %.4X:%.8X\n",usOldDisasmSegment,ulOldDisasmOffset));
|
||||||
|
|
||||||
RepaintSource();
|
RepaintSource();
|
||||||
}
|
}
|
||||||
|
@ -1614,7 +1614,7 @@ COMMAND_PROTOTYPE(Unassemble)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
|
||||||
DPRINT((0,"Unassemble(%0.4X:%0.8X)\n",segment,addr));
|
DPRINT((2,"Unassemble(%0.4X:%0.8X)\n",segment,addr));
|
||||||
|
|
||||||
//
|
//
|
||||||
// unassemble
|
// unassemble
|
||||||
|
@ -1652,18 +1652,19 @@ COMMAND_PROTOTYPE(Unassemble)
|
||||||
if(pCurrentMod)
|
if(pCurrentMod)
|
||||||
{
|
{
|
||||||
ULONG mod_addr;
|
ULONG mod_addr;
|
||||||
DPRINT((0,"Unassemble(): pCurrentMod->name = %S\n",pCurrentMod->name));
|
DPRINT((2,"Unassemble(): pCurrentMod->name = %S\n",pCurrentMod->name));
|
||||||
mod_addr = (ULONG)pCurrentMod->BaseAddress;
|
mod_addr = (ULONG)pCurrentMod->BaseAddress;
|
||||||
|
|
||||||
pCurrentSymbols = FindModuleSymbols(mod_addr);
|
pCurrentSymbols = FindModuleSymbols(mod_addr);
|
||||||
DPRINT((0,"Unassemble(): pCurrentSymbols = %x\n",(ULONG)pCurrentSymbols));
|
DPRINT((2,"Unassemble(): pCurrentSymbols = %x\n",(ULONG)pCurrentSymbols));
|
||||||
}
|
}
|
||||||
DPRINT((0,"Unassemble(): pCurrentMod = %x\n",pCurrentMod));
|
DPRINT((2,"Unassemble(): pCurrentMod = %x, showsrc: %d\n",pCurrentMod, bShowSrc));
|
||||||
|
|
||||||
ulCurrentlyDisplayedLineNumber = 0;
|
ulCurrentlyDisplayedLineNumber = 0;
|
||||||
|
|
||||||
if(bShowSrc && bForceDisassembly == FALSE && (pSrc = FindSourceLineForAddress(addr,&ulLineNumber,&pSrcStart,&pSrcEnd,&pFilename)) )
|
if(bShowSrc && bForceDisassembly == FALSE && (pSrc = FindSourceLineForAddress(addr,&ulLineNumber,&pSrcStart,&pSrcEnd,&pFilename)) )
|
||||||
{
|
{
|
||||||
|
DPRINT((2,"\n\n\nFoundSourceLineForAddress: file: %s line: %d\n", pFilename, ulLineNumber));
|
||||||
PICE_strcpy(szCurrentFile,pFilename);
|
PICE_strcpy(szCurrentFile,pFilename);
|
||||||
|
|
||||||
ulCurrentlyDisplayedLineNumber = ulLineNumber;
|
ulCurrentlyDisplayedLineNumber = ulLineNumber;
|
||||||
|
@ -1710,7 +1711,7 @@ COMMAND_PROTOTYPE(Unassemble)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*szCurrentFile = 0;
|
*szCurrentFile = 0;
|
||||||
|
DPRINT((2,"Couldn't find source for file\n"));
|
||||||
Home(SOURCE_WINDOW);
|
Home(SOURCE_WINDOW);
|
||||||
// for each line in the disassembly window
|
// for each line in the disassembly window
|
||||||
for(i=0;i<wWindow[SOURCE_WINDOW].cy;i++)
|
for(i=0;i<wWindow[SOURCE_WINDOW].cy;i++)
|
||||||
|
@ -2006,7 +2007,8 @@ COMMAND_PROTOTYPE(Ver)
|
||||||
system_utsname.release);
|
system_utsname.release);
|
||||||
*/
|
*/
|
||||||
Print(OUTPUT_WINDOW,tempCmd);
|
Print(OUTPUT_WINDOW,tempCmd);
|
||||||
Print(OUTPUT_WINDOW,"pICE: written by Klaus P. Gerlicher and Goran Devic. Ported to Reactos by Eugene Ingerman.\n");
|
Print(OUTPUT_WINDOW,"pICE: written by Klaus P. Gerlicher and Goran Devic.\n");
|
||||||
|
Print(OUTPUT_WINDOW,"pICE: ported to Reactos by Eugene Ingerman.\n");
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,12 +88,13 @@ BOOLEAN PiceKbdIsr (
|
||||||
|
|
||||||
if(isDown)
|
if(isDown)
|
||||||
{
|
{
|
||||||
|
DbgPrint("bControl: %x, ucKey: %x, breakkey: %x\n", bControl, ucKey, AsciiToScan(ucBreakKey));
|
||||||
// CTRL pressed
|
// CTRL pressed
|
||||||
if(ucKey==0x1d)
|
if(ucKey==0x1d)
|
||||||
{
|
{
|
||||||
bControl=TRUE;
|
bControl=TRUE;
|
||||||
}
|
}
|
||||||
else if(bControl==TRUE && ucKey==AsciiToScan(ucBreakKey)) // CTRL-D
|
if(bControl==TRUE && ucKey==AsciiToScan(ucBreakKey)) // CTRL-D
|
||||||
{
|
{
|
||||||
// fake a CTRL-D release call
|
// fake a CTRL-D release call
|
||||||
bForward=FALSE;
|
bForward=FALSE;
|
||||||
|
|
|
@ -216,7 +216,7 @@ ULONG HandlePageFault(FRAME* ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
Print(OUTPUT_WINDOW,"pICE: no virtual memory arena at this address!\n");
|
Print(OUTPUT_WINDOW,"pICE: no virtual memory arena at this address!\n");
|
||||||
return 1;
|
return 0;
|
||||||
|
|
||||||
// let the system handle it
|
// let the system handle it
|
||||||
// return 0;
|
// return 0;
|
||||||
|
|
|
@ -638,7 +638,7 @@ BOOLEAN ScanExportsByAddress(LPSTR *pFind,ULONG ulValue)
|
||||||
(pSym->SectionNumber > 0 ))
|
(pSym->SectionNumber > 0 ))
|
||||||
{
|
{
|
||||||
ULONG ulCurrAddr;
|
ULONG ulCurrAddr;
|
||||||
PIMAGE_SECTION_HEADER pShdrThis = (PIMAGE_SECTION_HEADER)pShdr + pSym->SectionNumber;
|
PIMAGE_SECTION_HEADER pShdrThis = (PIMAGE_SECTION_HEADER)pShdr + (pSym->SectionNumber-1);
|
||||||
|
|
||||||
|
|
||||||
DPRINT((0,"ScanExportsByAddress(): pShdr[%x] = %x\n",pSym->SectionNumber,(ULONG)pShdrThis));
|
DPRINT((0,"ScanExportsByAddress(): pShdr[%x] = %x\n",pSym->SectionNumber,(ULONG)pShdrThis));
|
||||||
|
@ -665,11 +665,11 @@ BOOLEAN ScanExportsByAddress(LPSTR *pFind,ULONG ulValue)
|
||||||
}
|
}
|
||||||
*pFind = temp3;
|
*pFind = temp3;
|
||||||
{
|
{
|
||||||
PIMAGE_SECTION_HEADER pShdrThis = (PIMAGE_SECTION_HEADER)pShdr + pFoundSym->SectionNumber;
|
PIMAGE_SECTION_HEADER pShdrThis = (PIMAGE_SECTION_HEADER)pShdr + (pFoundSym->SectionNumber-1);
|
||||||
//check that ulValue is below the limit for the section where best match is found
|
//check that ulValue is below the limit for the section where best match is found
|
||||||
ASSERT(ulValue < ((ULONG)pdTemp->BaseAddress+pShdrThis->SizeOfRawData));
|
ASSERT(ulValue < ((ULONG)pdTemp->BaseAddress+pShdrThis->SizeOfRawData));
|
||||||
}
|
}
|
||||||
if( !(pFoundSym->N.Name.Short) ){
|
if( pFoundSym->N.Name.Short ){
|
||||||
pName = pFoundSym->N.ShortName; //name is in the header
|
pName = pFoundSym->N.ShortName; //name is in the header
|
||||||
PICE_sprintf(temp3,"%S!%.8s",pdTemp->name,pName); //if name is in the header it may be nonzero terminated
|
PICE_sprintf(temp3,"%S!%.8s",pdTemp->name,pName); //if name is in the header it may be nonzero terminated
|
||||||
}
|
}
|
||||||
|
@ -715,14 +715,14 @@ BOOLEAN ScanExportsByAddress(LPSTR *pFind,ULONG ulValue)
|
||||||
}
|
}
|
||||||
// increment pointer to next line
|
// increment pointer to next line
|
||||||
p = pStartOfLine;
|
p = pStartOfLine;
|
||||||
while(*p!=0 && *p!=0x0a)p++;
|
while(*p!=0 && *p!=0x0a && *p!=0x0d)p++;
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
if(bResult)
|
if(bResult)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
// copy symbol name to temp string
|
// copy symbol name to temp string
|
||||||
for(i=0;pSymbolName[i]!=0 && pSymbolName[i]!=0x0a;i++)
|
for(i=0;pSymbolName[i]!=0 && pSymbolName[i]!=0x0a && pSymbolName[i]!=0x0d;i++)
|
||||||
temp[i] = pSymbolName[i];
|
temp[i] = pSymbolName[i];
|
||||||
temp[i] = 0;
|
temp[i] = 0;
|
||||||
// decide if we need to append an offset
|
// decide if we need to append an offset
|
||||||
|
@ -754,7 +754,7 @@ LPSTR FindFunctionByAddress(ULONG ulValue,PULONG pulstart,PULONG pulend)
|
||||||
LPSTR pName;
|
LPSTR pName;
|
||||||
|
|
||||||
pSymbols = FindModuleSymbols(ulValue);
|
pSymbols = FindModuleSymbols(ulValue);
|
||||||
DPRINT((0,"FindFunctionByAddress(): symbols @ %x\n",(ULONG)pSymbols));
|
DPRINT((0,"FindFunctionByAddress(): symbols for %S @ %x \n",pSymbols->name,(ULONG)pSymbols));
|
||||||
if(pSymbols && pdebug_module_head)
|
if(pSymbols && pdebug_module_head)
|
||||||
{
|
{
|
||||||
DPRINT((0,"looking up symbol\n"));
|
DPRINT((0,"looking up symbol\n"));
|
||||||
|
@ -768,7 +768,7 @@ LPSTR FindFunctionByAddress(ULONG ulValue,PULONG pulstart,PULONG pulend)
|
||||||
start = (ULONG)pdTemp->BaseAddress;
|
start = (ULONG)pdTemp->BaseAddress;
|
||||||
end = start+pdTemp->size;
|
end = start+pdTemp->size;
|
||||||
|
|
||||||
DPRINT((0,"FindFunctionByAddress(): is it %S for %x\n",(ULONG)pdTemp->name,ulValue));
|
DPRINT((0,"FindFunctionByAddress(): ulValue %x\n",ulValue));
|
||||||
|
|
||||||
if(ulValue>=start && ulValue<end)
|
if(ulValue>=start && ulValue<end)
|
||||||
{
|
{
|
||||||
|
@ -793,11 +793,11 @@ LPSTR FindFunctionByAddress(ULONG ulValue,PULONG pulstart,PULONG pulend)
|
||||||
while( pSym < pSymEnd )
|
while( pSym < pSymEnd )
|
||||||
{
|
{
|
||||||
//symbol is a function is it's type is 0x20, storage class is external and section>0
|
//symbol is a function is it's type is 0x20, storage class is external and section>0
|
||||||
if(( (pSym->Type == 0x20) && (pSym->StorageClass==IMAGE_SYM_CLASS_STATIC) &&
|
if(( (pSym->Type == 0x20) && (pSym->StorageClass==IMAGE_SYM_CLASS_EXTERNAL) &&
|
||||||
(pSym->SectionNumber > 0 )))
|
(pSym->SectionNumber > 0 )))
|
||||||
{
|
{
|
||||||
ULONG ulCurrAddr;
|
ULONG ulCurrAddr;
|
||||||
PIMAGE_SECTION_HEADER pShdrThis = (PIMAGE_SECTION_HEADER)pShdr + pSym->SectionNumber;
|
PIMAGE_SECTION_HEADER pShdrThis = (PIMAGE_SECTION_HEADER)pShdr + (pSym->SectionNumber-1);
|
||||||
|
|
||||||
DPRINT((0,"FindFunctionByAddress(): pShdr[%x] = %x\n",pSym->SectionNumber,(ULONG)pShdrThis));
|
DPRINT((0,"FindFunctionByAddress(): pShdr[%x] = %x\n",pSym->SectionNumber,(ULONG)pShdrThis));
|
||||||
|
|
||||||
|
@ -811,17 +811,19 @@ LPSTR FindFunctionByAddress(ULONG ulValue,PULONG pulstart,PULONG pulend)
|
||||||
//the begining of the section
|
//the begining of the section
|
||||||
ulCurrAddr = ((ULONG)pdTemp->BaseAddress+pShdrThis->VirtualAddress+pSym->Value);
|
ulCurrAddr = ((ULONG)pdTemp->BaseAddress+pShdrThis->VirtualAddress+pSym->Value);
|
||||||
DPRINT((0,"FindFunctionByAddress(): CurrAddr [1] = %x\n",ulCurrAddr));
|
DPRINT((0,"FindFunctionByAddress(): CurrAddr [1] = %x\n",ulCurrAddr));
|
||||||
|
DPRINT((0,"%x ", ulCurrAddr));
|
||||||
|
|
||||||
if(ulCurrAddr<=ulValue && ulCurrAddr>start)
|
if(ulCurrAddr<=ulValue && ulCurrAddr>start)
|
||||||
{
|
{
|
||||||
start = ulCurrAddr;
|
start = ulCurrAddr;
|
||||||
pFoundSym = pSym;
|
pFoundSym = pSym;
|
||||||
|
//DPRINT((0,"FindFunctionByAddress(): CANDIDATE for start %x\n",start));
|
||||||
}
|
}
|
||||||
else if(ulCurrAddr>=ulValue && ulCurrAddr<end)
|
else if(ulCurrAddr>=ulValue && ulCurrAddr<end)
|
||||||
{
|
{
|
||||||
end = ulCurrAddr;
|
end = ulCurrAddr;
|
||||||
|
//DPRINT((0,"FindFunctionByAddress(): CANDIDATE for end %x\n",end));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//skip the auxiliary symbols and get the next symbol
|
//skip the auxiliary symbols and get the next symbol
|
||||||
pSym += pSym->NumberOfAuxSymbols + 1;
|
pSym += pSym->NumberOfAuxSymbols + 1;
|
||||||
|
@ -834,7 +836,7 @@ LPSTR FindFunctionByAddress(ULONG ulValue,PULONG pulstart,PULONG pulend)
|
||||||
|
|
||||||
if(pulend){
|
if(pulend){
|
||||||
//just in case there is more than one code section
|
//just in case there is more than one code section
|
||||||
PIMAGE_SECTION_HEADER pShdrThis = (PIMAGE_SECTION_HEADER)pShdr + pFoundSym->SectionNumber;
|
PIMAGE_SECTION_HEADER pShdrThis = (PIMAGE_SECTION_HEADER)pShdr + (pFoundSym->SectionNumber-1);
|
||||||
if( end > (ULONG)pdTemp->BaseAddress+pShdrThis->SizeOfRawData ){
|
if( end > (ULONG)pdTemp->BaseAddress+pShdrThis->SizeOfRawData ){
|
||||||
DPRINT((0,"Hmm: end=%d, end of section: %d\n", end, (ULONG)pdTemp->BaseAddress+pShdrThis->SizeOfRawData));
|
DPRINT((0,"Hmm: end=%d, end of section: %d\n", end, (ULONG)pdTemp->BaseAddress+pShdrThis->SizeOfRawData));
|
||||||
end = (ULONG)pdTemp->BaseAddress+pShdrThis->SizeOfRawData;
|
end = (ULONG)pdTemp->BaseAddress+pShdrThis->SizeOfRawData;
|
||||||
|
@ -842,7 +844,7 @@ LPSTR FindFunctionByAddress(ULONG ulValue,PULONG pulstart,PULONG pulend)
|
||||||
*pulend = end;
|
*pulend = end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !(pFoundSym->N.Name.Short) ){
|
if(pFoundSym->N.Name.Short){
|
||||||
//name is in the header. it's not zero terminated. have to copy.
|
//name is in the header. it's not zero terminated. have to copy.
|
||||||
PICE_sprintf(temp4,"%.8s", pFoundSym->N.ShortName);
|
PICE_sprintf(temp4,"%.8s", pFoundSym->N.ShortName);
|
||||||
pName = temp4;
|
pName = temp4;
|
||||||
|
@ -954,17 +956,17 @@ ULONG FindFunctionInModuleByName(LPSTR szFunctionname, PDEBUG_MODULE pd)
|
||||||
while( pSym < pSymEnd )
|
while( pSym < pSymEnd )
|
||||||
{
|
{
|
||||||
//symbol is a function is it's type is 0x20, storage class is external and section>0
|
//symbol is a function is it's type is 0x20, storage class is external and section>0
|
||||||
if(( (pSym->Type == 0x20) && (pSym->StorageClass==IMAGE_SYM_CLASS_STATIC) &&
|
if(( (pSym->Type == 0x20) && (pSym->StorageClass==IMAGE_SYM_CLASS_EXTERNAL) &&
|
||||||
(pSym->SectionNumber > 0 )))
|
(pSym->SectionNumber > 0 )))
|
||||||
{
|
{
|
||||||
ULONG start;
|
ULONG start;
|
||||||
LPSTR pName;
|
LPSTR pName;
|
||||||
PIMAGE_SECTION_HEADER pShdrThis = (PIMAGE_SECTION_HEADER)pShdr + pSym->SectionNumber;
|
PIMAGE_SECTION_HEADER pShdrThis = (PIMAGE_SECTION_HEADER)pShdr + (pSym->SectionNumber-1);
|
||||||
|
|
||||||
DPRINT((0,"FindFunctionInModuleByName(): %s @ %x\n",pName,start));
|
DPRINT((0,"FindFunctionInModuleByName(): %s @ %x\n",pName,start));
|
||||||
start = ((ULONG)pd->BaseAddress+pShdrThis->VirtualAddress+pSym->Value);
|
start = ((ULONG)pd->BaseAddress+pShdrThis->VirtualAddress+pSym->Value);
|
||||||
|
|
||||||
if( !(pSym->N.Name.Short) ){ //if name is stored in the structure
|
if(pSym->N.Name.Short){ //if name is stored in the structure
|
||||||
//name may be not zero terminated but 8 characters max
|
//name may be not zero terminated but 8 characters max
|
||||||
if((PICE_strncmpi(pName,szFunctionname, 8) == 0) && start)
|
if((PICE_strncmpi(pName,szFunctionname, 8) == 0) && start)
|
||||||
{
|
{
|
||||||
|
@ -1450,6 +1452,8 @@ LPSTR FindSourceLineForAddress(ULONG addr,PULONG pulLineNumber,LPSTR* ppSrcStart
|
||||||
|
|
||||||
// lookup the functions name and start-end (external symbols)
|
// lookup the functions name and start-end (external symbols)
|
||||||
pFunctionName = FindFunctionByAddress(addr,&start,&end);
|
pFunctionName = FindFunctionByAddress(addr,&start,&end);
|
||||||
|
DPRINT((2,"FindSourceLineForAddress: %x\n", pFunctionName));
|
||||||
|
|
||||||
if(pFunctionName)
|
if(pFunctionName)
|
||||||
{
|
{
|
||||||
// lookup the modules symbol table (STABS)
|
// lookup the modules symbol table (STABS)
|
||||||
|
@ -1767,7 +1771,7 @@ ULONG ListSymbolStartingAt(PDEBUG_MODULE pMod,PICE_SYMBOLFILE_HEADER* pSymbols,U
|
||||||
((pSym->StorageClass == IMAGE_SYM_CLASS_EXTERNAL) || (pSym->StorageClass==IMAGE_SYM_CLASS_STATIC)) &&
|
((pSym->StorageClass == IMAGE_SYM_CLASS_EXTERNAL) || (pSym->StorageClass==IMAGE_SYM_CLASS_STATIC)) &&
|
||||||
(pSym->SectionNumber > 0 ))
|
(pSym->SectionNumber > 0 ))
|
||||||
{
|
{
|
||||||
PIMAGE_SECTION_HEADER pShdrThis = (PIMAGE_SECTION_HEADER)pShdr + pSym->SectionNumber;
|
PIMAGE_SECTION_HEADER pShdrThis = (PIMAGE_SECTION_HEADER)pShdr + (pSym->SectionNumber-1);
|
||||||
ULONG section_flags;
|
ULONG section_flags;
|
||||||
ULONG start;
|
ULONG start;
|
||||||
|
|
||||||
|
@ -1784,7 +1788,7 @@ ULONG ListSymbolStartingAt(PDEBUG_MODULE pMod,PICE_SYMBOLFILE_HEADER* pSymbols,U
|
||||||
//the begining of the section
|
//the begining of the section
|
||||||
|
|
||||||
start = ((ULONG)pMod->BaseAddress+pShdrThis->VirtualAddress+pSym->Value);
|
start = ((ULONG)pMod->BaseAddress+pShdrThis->VirtualAddress+pSym->Value);
|
||||||
if( !(pSym->N.Name.Short) ){
|
if(pSym->N.Name.Short){
|
||||||
//name is in the header. it's not zero terminated. have to copy.
|
//name is in the header. it's not zero terminated. have to copy.
|
||||||
PICE_sprintf(pOutput,"%.8X (%s) %.8s\n",start,(section_flags&IMAGE_SCN_CNT_CODE)?"TEXT":"DATA",pSym->N.ShortName);
|
PICE_sprintf(pOutput,"%.8X (%s) %.8s\n",start,(section_flags&IMAGE_SCN_CNT_CODE)?"TEXT":"DATA",pSym->N.ShortName);
|
||||||
}
|
}
|
||||||
|
@ -1946,19 +1950,21 @@ PICE_SYMBOLFILE_HEADER* LoadSymbols(LPSTR filename)
|
||||||
{
|
{
|
||||||
HANDLE hf;
|
HANDLE hf;
|
||||||
PICE_SYMBOLFILE_HEADER* pSymbols=NULL;
|
PICE_SYMBOLFILE_HEADER* pSymbols=NULL;
|
||||||
WCHAR tempstr[DEBUG_MODULE_NAME_LEN];
|
WCHAR tempstr[256];
|
||||||
|
int conv;
|
||||||
ENTER_FUNC();
|
ENTER_FUNC();
|
||||||
|
|
||||||
if( !PICE_MultiByteToWideChar(CP_ACP, NULL, filename, -1, tempstr, DEBUG_MODULE_NAME_LEN ) )
|
if( !( conv = PICE_MultiByteToWideChar(CP_ACP, NULL, filename, -1, tempstr, 256 ) ) )
|
||||||
{
|
{
|
||||||
DPRINT((0,"Can't convert module name.\n"));
|
DPRINT((0,"Can't convert module name.\n"));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
DPRINT((0,"LoadSymbols: test %S, %s, tempstr %S, conv: %d\n",L"testing", filename, tempstr, conv));
|
||||||
|
|
||||||
if(ulNumSymbolsLoaded<DIM(apSymbols))
|
if(ulNumSymbolsLoaded<DIM(apSymbols))
|
||||||
{
|
{
|
||||||
hf = PICE_open(tempstr,OF_READ);
|
hf = PICE_open(tempstr,OF_READ);
|
||||||
|
DPRINT((0,"LoadSymbols: hf: %x, file: %S\n",hf, tempstr));
|
||||||
if(hf)
|
if(hf)
|
||||||
{
|
{
|
||||||
//mm_segment_t oldfs;
|
//mm_segment_t oldfs;
|
||||||
|
@ -2172,6 +2178,7 @@ BOOLEAN LoadSymbolsFromConfig(BOOLEAN bIgnoreBootParams)
|
||||||
{
|
{
|
||||||
DPRINT((0,"Load symbols from file %s\n", temp));
|
DPRINT((0,"Load symbols from file %s\n", temp));
|
||||||
pSymbols = LoadSymbols(temp);
|
pSymbols = LoadSymbols(temp);
|
||||||
|
DbgPrint("Load symbols from file %s, pSymbols: %x\n", temp, pSymbols);
|
||||||
if(pSymbols)
|
if(pSymbols)
|
||||||
{
|
{
|
||||||
PICE_SYMBOLFILE_SOURCE* pSrc;
|
PICE_SYMBOLFILE_SOURCE* pSrc;
|
||||||
|
|
|
@ -1686,6 +1686,7 @@ int PICE_vsprintf(char *buf, const char *fmt, va_list args)
|
||||||
int i, base;
|
int i, base;
|
||||||
char * str;
|
char * str;
|
||||||
const char *s;
|
const char *s;
|
||||||
|
const wchar_t *sw;
|
||||||
|
|
||||||
int flags; /* flags to PICE_number() */
|
int flags; /* flags to PICE_number() */
|
||||||
|
|
||||||
|
@ -1777,6 +1778,44 @@ int PICE_vsprintf(char *buf, const char *fmt, va_list args)
|
||||||
*str++ = ' ';
|
*str++ = ' ';
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
case 'S':
|
||||||
|
if (qualifier == 'h') {
|
||||||
|
/* print ascii string */
|
||||||
|
s = va_arg(args, char *);
|
||||||
|
if (s == NULL)
|
||||||
|
s = "<NULL>";
|
||||||
|
|
||||||
|
len = PICE_strlen (s);
|
||||||
|
if ((unsigned int)len > (unsigned int)precision)
|
||||||
|
len = precision;
|
||||||
|
|
||||||
|
if (!(flags & NUM_LEFT))
|
||||||
|
while (len < field_width--)
|
||||||
|
*str++ = ' ';
|
||||||
|
for (i = 0; i < len; ++i)
|
||||||
|
*str++ = *s++;
|
||||||
|
while (len < field_width--)
|
||||||
|
*str++ = ' ';
|
||||||
|
} else {
|
||||||
|
/* print unicode string */
|
||||||
|
sw = va_arg(args, wchar_t *);
|
||||||
|
if (sw == NULL)
|
||||||
|
sw = L"<NULL>";
|
||||||
|
|
||||||
|
len = wcslen (sw);
|
||||||
|
if ((unsigned int)len > (unsigned int)precision)
|
||||||
|
len = precision;
|
||||||
|
|
||||||
|
if (!(flags & NUM_LEFT))
|
||||||
|
while (len < field_width--)
|
||||||
|
*str++ = ' ';
|
||||||
|
for (i = 0; i < len; ++i)
|
||||||
|
*str++ = (unsigned char)(*sw++);
|
||||||
|
while (len < field_width--)
|
||||||
|
*str++ = ' ';
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
|
||||||
case 'p':
|
case 'p':
|
||||||
if (field_width == -1) {
|
if (field_width == -1) {
|
||||||
field_width = 2*sizeof(void *);
|
field_width = 2*sizeof(void *);
|
||||||
|
@ -2102,6 +2141,9 @@ HANDLE PICE_open (LPCWSTR lpPathName, int iReadWrite)
|
||||||
HANDLE hfile;
|
HANDLE hfile;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
|
|
||||||
|
|
||||||
|
DPRINT((0,"PICE_open: %S\n", lpPathName));
|
||||||
|
|
||||||
if ( (iReadWrite & OF_READWRITE ) == OF_READWRITE )
|
if ( (iReadWrite & OF_READWRITE ) == OF_READWRITE )
|
||||||
dwAccessMask = GENERIC_READ | GENERIC_WRITE;
|
dwAccessMask = GENERIC_READ | GENERIC_WRITE;
|
||||||
else if ( (iReadWrite & OF_READ ) == OF_READ )
|
else if ( (iReadWrite & OF_READ ) == OF_READ )
|
||||||
|
@ -2127,13 +2169,11 @@ HANDLE PICE_open (LPCWSTR lpPathName, int iReadWrite)
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
|
||||||
status = NtOpenFile( &hfile,
|
status = NtOpenFile( &hfile,
|
||||||
dwAccessMask,
|
dwAccessMask,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
NULL, dwShareMode, 0);
|
NULL, dwShareMode, 0);
|
||||||
//BUG BUG check status!!!
|
//BUG BUG check status!!!
|
||||||
DbgPrint("PICE_open: handle: %x, status: %x", hfile, status);
|
|
||||||
if( !NT_SUCCESS( status ) ){
|
if( !NT_SUCCESS( status ) ){
|
||||||
DPRINT((0,"PICE_open: NtOpenFile error: %x\n", status));
|
DPRINT((0,"PICE_open: NtOpenFile error: %x\n", status));
|
||||||
}
|
}
|
||||||
|
@ -2157,6 +2197,9 @@ size_t PICE_len( HANDLE hFile )
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
|
|
||||||
status = ZwQueryInformationFile( hFile, &iosb, &fs, sizeof fs, FileStandardInformation );
|
status = ZwQueryInformationFile( hFile, &iosb, &fs, sizeof fs, FileStandardInformation );
|
||||||
|
if( !NT_SUCCESS( status ) ){
|
||||||
|
DPRINT((0,"PICE_len: ZwQueryInformationFile error: %x\n", status));
|
||||||
|
}
|
||||||
ASSERT(fs.EndOfFile.u.HighPart == 0);
|
ASSERT(fs.EndOfFile.u.HighPart == 0);
|
||||||
return (size_t)fs.EndOfFile.u.LowPart;
|
return (size_t)fs.EndOfFile.u.LowPart;
|
||||||
}
|
}
|
||||||
|
@ -2194,12 +2237,12 @@ PICE_MultiByteToWideChar (
|
||||||
&& (CP_MACCP != CodePage)
|
&& (CP_MACCP != CodePage)
|
||||||
&& (CP_OEMCP != CodePage))
|
&& (CP_OEMCP != CodePage))
|
||||||
/* --- FLAGS --- */
|
/* --- FLAGS --- */
|
||||||
|| (dwFlags ^ ( MB_PRECOMPOSED
|
/*|| (dwFlags ^ ( MB_PRECOMPOSED
|
||||||
| MB_COMPOSITE
|
| MB_COMPOSITE
|
||||||
| MB_ERR_INVALID_CHARS
|
| MB_ERR_INVALID_CHARS
|
||||||
| MB_USEGLYPHCHARS
|
| MB_USEGLYPHCHARS
|
||||||
)
|
)
|
||||||
)
|
)*/
|
||||||
/* --- INPUT BUFFER --- */
|
/* --- INPUT BUFFER --- */
|
||||||
|| (NULL == lpMultiByteStr)
|
|| (NULL == lpMultiByteStr)
|
||||||
)
|
)
|
||||||
|
@ -2234,7 +2277,7 @@ PICE_MultiByteToWideChar (
|
||||||
*/
|
*/
|
||||||
if (cchWideChar < InStringLength)
|
if (cchWideChar < InStringLength)
|
||||||
{
|
{
|
||||||
DPRINT((0,"ERROR_INSUFFICIENT_BUFFER\n"));
|
DPRINT((0,"ERROR_INSUFFICIENT_BUFFER: cchWideChar: %d, InStringLength: %d\n", cchWideChar, InStringLength));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -2246,7 +2289,7 @@ PICE_MultiByteToWideChar (
|
||||||
|
|
||||||
((*r) && (cchConverted < cchWideChar));
|
((*r) && (cchConverted < cchWideChar));
|
||||||
|
|
||||||
r++,
|
r++, w++,
|
||||||
cchConverted++
|
cchConverted++
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
|
@ -52,6 +52,7 @@ Copyright notice:
|
||||||
// GLOBALS
|
// GLOBALS
|
||||||
////
|
////
|
||||||
// used for HERCUELS text and VGA text mode
|
// used for HERCUELS text and VGA text mode
|
||||||
|
/*
|
||||||
WINDOW wWindowVga[4]=
|
WINDOW wWindowVga[4]=
|
||||||
{
|
{
|
||||||
{1,3,1,0,FALSE},
|
{1,3,1,0,FALSE},
|
||||||
|
@ -59,6 +60,15 @@ WINDOW wWindowVga[4]=
|
||||||
{10,9,1,0,FALSE},
|
{10,9,1,0,FALSE},
|
||||||
{20,4,1,0,FALSE}
|
{20,4,1,0,FALSE}
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
|
WINDOW wWindowVga[4]=
|
||||||
|
{
|
||||||
|
{1,3,1,0,FALSE},
|
||||||
|
{5,7,1,0,FALSE},
|
||||||
|
{14,15,1,0,FALSE},
|
||||||
|
{30,14,1,0,FALSE}
|
||||||
|
};
|
||||||
|
|
||||||
// 25 line text mode
|
// 25 line text mode
|
||||||
UCHAR MGATable25[]={97,80,82,15,25, 6,25,25, 2,13,11,12, 0, 0, 0, 0};
|
UCHAR MGATable25[]={97,80,82,15,25, 6,25,25, 2,13,11,12, 0, 0, 0, 0};
|
||||||
|
@ -389,7 +399,7 @@ BOOLEAN ConsoleInitVga(void)
|
||||||
SetWindowGeometry(wWindowVga);
|
SetWindowGeometry(wWindowVga);
|
||||||
|
|
||||||
GLOBAL_SCREEN_WIDTH = 80;
|
GLOBAL_SCREEN_WIDTH = 80;
|
||||||
GLOBAL_SCREEN_HEIGHT = 25;
|
GLOBAL_SCREEN_HEIGHT = 45;
|
||||||
|
|
||||||
attr.u.Asuchar = 0x07;
|
attr.u.Asuchar = 0x07;
|
||||||
|
|
||||||
|
|
42
reactos/apps/utils/pice/readme.txt
Normal file
42
reactos/apps/utils/pice/readme.txt
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
This is some preliminary information on using PICE. I am planning to write
|
||||||
|
a detailed manual later.
|
||||||
|
|
||||||
|
BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA
|
||||||
|
|
||||||
|
PICE for Reactos is in early beta stage of development. It still has many bugs.
|
||||||
|
|
||||||
|
BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA-BETA
|
||||||
|
|
||||||
|
|
||||||
|
PICE is a kernel debugger that was ported for Reactos (the original Linux
|
||||||
|
project by Klaus P. Gerlicher and Goran Devic may be found here:
|
||||||
|
http://pice.sourceforge.net).
|
||||||
|
|
||||||
|
Installation and use:
|
||||||
|
|
||||||
|
1. PICE is loaded like a regular device driver. The only limitation - it must
|
||||||
|
be loaded before keyboard.sys driver. You should add:
|
||||||
|
|
||||||
|
LdrLoadAutoConfigDriver( L"pice.sys" );
|
||||||
|
|
||||||
|
in ntoskrnl/ldr/loader.c after the line loading keyboard driver.
|
||||||
|
|
||||||
|
2. You should copy pice.cfg and ntoskrnl.sym to \SystemRoot\symbols directory
|
||||||
|
of Reactos.
|
||||||
|
|
||||||
|
3. If you want to add symbolic information you should use loader.exe to
|
||||||
|
create .dbg file from the unstrippped version of exe or driver:
|
||||||
|
For example:
|
||||||
|
pice\loader\loader.exe -t ntoskrnl.nostrip.exe
|
||||||
|
|
||||||
|
After that copy .dbg file to \SystemRoot\symbols and add a line to pice.cfg:
|
||||||
|
\\SystemRoot\symbols\ntoskrnl.dbg.
|
||||||
|
|
||||||
|
Pice will load the symbols during boot. For large .dbg files it may take a
|
||||||
|
while (ntoskrnl.dbg is ~3Mb). You may find that loading time under bochs is
|
||||||
|
quite slow, although otherwise performance should be fine.
|
||||||
|
|
||||||
|
Enjoy,
|
||||||
|
Eugene
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue