2013-07-04 05:33 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* src/debug/dbgentry.c
    + added new PRG functions:
         __dbgIsBreak( <pDbg>, <cModule>, <nLine> ) -> <nPos>
         __dbgGetBreakPoints( <pDbg> ) -> <aBreakPoints>

  * src/debug/debugger.prg
    - removed old and long time unused PRG function __dbgAltDEntry()

  * src/rtl/hbproces.c
    * changed returned status when execvp() fails, -1 should give
      maximal exit code on given platform (i.e. 255)
This commit is contained in:
Przemysław Czerpak
2013-07-04 05:33:22 +02:00
parent ab3f6109c1
commit ebcbbfd518
4 changed files with 41 additions and 22 deletions

View File

@@ -10,6 +10,19 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2013-07-04 05:33 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/debug/dbgentry.c
+ added new PRG functions:
__dbgIsBreak( <pDbg>, <cModule>, <nLine> ) -> <nPos>
__dbgGetBreakPoints( <pDbg> ) -> <aBreakPoints>
* src/debug/debugger.prg
- removed old and long time unused PRG function __dbgAltDEntry()
* src/rtl/hbproces.c
* changed returned status when execvp() fails, -1 should give
maximal exit code on given platform (i.e. 255)
2013-07-03 12:14 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbapidbg.h
* src/debug/dbgentry.c

View File

@@ -198,7 +198,7 @@ static PHB_ITEM hb_dbgEvalMacro( const char * szExpr, PHB_ITEM pItem );
static PHB_ITEM hb_dbgEvalMakeBlock( HB_WATCHPOINT * watch );
static PHB_ITEM hb_dbgEvalResolve( HB_DEBUGINFO * info, HB_WATCHPOINT * watch );
static HB_BOOL hb_dbgIsAltD( void );
static HB_BOOL hb_dbgIsBreakPoint( HB_DEBUGINFO * info, const char * szModule, int nLine );
static int hb_dbgIsBreakPoint( HB_DEBUGINFO * info, const char * szModule, int nLine );
static HB_BOOL hb_dbgEqual( PHB_ITEM pItem1, PHB_ITEM pItem2 );
static void hb_dbgQuit( HB_DEBUGINFO * info );
static void hb_dbgRelease( void );
@@ -468,9 +468,9 @@ void hb_dbgEntry( int nMode, int nLine, const char * szName, int nIndex, PHB_ITE
}
hb_clsSetScope( bOldClsScope );
if( hb_dbgIsBreakPoint( info, pTop->szModule, nLine )
|| hb_dbg_InvokeDebug( HB_FALSE )
|| ( info->pFunInvoke && info->pFunInvoke() ) )
if( hb_dbgIsBreakPoint( info, pTop->szModule, nLine ) >= 0 ||
hb_dbg_InvokeDebug( HB_FALSE ) ||
( info->pFunInvoke && info->pFunInvoke() ) )
{
info->bTraceOver = HB_FALSE;
if( info->bToCursor )
@@ -1376,7 +1376,7 @@ static HB_BOOL hb_dbgIsAltD( void )
}
static HB_BOOL hb_dbgIsBreakPoint( HB_DEBUGINFO * info, const char * szModule, int nLine )
static int hb_dbgIsBreakPoint( HB_DEBUGINFO * info, const char * szModule, int nLine )
{
int i;
@@ -1386,11 +1386,10 @@ static HB_BOOL hb_dbgIsBreakPoint( HB_DEBUGINFO * info, const char * szModule, i
{
HB_BREAKPOINT * point = &info->aBreak[ i ];
if( point->nLine == nLine
&& FILENAME_EQUAL( szModule, point->szModule ) )
return HB_TRUE;
if( point->nLine == nLine && FILENAME_EQUAL( szModule, point->szModule ) )
return i;
}
return HB_FALSE;
return -1;
}
@@ -1762,6 +1761,24 @@ HB_FUNC( __DBGDELBREAK )
hb_dbgDelBreak( ptr, hb_parni( 2 ) );
}
HB_FUNC( __DBGISBREAK )
{
void * ptr = hb_parptr( 1 );
if( ptr )
hb_retni( hb_dbgIsBreakPoint( ptr,
hb_dbgStripModuleName( hb_parc( 2 ) ),
hb_parni( 3 ) ) );
}
HB_FUNC( __DBGGETBREAKPOINTS )
{
void * ptr = hb_parptr( 1 );
if( ptr )
hb_itemReturnRelease( hb_dbgActivateBreakArray( ( HB_DEBUGINFO * ) ptr ) );
}
HB_FUNC( __DBGADDWATCH )
{
void * ptr = hb_parptr( 1 );

View File

@@ -115,17 +115,6 @@
THREAD STATIC t_oDebugger
PROCEDURE __dbgAltDEntry()
/* do not activate the debugger imediatelly because the module
where AltD() was called can have no debugger info - stop
on first LINE with debugged info
*/
__dbgInvokeDebug( Set( _SET_DEBUG ) )
RETURN
/* debugger entry point */
PROCEDURE __dbgEntry( nMode, uParam1, uParam2, uParam3, uParam4, uParam5 )

View File

@@ -324,7 +324,7 @@ static int hb_fsProcessExec( const char * pszFilename,
/* execute command */
execvp( argv[ 0 ], argv );
exit(1);
exit( -1 );
}
else if( pid != -1 )
{
@@ -572,7 +572,7 @@ HB_FHANDLE hb_fsProcessOpen( const char * pszFilename,
execvp( argv[ 0 ], argv );
# endif
hb_freeArgs( argv );
exit( 1 );
exit( -1 );
}
}