Alaska Software Inc. - XppDbg.exe add 1 extra param on the command line of the debuged exe
Username: Password:
AuthorTopic: XppDbg.exe add 1 extra param on the command line of the debuged exe
Pablo BotellaXppDbg.exe add 1 extra param on the command line of the debuged exe
on Sun, 09 Jan 2011 01:33:18 +0100
Hi,

A customer was point me to an behavior in XppDbg.exe that I think is a bug or at least an undesired behavior.

Test Program:
proc main
local nParams := PCount()
local n
? "PCount() -> " , PCount()
for n := 1 to nParams
   ? "Param " + AllTrim(Str(n)) + ": " ,  PValue(n)
next
inkey(0)
return
------------------
Compiled with debug=Yes

When executed directly from the command line 
test.exe 1 2 3
the CRT show this:
PCount() ->           3  
Param 1:  1              
Param 2:  2              
Param 3:  3              

But when debuging 
XppDbg.exe test.exe 1 2 3
the CRT show this instead:
PCount() ->           4  
Param 1:  test.exe
Param 2:  1
Param 3:  2              
Param 4:  3   

Regards,
Pablo Botella
Carlos a Beling Re: XppDbg.exe add 1 extra param on the command line of the debuged exe
on Mon, 10 Jan 2011 09:37:10 -0200
Hello Pablo:
good morning.
Xppdbg has an extra parameter before the program name to be executed. 
Please type in the cmd line:  Xbbdbg /?.
Would it be it the problem?

Belin
HTH

Em 8/1/2011 22:33, Pablo Botella escreveu:
> Hi,
>
> A customer was point me to an behavior in XppDbg.exe that I think is a bug or at least an undesired behavior.
>
> Test Program:
> proc main
> local nParams := PCount()
> local n
> ? "PCount() ->  " , PCount()
> for n := 1 to nParams
>     ? "Param " + AllTrim(Str(n)) + ": " ,  PValue(n)
> next
> inkey(0)
> return
> ------------------
> Compiled with debug=Yes
>
> When executed directly from the command line
> test.exe 1 2 3
> the CRT show this:
> PCount() ->            3
> Param 1:  1
> Param 2:  2
> Param 3:  3
>
> But when debuging
> XppDbg.exe test.exe 1 2 3
> the CRT show this instead:
> PCount() ->            4
> Param 1:  test.exe
> Param 2:  1
> Param 3:  2
> Param 4:  3
>
> Regards,
> Pablo Botella
>
>
Pablo BotellaRe: XppDbg.exe add 1 extra param on the command line of the debuged exe
on Mon, 10 Jan 2011 20:07:41 +0100
Hi,

> Xppdbg has an extra parameter before the program name to be executed. 
> Please type in the cmd line:  Xbbdbg /?.
> Would it be it the problem?

No the trouble is that when the debuger launch the "debuged" program insert the exe name as the first param
take this simple program

proc main( cIni )
? cIni
inkey(0)
return

if you type this on the command prompt
myprogram.exe  config.ini
you will see :  config.ini
if you type this on the command prompt
xppdbg myprogram.exe  config.ini
you will see :  myprogram.exe

so the trouble is that xppdbg start the debuged program with this command line
myprogram.exe myprogram.exe  config.ini
instead of
myprogram.exe  config.ini

Of course the workarround is simple
local cIni :=  iif( IsDebug() , PValue(2) , PValue(1) )
but I think the current behavior is abnormal

Regards,

Pablo Botella
Peter AlderliestenRe: XppDbg.exe add 1 extra param on the command line of the debuged exe
on Tue, 11 Jan 2011 10:08:27 +0100
Pablo,

I had the same problem, but as far as I know it is fixed with a hotfix.
In my installation it is working correct again.

Peter

> Hi,
> 
>> Xppdbg has an extra parameter before the program name to be executed. 
>> Please type in the cmd line:  Xbbdbg /?.
>> Would it be it the problem?
> 
> No the trouble is that when the debuger launch the "debuged" program insert the exe name as the first param
> take this simple program
> 
> proc main( cIni )
> ? cIni
> inkey(0)
> return
> 
> if you type this on the command prompt
> myprogram.exe  config.ini
> you will see :  config.ini
> if you type this on the command prompt
> xppdbg myprogram.exe  config.ini
> you will see :  myprogram.exe
> 
> so the trouble is that xppdbg start the debuged program with this command line
> myprogram.exe myprogram.exe  config.ini
> instead of
> myprogram.exe  config.ini
> 
> Of course the workarround is simple
> local cIni :=  iif( IsDebug() , PValue(2) , PValue(1) )
> but I think the current behavior is abnormal
> 
> Regards,
> 
> Pablo Botella
Peter AlderliestenRe: XppDbg.exe add 1 extra param on the command line of the debuged exe
on Tue, 11 Jan 2011 10:37:48 +0100
Pablo,
 
> I had the same problem, but as far as I know it is fixed with a hotfix.

It's HotFix 36 (a Windows 7 related problem).
 
Peter
Pablo BotellaRe: XppDbg.exe add 1 extra param on the command line of the debuged exe
on Tue, 11 Jan 2011 14:13:32 +0100
<Peter Alderliesten> escribió en el mensaje news:1tmj9k4dsoo5v$.1jau932wvhvme.dlg@40tude.net...
> Pablo,
> 
>> I had the same problem, but as far as I know it is fixed with a hotfix.
> 
> It's HotFix 36 (a Windows 7 related problem).

Thanks, will try
Jorge LRe: XppDbg.exe add 1 extra param on the command line of the debuged exe
on Tue, 11 Jan 2011 03:42:04 -0300
Hola
Ya había visto ese "inconveniente" de casualidad por haber escrito mal
y lo veras si escribes : xppdbg noexiste.exe 9 Pasa 1


y me hizo recordar que en dos el parámetro 0 era la misma aplicación



"Pablo Botella"  escribió en el mensaje de 
noticias:97ccb53$1c30cf6a$7f041@news.alaska-software.com...

Hi,

A customer was point me to an behavior in XppDbg.exe that I think is a bug 
or at least an undesired behavior.

Test Program:
proc main
local nParams := PCount()
local n
? "PCount() -> " , PCount()
for n := 1 to nParams
   ? "Param " + AllTrim(Str(n)) + ": " ,  PValue(n)
next
inkey(0)
return
------------------
Compiled with debug=Yes

When executed directly from the command line
test.exe 1 2 3
the CRT show this:
PCount() ->           3
Param 1:  1
Param 2:  2
Param 3:  3

But when debuging
XppDbg.exe test.exe 1 2 3
the CRT show this instead:
PCount() ->           4
Param 1:  test.exe
Param 2:  1
Param 3:  2
Param 4:  3

Regards,
Pablo Botella