
Hello, I want to examine yhc bytecode, but Robert Dockins's library (http://www.eecs.tufts.edu/~rdocki01/yhc-bytecode.html) complains of a "Bad version". Are there any alternatives, other than doing it manually using a hex editor? Thanks. -- Kartik Vaddadi. Home: www.cse.iitb.ac.in/~kart Blogs: kartik-log.blogspot.com, kartik-rlog.blogspot.com Alternate mail ID: kartik.vad@gmail.com "50% Reservation, 100% Politics" - Protest the Indian government's decision to increase reservation in private educational institutions (yfemumbai.blogspot.com)

Hi Kartik,
yhc -help gives you:
-bcodecompile show B code after compile (default=off)
-bcodemem show B code after heap usage analysis (default=off)
-bcodeflatten show B code after flattening (default=off)
-bcoderel show B code after converting to relative jumps
(default=off)
Running yhc Main.hs -bcodecompile
Compiling Main ( Main.hs )
------ BCode after compilation:
FUN Main;main{193}(0/0) []
STACK 3
{
PUSH_CONST 0 1 <[] | {}>
PUSH_CONST 1 2 <[] | {}>
PUSH 1 3 <["200"] | {"200"}>
MK_AP 2 1 3 <[] | {}>
APPLY 1 2 <[] | {}>
PUSH 1 3 <["200"] | {"200"}>
MK_AP 3 1 3 <[] | {}>
MK_AP 4 2 2 <[] | {}>
EVAL 2 <[] | {}>
SLIDE 1 1 <[] | {}>
RETURN 1 <[] | {}>
}
FLAGS []
---- ConstTable ---------------
0 CAF Prelude;Prelude.Num.Prelude.Integer{202}
1 INTEGER 42
2 FUN Prelude;fromInteger{123}
3 FUN Prelude;Prelude.Num.Prelude.Show{201}
4 FUN Prelude;print{50}
-------------------------------
The bytecode library should work, I'll raise a bug.
Thanks
Neil
On 9/28/06, Kartik Vaddadi
Hello, I want to examine yhc bytecode, but Robert Dockins's library (http://www.eecs.tufts.edu/~rdocki01/yhc-bytecode.html) complains of a "Bad version". Are there any alternatives, other than doing it manually using a hex editor? Thanks.
-- Kartik Vaddadi.
Home: www.cse.iitb.ac.in/~kart Blogs: kartik-log.blogspot.com, kartik-rlog.blogspot.com Alternate mail ID: kartik.vad@gmail.com
"50% Reservation, 100% Politics" - Protest the Indian government's decision to increase reservation in private educational institutions (yfemumbai.blogspot.com)
_______________________________________________ Yhc mailing list Yhc@haskell.org http://www.haskell.org/mailman/listinfo/yhc

On Sep 28, 2006, at 4:08 AM, Kartik Vaddadi wrote:
Hello, I want to examine yhc bytecode, but Robert Dockins's library (http://www.eecs.tufts.edu/~rdocki01/yhc-bytecode.html) complains of a "Bad version". Are there any alternatives, other than doing it manually using a hex editor? Thanks.
Can you give some more details about the problem? What architecture/ OS are you on? How did you compile the bytecode lib? How did you invoke it? Can you provide a small hbc file that causes the problem for you?
-- Kartik Vaddadi.
Home: www.cse.iitb.ac.in/~kart Blogs: kartik-log.blogspot.com, kartik- rlog.blogspot.com Alternate mail ID: kartik.vad@gmail.com
"50% Reservation, 100% Politics" - Protest the Indian government's decision to increase reservation in private educational institutions (yfemumbai.blogspot.com)
_______________________________________________ Yhc mailing list Yhc@haskell.org http://www.haskell.org/mailman/listinfo/yhc
Thanks Rob Dockins Speak softly and drive a Sherman tank. Laugh hard; it's a long way to the bank. -- TMBG

Robert Dockins wrote:
Can you give some more details about the problem? Can you provide a small hbc file that causes the problem for you? OS: Windows XP SP2 architecture: x64 (in x86 compatibility mode) I'm using the pre-built version of yhc; I didn't build it myself. The minor version of the hbc file is 0x0A.
test.hs:
main = print (3 + f 2) f x = x G:\projects\debugger>yhc test.hs
Compiling Main ( test.hs ) inspect.hs:
import Yhc.Bytecode.Version_1_9
main = (readFile "g:\\projects\\debugger\\Main.hbc") >>= readLogicalModule >>= print G:\projects\debugger\yhc-bytecode-0.2-source\src\Yhc\Bytecode>yhc inspect.hs
Compiling Main ( inspect.hs ) G:\projects\debugger\yhc-bytecode-0.2-source\src\Yhc\Bytecode>yhi Main.hbc Bad version I've attached the hbc file which could not be disassembled. I'm sorry if I did something stupid, and for not reporting this directly to Robert. Thanks for your time. -- Kartik Vaddadi. Home: www.cse.iitb.ac.in/~kart Blogs: kartik-log.blogspot.com, kartik-rlog.blogspot.com Alternate mail ID: kartik.vad@gmail.com "50% Reservation, 100% Politics" - Protest the Indian government's decision to increase reservation in private educational institutions (yfemumbai.blogspot.com)

