vlm / asn1c

The ASN.1 Compiler
http://lionet.info/asn1c/
BSD 2-Clause "Simplified" License
1.04k stars 554 forks source link

SEQUENCE_OF_decode_oer and SEQUENCE_OF_encode_oer undeclare here (not in funciton) #187

Open wjleong opened 7 years ago

wjleong commented 7 years ago

Hello lev, I am testing out the OER support for my example asn schema, a very simple schema but i run into problem when i run the make file. The error "SEQUENCE_of_decode_oer" undeclare here. If i use -gen-PEr, then the code works. Only when i used -gen-OER this error pops up. whenever i run the asn1c compiler with the -gen-OER flags, the issue will occur. I think the OER portion might be broken. I cloned the master newest branch. Does anyone else has similar issue? My Asn schema is pretty simple, in fact is from the Lev's example page.

MyModule DEFINITIONS ::=
BEGIN
MyTypes ::= SEQUENCE {
    myObjectId   OBJECT IDENTIFIER,
    mySeqOf      SEQUENCE OF MyInt,
    myBitString  BIT STRING {
                        muxToken(0), 
                        modemToken(1)
                 }
}

MyInt ::= INTEGER (0..65535)
END

Commands

> asn1c -pdu=MyTypes -gen-OER MytestAsn.asn1
> make -f Makefile.am.sample clean
> make -f Makefile.am.sample
> 
> Error:
> MyTypes.c:43:2 error: 'SEQUENCE_OF_decode_oer' undeclare here (not in a function)
> SEQUENCE_OF_decode_oer,
>  MyTypes.c:43:2 error: 'SEQUENCE_OF_eecode_oer' undeclare here (not in a function)
> SEQUENCE_OF_eecode_oer,

The compilation failed. but when i change to -gen-PER, it passed. Any idea?

WJL

brchiu commented 7 years ago

hi, @wjleong ,

With vlm's newest repository 290b4d6918fe567c412fee2cf139fc82e442ee26, generated code from you sample ASN.1 can be compiled and linked successfully.

The Makefile is modified and re-generated from examples/sample.sample.source.1609.2/Makefile

wjleong commented 7 years ago

Hi brchiu,

Thank you! you are right the code can be compile and link. When i am decoding the attached oer file by using command:-

./progname -ioer -oxer data.oer

I get error below:-

Segmentation fault (core dumped)

Appreciate you advice. My whole prupose is to test out the simple oer encoding/decoding so that i can use it on the TCI schema i will be working on...if you have any information about TCI it will be a great help as well!! :)

data.zip

brchiu commented 7 years ago

@wjleong, I would suggest you compile your own code with debug information enabled, i.e. with '-g' command line option, then use gdb to find out the place crash.

wjleong commented 7 years ago

hello brchiu, I attached an asn schema and i tried using lev master to compile it and it gives lots of error. Is there a working branch i can use to compile the attached schema? thank you for your help1

WJL TCIall.zip