From b2451d20d93dc531afccaa3fea643138e5093955 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Wed, 23 May 2007 10:29:23 +0000 Subject: [PATCH] 2007-05-23 12:27 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/vm/debug.c ! fixed access/assign local variables from debugger in functions with variable number of parameters --- harbour/ChangeLog | 5 +++++ harbour/source/vm/debug.c | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3489cf6485..0720d4439f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,11 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2007-05-23 12:27 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/vm/debug.c + ! fixed access/assign local variables from debugger in functions + with variable number of parameters + 2007-05-23 11:55 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/Makefile + added hbapidbg.h diff --git a/harbour/source/vm/debug.c b/harbour/source/vm/debug.c index 8cd96b5760..e91bc2913f 100644 --- a/harbour/source/vm/debug.c +++ b/harbour/source/vm/debug.c @@ -202,7 +202,15 @@ HB_EXPORT PHB_ITEM hb_dbg_vmVarLGet( int iLevel, int iLocal ) } if( iLocal >= 0 ) + { + PHB_ITEM pBase = hb_stackItem( lBaseOffset - 1 ); + + if( pBase->item.asSymbol.paramcnt > pBase->item.asSymbol.paramdeclcnt && + iLocal > pBase->item.asSymbol.paramdeclcnt ) + iLocal += pBase->item.asSymbol.paramcnt - pBase->item.asSymbol.paramdeclcnt; + pLocal = hb_stackItem( lBaseOffset + iLocal ); + } else pLocal = hb_codeblockGetRef( hb_stackItem( lBaseOffset )->item.asBlock.value, iLocal ); @@ -245,7 +253,15 @@ HB_FUNC( HB_DBG_VMVARLSET ) } if( iLocal >= 0 ) + { + PHB_ITEM pBase = hb_stackItem( lBaseOffset - 1 ); + + if( pBase->item.asSymbol.paramcnt > pBase->item.asSymbol.paramdeclcnt && + iLocal > pBase->item.asSymbol.paramdeclcnt ) + iLocal += pBase->item.asSymbol.paramcnt - pBase->item.asSymbol.paramdeclcnt; + pLocal = hb_stackItem( lBaseOffset + iLocal ); + } else pLocal = hb_codeblockGetRef( hb_stackItem( lBaseOffset )->item.asBlock.value, iLocal );