On Saturday 30 September 2006 12:08, Kartik Vaddadi wrote:
Robert Dockins wrote:
Can you give some more details about the problem? Can you provide a small hbc file that causes the problem for you?
OS: Windows XP SP2 architecture: x64 (in x86 compatibility mode) I'm using the pre-built version of yhc; I didn't build it myself. The minor version of the hbc file is 0x0A.
Ah. Well, this is the problem. The bytecode library expects exactly version 1.9 of the bytecode set. As far as I was aware, that was the latest version. Has the bytecode set been version bumped recently? It is to do with x64? I've been busy with other things recently and haven't been following Yhc development as closely as I'd like.
test.hs:
main = print (3 + f 2) f x = x
G:\projects\debugger>yhc test.hs
Compiling Main ( test.hs )
inspect.hs:
import Yhc.Bytecode.Version_1_9
main = (readFile "g:\\projects\\debugger\\Main.hbc") >>= readLogicalModule >>= print
That looks about right.
G:\projects\debugger\yhc-bytecode-0.2-source\src\Yhc\Bytecode>yhc inspect.hs
Compiling Main ( inspect.hs )
G:\projects\debugger\yhc-bytecode-0.2-source\src\Yhc\Bytecode>yhi Main.hbc
Bad version
I've attached the hbc file which could not be disassembled. I'm sorry if I did something stupid, and for not reporting this directly to Robert.
No problem. This is as good a list as any to discuss bugs in this library, since I don't have a separate project space for it. And thanks for this bug report. I'll see what I can do about getting this fixed.
Thanks for your time.
-- Rob Dockins Talk softly and drive a Sherman tank. Laugh hard, it's a long way to the bank. -- TMBG

On Saturday 30 September 2006 13:44, Robert Dockins wrote:
On Saturday 30 September 2006 12:08, Kartik Vaddadi wrote:
Robert Dockins wrote:
Can you give some more details about the problem? Can you provide a small hbc file that causes the problem for you?
OS: Windows XP SP2 architecture: x64 (in x86 compatibility mode) I'm using the pre-built version of yhc; I didn't build it myself. The minor version of the hbc file is 0x0A.
Ah. Well, this is the problem. The bytecode library expects exactly version 1.9 of the bytecode set. As far as I was aware, that was the latest version.
Has the bytecode set been version bumped recently? It is to do with x64? I've been busy with other things recently and haven't been following Yhc development as closely as I'd like.
Tom, Neil? Any word on this? -- Rob Dockins Talk softly and drive a Sherman tank. Laugh hard, it's a long way to the bank. -- TMBG

Hi
Has the bytecode set been version bumped recently? It is to do with x64? I've been busy with other things recently and haven't been following Yhc development as closely as I'd like.
Tom, Neil? Any word on this?
No idea. Will give Tom a gentle prod tomorrow. Once we have the bytecode library in the Yhc darcs repo, we might want to add some basic tests to the Bytecode library to be executed with buildbot. Ditto for the Yhc.Core library. Thanks Neil

On Tue, 2006-10-03 at 22:52 +0100, Neil Mitchell wrote:
Hi
Has the bytecode set been version bumped recently? It is to do with x64? I've been busy with other things recently and haven't been following Yhc development as closely as I'd like.
Tom, Neil? Any word on this?
It's very likely, from time to time it becomes necessary to add extra information to the bytecode. I'm not sure what it was for though ... though nothing to do with x64 certainly ... Thanks Tom

On Wednesday 04 October 2006 04:37, Tom Shackell wrote:
On Tue, 2006-10-03 at 22:52 +0100, Neil Mitchell wrote:
Hi
Has the bytecode set been version bumped recently? It is to do with x64? I've been busy with other things recently and haven't been following Yhc development as closely as I'd like.
Tom, Neil? Any word on this?
It's very likely, from time to time it becomes necessary to add extra information to the bytecode. I'm not sure what it was for though ... though nothing to do with x64 certainly ...
Hummm... so apparently, the problem here is that I am an idiot. :( The bootstrap .hbc files in the Yhc distribution have minor version 9 and the versions generated by the compiler have minor version 10. I never noticed because I was using the API to generate bytecode more than to read it, and the runtime accepted my files with minor ver 9. I clearly did all my initial read testing agains the 'bootstrap' versions of the Yhc libraries. Ugh. The darcs history shows me that the minor version of the bytecode has been 10 since Yhc was under darcs control, so that's clearly the correct version number. Does anyone happen to know what the differences between versions 9 and 10 are? What version does the data sheet at 'src/compiler98/Bytecode/data/bytecode.xml' describe?
Thanks
Tom
-- Rob Dockins Talk softly and drive a Sherman tank. Laugh hard, it's a long way to the bank. -- TMBG

Hi
The bootstrap .hbc files in the Yhc distribution have minor version 9 and the versions generated by the compiler have minor version 10.
Do we still need the bootstrap .hbc files? Isn't this just a hangover from before we could really build Yhc libraries properly on all platforms?
Does anyone happen to know what the differences between versions 9 and 10 are? What version does the data sheet at 'src/compiler98/Bytecode/data/bytecode.xml' describe?
I suspect its version 10, but don't really know. I guess the best way to find the differences are to look at the C code that reads the bytecodes, it can't be too different between the two give that it translates between them at runtime. I suspect its only additions of new bytecodes. Thanks Neil
participants (4)
-
Kartik Vaddadi
-
Neil Mitchell
-
Robert Dockins
-
Tom Shackell