Trying to use disassemble or pdb gave me this message (note doubled first
character)
Parrot VM: Can't stat ttest.pbc, code 2.
I looked at the source code and found some pretty weird stuff
#define na(c) { \
while(*c && !isspace(*c)) \
c++; }
...later
na(argv[0]);
filename = &(*argv)[1];
&(*argv)[1] is actually equivalent to argv[0] + 1. So this moves argv[0] up
to the ending null, then one space further, and assumes that's the start of
the first argument... This might be true on some OSes, but it's not portable,
apparently my crt2.o puts an extra character before it.
IMO this should just be replaced with plain old "filename = argv[1];" which
is what this patch does..
__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools
--- src/disassemble.c~ Mon Jan 26 15:16:04 2004
+++ src/disassemble.c Thu Feb 19 18:01:46 2004
@@ -32,10 +32,6 @@
#include <stdlib.h>
#include <ctype.h>
-#define na(c) { \
- while(*c && !isspace(*c)) \
- c++; }
-
static void do_dis(Parrot_Interp);
/*
@@ -70,8 +66,7 @@
Parrot_exit(1);
}
- na(argv[0]);
- filename = &(*argv)[1];
+ filename = argv[1];
pf = Parrot_readbc(interpreter, filename);
--- src/pdb.c~ Tue Jan 27 15:08:08 2004
+++ src/pdb.c Thu Feb 19 18:00:32 2004
@@ -113,10 +113,6 @@
void PDB_printwelcome(void);
-#define na(c) { \
- while(*c && !isspace(*c)) \
- c++; }
-
/*
=item C<int
@@ -149,9 +145,7 @@
Parrot_exit(1);
}
- na(argv[0]);
-
- filename = &(*argv)[1];
+ filename = argv[1];
pf = Parrot_readbc(interpreter, filename);