On Tue, 30 Nov 2004, Tanu Sharma wrote:> I have trouble using the llvm tools.Some of the errors are : > > $ llvm-dis prog.bc > $ llvm-dis: Invalid Top Level Block Length! Type:1, Size:456 (Vers=0, Pos=12)Can you explain how you generated this bytecode file? It looks corrupted or something. Also, can you send the actual bytecode file itself? Thanks! -Chris> ------------------------------------- > > $ extract -o=outprog prog.bc > $ extract: bytecode didn't read correctly. > > Where am I doing wrong ?I wish to get human readable form of my bytecode file.The tool giving similar error. > > Thanks > > Tanu > > > --------------------------------- > Do you Yahoo!? > Read only the mail you want - Yahoo! Mail SpamGuard.-Chris -- http://nondot.org/sabre/ http://llvm.cs.uiuc.edu/
Thanks for replying, Yes, I think too that the bytecode file is corrupted. This is the file : ------------------------------------------------------------------------------------------------------------------------- ^B^@^@��^C^A��^C^A��^C^B��^D^@^@^R^U^W��#^M^@^@^C^@^NThis">llvm^A^@^@^@�^A^@^@0������F^E^@^@^O^P^N^O^C^X^P^P^O^C^U^P^A^P^T^P^C^M^G^B^S^@^P^^@^A^G^P^X^M^G^@^N^G^[^@^M^@^@^P^Z����<85>^B^@^@��^C^A��^C^A��^C^B��^D^@^@^R^U^W��#^M^@^@^C^@^NThis is main function ^@^PCalling sub function^@^PThis is sub ^P^Hb^Q^A^A'>function^@^A^A^@^A^A^G^@^B^C^S^C^Y^A^M^@^G^@^G^C^Y^A^O^@^G^@^G^C^Y^B^O^@^G^@^G������"^@^@^@^@������"^@^@^@^@������^B^Q^@^@^@����^G^F^@^@]^Q^P^@^K<8c>^P^Hb^Q^A^A ^L ^@p^R^B^A^A������p^R^B^A^B������p^R��r^U^A^A^E^G^@^@��^H^@^@^@^A^A^B^Gtmp.1.i^C^G^B^Etmp.0^D^Gtmp.0.i^C^Etmp.2^C^L^L__main.entry^A endif.0.i^@^Eentry��$^M^@^@^B^Y^Nstruct..TorRec^Y^Mstruct.TorRecB^O^A^F.str_2^B^F.str_3^A^R^A^Fprintf^A^U^A^Dexit^A^W^A^Dmain^A^M^A^F.str_1^A^Q^A^OInitialized.0__������ ------------------------------------------------------------------------------- I generated it like this: $llvmgcc prog.c -o prog Thanks Tanu Chris Lattner <sabre at nondot.org> wrote: On Tue, 30 Nov 2004, Tanu Sharma wrote:> I have trouble using the llvm tools.Some of the errors are : > > $ llvm-dis prog.bc > $ llvm-dis: Invalid Top Level Block Length! Type:1, Size:456 (Vers=0, Pos=12)Can you explain how you generated this bytecode file? It looks corrupted or something. Also, can you send the actual bytecode file itself? Thanks! -Chris> ------------------------------------- > > $ extract -o=outprog prog.bc > $ extract: bytecode didn't read correctly. > > Where am I doing wrong ?I wish to get human readable form of my bytecode file.The tool giving similar error. > > Thanks > > Tanu > > > --------------------------------- > Do you Yahoo!? > Read only the mail you want - Yahoo! Mail SpamGuard.-Chris -- http://nondot.org/sabre/ http://llvm.cs.uiuc.edu/ _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev --------------------------------- Do you Yahoo!? All your favorites on one personal page � Try My Yahoo! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20041130/f554bbce/attachment.html>
Could you send the bytecode file as an attachment, please? Thanks, Reid. On Tue, 2004-11-30 at 10:07, Tanu Sharma wrote:> Thanks for replying, > > Yes, I think too that the bytecode file is corrupted. > This is the file : > ------------------------------------------------------------------------------------------------------------------------- > llvm^A^@^@^@^A^@^@0F^E^@^@^O^P^N^O^C^X^P^P^O^C^U^P^A^P^T^P^C^M^G^B^S^@^P^^@^A^G^P^X^M^G^@^N^G^[^@^M^@^@^P^Z<85>^B^@^@^C^A^C^A^C^B^D^@^@^R^U^W#^M^@^@^C^@^NThis is main function > ^@^PCalling sub function^@^PThis is sub > function^@^A^A^@^A^A^G^@^B^C^S^C^Y^A^M^@^G^@^G^C^Y^A^O^@^G^@^G^C^Y^B^O^@^G^@^G"^@^@^@^@"^@^@^@^@^B^Q^@^@^@^G^F^@^@]^Q^P^@^K<8c>^P^Hb^Q^A^A ^L ^@p^R^B^A^Ap^R^B^A^Bp^Rr^U^A^A^E^G^@^@^H^@^@^@^A^A^B^Gtmp.1.i^C^G^B^Etmp.0^D^Gtmp.0.i^C^Etmp.2^C^L^L__main.entry^A endif.0.i^@^Eentry$^M^@^@^B^Y^Nstruct..TorRec^Y^Mstruct.TorRecB^O^A^F.str_2^B^F.str_3^A^R^A^Fprintf^A^U^A^Dexit^A^W^A^Dmain^A^M^A^F.str_1^A^Q^A^OInitialized.0__ > > ------------------------------------------------------------------------------- > > I generated it like this: > $llvmgcc prog.c -o prog > > Thanks > Tanu > > Chris Lattner <sabre at nondot.org> wrote: > On Tue, 30 Nov 2004, Tanu Sharma wrote: > > > I have trouble using the llvm tools.Some of the errors are : > > > > $ llvm-dis prog.bc > > $ llvm-dis: Invalid Top Level Block Length! Type:1, Size:456 > (Vers=0, Pos=12) > > Can you explain how you generated this bytecode file? It looks > corrupted > or something. Also, can you send the actual bytecode file > itself? > > Thanks! > > -Chris > > > > ------------------------------------- > > > > $ extract -o=outprog prog.bc > > $ extract: bytecode didn't read correctly. > > > > Where am I doing wrong ?I wish to get human readable form of > my bytecode file.The tool giving similar error. > > > > Thanks > > > > Tanu > > > > > > --------------------------------- > > Do you Yahoo!? > > Read only the mail you want - Yahoo! Mail SpamGuard. > > -Chris > -- > http://nondot.org/sabre/ > http://llvm.cs.uiuc.edu/ > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev > > ______________________________________________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My Yahoo! > > ______________________________________________________________________ > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20041130/3aa80a33/attachment.sig>
On Tue, 2004-11-30 at 08:58, Chris Lattner wrote:> On Tue, 30 Nov 2004, Tanu Sharma wrote: > > > I have trouble using the llvm tools.Some of the errors are : > > > > $ llvm-dis prog.bc > > $ llvm-dis: Invalid Top Level Block Length! Type:1, Size:456 (Vers=0, Pos=12) > > Can you explain how you generated this bytecode file? It looks corrupted > or something. Also, can you send the actual bytecode file itself?Okay, Tanu sent the bytecode file and it works fine with llvm-bcanalyzer and llvm-dis. The output from those tools are attached. So, I think the real question is: "what llvm-dis where you running?". Reid. -------------- next part -------------- target endian = little target pointersize = 32 %struct..TorRec = type { int, void ()* } %struct.TorRec = type { int, void ()* } %.str_1 = internal constant [24 x sbyte] c"This is main function \0A\00" ; <[24 x sbyte]*> [#uses=1] %.str_2 = internal constant [21 x sbyte] c"Calling sub function\00" ; <[21 x sbyte]*> [#uses=1] %.str_3 = internal constant [21 x sbyte] c"This is sub function\00" ; <[21 x sbyte]*> [#uses=1] %Initialized.0__ = internal global bool false ; <bool*> [#uses=2] implementation ; Functions: declare int %printf(sbyte*, ...) declare void %exit(int) int %main() { entry: %tmp.1.i = load bool* %Initialized.0__ ; <bool> [#uses=1] br bool %tmp.1.i, label %__main.entry, label %endif.0.i endif.0.i: ; preds = %entry store bool true, bool* %Initialized.0__ br label %__main.entry __main.entry: ; preds = %entry, %endif.0.i %tmp.0 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([24 x sbyte]* %.str_1, int 0, int 0) ) ; <int> [#uses=0] %tmp.2 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([21 x sbyte]* %.str_2, int 0, int 0) ) ; <int> [#uses=0] %tmp.0.i = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([21 x sbyte]* %.str_3, int 0, int 0) ) ; <int> [#uses=0] call void %exit( int 1 ) ret int 0 } -------------- next part -------------- Summary Analysis Of prog.bc: Bytecode Analysis Of Module: prog.bc Bytecode Version Number: 3 File Size: 469 Module Bytes: 469 (100%) Function Bytes: 138 (29.42%) Global Types Bytes: 42 (8.955%) Constant Pool Bytes: 105 (22.39%) Module Globals Bytes: 20 (4.264%) Instruction List Bytes: 48 (10.23%) Compaction Table Bytes: 1 (0.2132%) Symbol Table Bytes: 176 (37.53%) Alignment Bytes: 29 (6.183%) Block Header Bytes: 40 (8.529%) Dependent Libraries Bytes: 0 (0%) Number Of Bytecode Blocks: 10 Number Of Functions: 3 Number Of Types: 15 Number Of Constants: 8 Number Of Global Variables: 4 Number Of Values: 27 Number Of Basic Blocks: 3 Number Of Instructions: 9 Number Of Long Instructions: 3 Number Of Operands: 16 Number Of Compaction Tables: 1 Number Of Symbol Tables: 2 Number Of Dependent Libs: 0 Total Instruction Size: 48 Average Instruction Size: 5.33333 Maximum Type Slot Number: 14 Maximum Value Slot Number: 17 Bytes Per Value : 15.6333 Bytes Per Global: 6.18519 Bytes Per Function: 46 # of VBR 32-bit Integers: 167 # of VBR 64-bit Integers: 1 # of VBR Compressed Bytes: 172 # of VBR Expanded Bytes: 676 Bytes Saved With VBR: 504 (74.56%) Detailed Analysis Of prog.bc Functions: External Function: printf Type:: int (sbyte*, ...)* Byte Size: 1 External Function: exit Type:: void (int)* Byte Size: 1 Function: main Type:: int ()* Byte Size: 136 Basic Blocks: 3 Instructions: 9 Long Instructions: 3 Operands: 0 Instruction Size: 48 Average Instruction Size: 5.33333 Bytes Per Instruction: 15.1111 # of VBR 32-bit Integers: 37 # of VBR 64-bit Integers: 0 # of VBR Compressed Bytes: 37 # of VBR Expanded Bytes: 148 Bytes Saved With VBR: 111 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20041130/9879b29d/attachment.sig>
Thanks for trying it out and replying. This is weird but I tried again and again and the tools are working fine now. I was working in school account, maybe some change in permissions worked. Otherwise I am confused. Thanks anyways Tanu Reid Spencer <reid at x10sys.com> wrote: On Tue, 2004-11-30 at 08:58, Chris Lattner wrote:> On Tue, 30 Nov 2004, Tanu Sharma wrote: > > > I have trouble using the llvm tools.Some of the errors are : > > > > $ llvm-dis prog.bc > > $ llvm-dis: Invalid Top Level Block Length! Type:1, Size:456 (Vers=0, Pos=12) > > Can you explain how you generated this bytecode file? It looks corrupted > or something. Also, can you send the actual bytecode file itself?Okay, Tanu sent the bytecode file and it works fine with llvm-bcanalyzer and llvm-dis. The output from those tools are attached. So, I think the real question is: "what llvm-dis where you running?". Reid. target endian = little target pointersize = 32 %struct..TorRec = type { int, void ()* } %struct.TorRec = type { int, void ()* } %.str_1 = internal constant [24 x sbyte] c"This is main function \0A\00" ; <[24 x sbyte]*> [#uses=1] %.str_2 = internal constant [21 x sbyte] c"Calling sub function\00" ; <[21 x sbyte]*> [#uses=1] %.str_3 = internal constant [21 x sbyte] c"This is sub function\00" ; <[21 x sbyte]*> [#uses=1] %Initialized.0__ = internal global bool false ; [#uses=2] implementation ; Functions: declare int %printf(sbyte*, ...) declare void %exit(int) int %main() { entry: %tmp.1.i = load bool* %Initialized.0__ ; [#uses=1] br bool %tmp.1.i, label %__main.entry, label %endif.0.i endif.0.i: ; preds = %entry store bool true, bool* %Initialized.0__ br label %__main.entry __main.entry: ; preds = %entry, %endif.0.i %tmp.0 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([24 x sbyte]* %.str_1, int 0, int 0) ) ; [#uses=0] %tmp.2 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([21 x sbyte]* %.str_2, int 0, int 0) ) ; [#uses=0] %tmp.0.i = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([21 x sbyte]* %.str_3, int 0, int 0) ) ; [#uses=0] call void %exit( int 1 ) ret int 0 } Summary Analysis Of prog.bc: Bytecode Analysis Of Module: prog.bc Bytecode Version Number: 3 File Size: 469 Module Bytes: 469 (100%) Function Bytes: 138 (29.42%) Global Types Bytes: 42 (8.955%) Constant Pool Bytes: 105 (22.39%) Module Globals Bytes: 20 (4.264%) Instruction List Bytes: 48 (10.23%) Compaction Table Bytes: 1 (0.2132%) Symbol Table Bytes: 176 (37.53%) Alignment Bytes: 29 (6.183%) Block Header Bytes: 40 (8.529%) Dependent Libraries Bytes: 0 (0%) Number Of Bytecode Blocks: 10 Number Of Functions: 3 Number Of Types: 15 Number Of Constants: 8 Number Of Global Variables: 4 Number Of Values: 27 Number Of Basic Blocks: 3 Number Of Instructions: 9 Number Of Long Instructions: 3 Number Of Operands: 16 Number Of Compaction Tables: 1 Number Of Symbol Tables: 2 Number Of Dependent Libs: 0 Total Instruction Size: 48 Average Instruction Size: 5.33333 Maximum Type Slot Number: 14 Maximum Value Slot Number: 17 Bytes Per Value : 15.6333 Bytes Per Global: 6.18519 Bytes Per Function: 46 # of VBR 32-bit Integers: 167 # of VBR 64-bit Integers: 1 # of VBR Compressed Bytes: 172 # of VBR Expanded Bytes: 676 Bytes Saved With VBR: 504 (74.56%) Detailed Analysis Of prog.bc Functions: External Function: printf Type:: int (sbyte*, ...)* Byte Size: 1 External Function: exit Type:: void (int)* Byte Size: 1 Function: main Type:: int ()* Byte Size: 136 Basic Blocks: 3 Instructions: 9 Long Instructions: 3 Operands: 0 Instruction Size: 48 Average Instruction Size: 5.33333 Bytes Per Instruction: 15.1111 # of VBR 32-bit Integers: 37 # of VBR 64-bit Integers: 0 # of VBR Compressed Bytes: 37 # of VBR Expanded Bytes: 148 Bytes Saved With VBR: 111> ATTACHMENT part 1.2 application/pgp-signature name=signature.asc_______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev --------------------------------- Do you Yahoo!? Yahoo! Mail - You care about security. So do we. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20041130/d101dc15/attachment.html>