2008-08-05 23:47 UTC+0200 Viktor Szakats (harbour.01 syenar hu)

* source/rtl/errorint.c
   * source/vm/estack.c
   * source/vm/hvm.c
   * source/vm/extrap.c
     + Added filename to stack traces. Someone please review me.
       Also, pls test if it compiles cleanly with OS/2.
This commit is contained in:
Viktor Szakats
2008-08-05 21:47:58 +00:00
parent 65b73581a8
commit ecbbead164
5 changed files with 23 additions and 10 deletions

View File

@@ -8,6 +8,14 @@
2008-12-31 13:59 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2008-08-05 23:47 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* source/rtl/errorint.c
* source/vm/estack.c
* source/vm/hvm.c
* source/vm/extrap.c
+ Added filename to stack traces. Someone please review me.
Also, pls test if it compiles cleanly with OS/2.
2008-08-05 21:39 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* source/hbpcre/_hbconf.h
* source/hbzlib/zconf.h

View File

@@ -62,6 +62,7 @@
void hb_errInternal( ULONG ulIntCode, const char * szText, const char * szPar1, const char * szPar2 )
{
char buffer[ 1024 ];
char file[ _POSIX_PATH_MAX + 1 ];
USHORT uiLine;
int iLevel;
FILE * hLog;
@@ -117,11 +118,11 @@ void hb_errInternal( ULONG ulIntCode, const char * szText, const char * szPar1,
fprintf( hLog, "%s\n", buffer );
iLevel = 0;
while( hb_procinfo( iLevel++, buffer, &uiLine, NULL ) )
while( hb_procinfo( iLevel++, buffer, &uiLine, file ) )
{
char msg[ HB_SYMBOL_NAME_LEN + HB_SYMBOL_NAME_LEN + 32 ];
snprintf( msg, sizeof( msg ), HB_I_("Called from %s(%hu)\n"), buffer, uiLine );
snprintf( msg, sizeof( msg ), HB_I_("Called from %s(%hu)%s%s\n"), buffer, uiLine, *file ? HB_I_(" in ") : "", file );
hb_conOutErr( msg, 0 );
if( hLog )

View File

@@ -588,6 +588,7 @@ void hb_stackDispLocal( void )
void hb_stackDispCall( void )
{
char buffer[ HB_SYMBOL_NAME_LEN + HB_SYMBOL_NAME_LEN + 5 + 10 ]; /* additional 10 bytes for line info (%hu) overhead */
char file[ _POSIX_PATH_MAX + 1 ];
USHORT uiLine;
int iLevel;
@@ -595,10 +596,10 @@ void hb_stackDispCall( void )
iLevel = 0;
while( hb_procinfo( iLevel++, buffer, &uiLine, NULL ) )
while( hb_procinfo( iLevel++, buffer, &uiLine, file ) )
{
int l = strlen( buffer );
snprintf( buffer + l, sizeof( buffer ) - l, "(%hu)", uiLine );
snprintf( buffer + l, sizeof( buffer ) - l, "(%hu)%s%s", uiLine, *file ? HB_I_(" in ") : "", file );
hb_conOutErr( "Called from ", 0 );
hb_conOutErr( buffer, 0 );

View File

@@ -76,6 +76,7 @@ LONG WINAPI hb_win32ExceptionHandler( struct _EXCEPTION_POINTERS * pExceptionInf
{
char msg[ ( HB_SYMBOL_NAME_LEN + HB_SYMBOL_NAME_LEN + 32 ) * 32 ];
char buffer[ HB_SYMBOL_NAME_LEN + HB_SYMBOL_NAME_LEN + 5 ];
char file[ _POSIX_PATH_MAX + 1 ];
char * ptr;
USHORT uiLine;
int iLevel;
@@ -189,10 +190,10 @@ LONG WINAPI hb_win32ExceptionHandler( struct _EXCEPTION_POINTERS * pExceptionInf
ptr = msg;
iLevel = 0;
while( hb_procinfo( iLevel++, buffer, &uiLine, NULL ) )
while( hb_procinfo( iLevel++, buffer, &uiLine, file ) )
{
snprintf( ptr, sizeof( msg ) - ( ptr - msg ),
HB_I_("Called from %s(%hu)\n"), buffer, uiLine );
HB_I_("Called from %s(%hu)%s%s\n"), buffer, uiLine, *file ? HB_I_(" in ") : "", file );
if( hLog )
fwrite( ptr, sizeof( *ptr ), strlen( ptr ), hLog );
@@ -235,13 +236,14 @@ ULONG _System hb_os2ExceptionHandler( PEXCEPTIONREPORTRECORD p1,
if( p1->ExceptionNum != XCPT_UNWIND && p1->ExceptionNum < XCPT_BREAKPOINT )
{
char buffer[ HB_SYMBOL_NAME_LEN + HB_SYMBOL_NAME_LEN + 5 ];
char file[ _POSIX_PATH_MAX + 1 ];
USHORT uiLine;
int iLevel = 0;
fprintf( stderr, HB_I_("\nException %lx at address %p \n"), p1->ExceptionNum, p1->ExceptionAddress );
while( hb_procinfo( iLevel++, buffer, &uiLine, NULL ) )
fprintf( stderr, HB_I_("Called from %s(%hu)\n"), buffer, uiLine );
while( hb_procinfo( iLevel++, buffer, &uiLine, file ) )
fprintf( stderr, HB_I_("Called from %s(%hu)%s%s\n"), buffer, uiLine, *file ? HB_I_(" in ") : "", file );
}
return XCPT_CONTINUE_SEARCH; /* Exception not resolved... */

View File

@@ -7122,16 +7122,17 @@ void hb_vmRequestCancel( void )
if( hb_set.HB_SET_CANCEL )
{
char buffer[ HB_SYMBOL_NAME_LEN + HB_SYMBOL_NAME_LEN + 5 + 10 ]; /* additional 10 bytes for line info (%hu) overhead */
char file[ _POSIX_PATH_MAX + 1 ];
USHORT uiLine;
int iLevel = 0, l;
hb_conOutErr( hb_conNewLine(), 0 );
hb_conOutErr( "Cancelled at: ", 0 );
while( hb_procinfo( iLevel++, buffer, &uiLine, NULL ) )
while( hb_procinfo( iLevel++, buffer, &uiLine, file ) )
{
l = strlen( buffer );
snprintf( buffer + l, sizeof( buffer ) - l, " (%hu)", uiLine );
snprintf( buffer + l, sizeof( buffer ) - l, " (%hu)%s%s", uiLine, *file ? HB_I_(" in ") : "", file );
hb_conOutErr( buffer, 0 );
hb_conOutErr( hb_conNewLine(), 0 );