1. [ATTN Matt & PeteL] Re: IL Disassembler?
- Posted by Alexander Toresson <alexander.toresson at gmail.com> Apr 11, 2005
- 534 views
- Last edited Apr 12, 2005
I can't get the IL output to work for sieve8k.exw in either of your programs (ildis&ooeu). Ildis can run it correctly, but if I do: exu eu.ex sieve8k.exw -i I get the following error: ./main.e:170 in function name() subscript value 283 is out of bounds, reading from a sequence of length 234 ... called from ./main.e:511 in procedure EmitIL() ... called from ./main.e:862 in procedure main() ... called from ./main.e:873 An interesting thing is that it can output the il code of eu.ex correctly, however. For ooeu, if I do: exu dis.ex sieve8k.exw I get the error: ./sequencef.e:172 in function read_symtab() bad file number (-1) ... called from dis.ex:1244 in procedure main() ... called from dis.ex:1257 I get the same error if I try to disassemble eu.ex with dis.ex. Regards, Alexander Toresson
2. Re: [ATTN Matt & PeteL] Re: IL Disassembler?
- Posted by Matt Lewis <matthewwalkerlewis at gmail.com> Apr 11, 2005
- 518 views
- Last edited Apr 12, 2005
Alexander Toresson wrote: > > I can't get the IL output to work for sieve8k.exw in either of your programs > (ildis&ooeu). > > Ildis can run it correctly, but if I do: > > exu eu.ex sieve8k.exw -i > > I get the following error: > > ./main.e:170 in function name() > subscript value 283 is out of bounds, reading from a sequence of length 234 > ... called from ./main.e:511 in procedure EmitIL() > ... called from ./main.e:862 in procedure main() > ... called from ./main.e:873 > > An interesting thing is that it can output the il code of eu.ex correctly, > however. > > For ooeu, if I do: > > exu dis.ex sieve8k.exw > > I get the error: > > ./sequencef.e:172 in function read_symtab() > bad file number (-1) > ... called from dis.ex:1244 in procedure main() > ... called from dis.ex:1257 > > I get the same error if I try to disassemble eu.ex with dis.ex. > It's actually a two step process: exu eu.ex -c sieve8k.exw exu dis.ex sieve9k First, you have to shroud it such that it doesn't delete anything (that's what the -c does). Then you disassemble the *.oe file (the extension is optional when running dis.ex). Then dis.ex will output a file with a .dis extension, which is a text file with the disassembled output. If you have "with trace" on in the code, you'll be able to see the lines whenever a STARTLINE op is called. Matt Lewis
3. Re: [ATTN Matt & PeteL] Re: IL Disassembler?
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Apr 12, 2005
- 516 views
On Mon, 11 Apr 2005 14:11:27 -0700, Alexander Toresson <guest at RapidEuphoria.com> wrote: >posted by: Alexander Toresson <alexander.toresson at gmail.com> > >I can't get the IL output to work for sieve8k.exw in either of your programs >(ildis&ooeu). > >Ildis can run it correctly, but if I do: > >exu eu.ex sieve8k.exw -i > >I get the following error: > >./main.e:170 in function name() >subscript value 283 is out of bounds, reading from a sequence of length 234 >... called from ./main.e:511 in procedure EmitIL() >... called from ./main.e:862 in procedure main() >... called from ./main.e:873 > >An interesting thing is that it can output the il code of eu.ex correctly, >however. Aye, it is failing on the name part, not the actual il code. The thing that has happened here is that, in main.e you will find: elsif find(eii,{POWER,LESS,GREATEREQ,EQUALS,NOTEQ,LESSEQ,GREATER, MULTIPLY,PLUS,MINUS,OR,AND,DIVIDE,FLOOR_DIV, XOR,OR_BITS,XOR_BITS,AND_BITS,REMAINDER, SC1_AND,SC1_AND_IF,SC1_OR,SC1_OR_IF, APPEND,PREPEND,COMPARE,FIND,MATCH,CONCAT, DIV2,FLOOR_DIV2,REPEAT,PLUS1,PASSIGN_OP_SUBS, PLUS_I,MINUS_I,PLUS1_I,SPRINTF,EQUAL, MACHINE_FUNC,OPEN,SYSTEM_EXEC}) then -- -- two operands and a result -- **BUT** SC1_AND_IF's third parameter is *NOT* a variable, but an address (mea culpa), so it dies trying to get a name for it. Actually, there will be cases where eu.ex would output a random name for '283' (or whatever) but the il produced would run fine anyway... In fact, this bug only surfaces when there is one routine "longer" than the entire program, if you get my drift. I am a bit too busy to polish this (sorry), but you need to insert something like this in the above, and possibly similar for some of the other SCxxx instructions: elsif find(eii,{SC1_AND_IF}) then printf(fn,"%s%s,%d,%d,%d --%d:?? goto %d iff??:=?? %s(%s,%s)\n", {strep,ein,ei1,ei2,ei3, eidx,ei3,ein,name(ei1)}) ie ...%d... ei3, not ...%s...name(ei3). It might be simpler just to make name() more robust, say by returning "***ERROR***" instead of crashing, as its results are only comments anyway. Thanks for reporting this! Regards, Pete
4. Re: [ATTN Matt & PeteL] Re: IL Disassembler?
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Apr 12, 2005
- 525 views
On Mon, 11 Apr 2005 16:11:21 -0700, Matt Lewis <guest at RapidEuphoria.com> wrote: >If >you have "with trace" on in the code, you'll be able to see the lines >whenever a STARTLINE op is called. Like me you baulked at unscrambling the S_LINETAB entry ) Pete
5. Re: [ATTN Matt & PeteL] Re: IL Disassembler?
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Apr 12, 2005
- 522 views
On Tue, 12 Apr 2005 02:52:27 +0100, Pete Lomax <petelomax at blueyonder.co.uk> wrote: ICK, >and possibly similar for some of the other SCxxx instructions: make that all the other SC instructions > >elsif find(eii,{SC1_AND_IF}) then > printf(fn,"%s%s,%d,%d,%d --%d:?? goto %d iff??:=?? %s(%s,%s)\n", > {strep,ein,ei1,ei2,ei3, > eidx,ei3,ein,name(ei1)}) make that eidx,ei3,ein,name(ei1),name(ei2)}) (Sorry, I edited the email and posted it before checking again) Pete
6. Re: [ATTN Matt & PeteL] Re: IL Disassembler?
- Posted by Alexander Toresson <alexander.toresson at gmail.com> Apr 12, 2005
- 517 views
Pete Lomax wrote: > > On Tue, 12 Apr 2005 02:52:27 +0100, Pete Lomax > <petelomax at blueyonder.co.uk> wrote: > > ICK, > >and possibly similar for some of the other SCxxx instructions: > make that all the other SC instructions > > > >elsif find(eii,{SC1_AND_IF}) then > > printf(fn,"%s%s,%d,%d,%d --%d:?? goto %d iff??:=?? %s(%s,%s)\n", > > {strep,ein,ei1,ei2,ei3, > > eidx,ei3,ein,name(ei1)}) > make that > eidx,ei3,ein,name(ei1),name(ei2)}) > > (Sorry, I edited the email and posted it before checking again) > > Pete > I think I'll use Matt's disassembler, because it produces much more readable output. But thanks anyway! Regards, Alexander Toresson
7. Re: [ATTN Matt & PeteL] Re: IL Disassembler?
- Posted by Alexander Toresson <alexander.toresson at gmail.com> Apr 12, 2005
- 517 views
Matt Lewis wrote: > > Alexander Toresson wrote: > > > > I can't get the IL output to work for sieve8k.exw in either of your programs > > (ildis&ooeu). > > > > Ildis can run it correctly, but if I do: > > > > exu eu.ex sieve8k.exw -i > > > > I get the following error: > > > > ./main.e:170 in function name() > > subscript value 283 is out of bounds, reading from a sequence of length 234 > > ... called from ./main.e:511 in procedure EmitIL() > > ... called from ./main.e:862 in procedure main() > > ... called from ./main.e:873 > > > > An interesting thing is that it can output the il code of eu.ex correctly, > > however. > > > > For ooeu, if I do: > > > > exu dis.ex sieve8k.exw > > > > I get the error: > > > > ./sequencef.e:172 in function read_symtab() > > bad file number (-1) > > ... called from dis.ex:1244 in procedure main() > > ... called from dis.ex:1257 > > > > I get the same error if I try to disassemble eu.ex with dis.ex. > > > > It's actually a two step process: > > exu eu.ex -c sieve8k.exw > exu dis.ex sieve9k > > First, you have to shroud it such that it doesn't delete anything (that's > what the -c does). Then you disassemble the *.oe file (the extension > is optional when running dis.ex). Then dis.ex will output a file with > a .dis extension, which is a text file with the disassembled output. If > you have "with trace" on in the code, you'll be able to see the lines > whenever a STARTLINE op is called. > > Matt Lewis Thank you! I should have read the manual more thoroughly... Regards, Alexander Toresson
8. Re: [ATTN Matt & PeteL] Re: IL Disassembler?
- Posted by Matt Lewis <matthewwalkerlewis at gmail.com> Apr 12, 2005
- 519 views
Pete Lomax wrote: > > On Mon, 11 Apr 2005 16:11:21 -0700, Matt Lewis > <guest at RapidEuphoria.com> wrote: > > >If > >you have "with trace" on in the code, you'll be able to see the lines > >whenever a STARTLINE op is called. > Like me you baulked at unscrambling the S_LINETAB entry ) Well, yes, but also that the line data is only saved when 'with trace' is in effect. Part of the reason is that my disassembler doesn't work on the source code directly. You have to shroud it first, and then the disassembler works on that file. Matt Lewis