Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KaitaiStream must have ability to report position relative to root IO object #26

Open
Mingun opened this issue Feb 6, 2020 · 1 comment · May be fixed by kaitai-io/kaitai_struct_compiler#197

Comments

@Mingun
Copy link
Contributor

Mingun commented Feb 6, 2020

That absolute positions must be stored in the debug maps (_attrStart, _attrEnd, _arrStart, _arrEnd). Without that it is impossible or too hard to determine correct position of parsed objects, especially of instances objects.

For example, consider following KSY:

meta:
  id: offsets
seq:
  - id: padding
    type: u1
  - id: unsized
    type: type
  - id: sized
    type: type
    size: 10
types:
  type:
    seq:
      - id: padding
        type: u1
      - id: unsized_simple
        type: u1
      - id: sized_simple
        size: 1
      - id: unsized_array
        type: elem
        repeat: expr
        repeat-expr: 2
      - id: sized_array
        type: elem
        size: 3
        repeat: expr
        repeat-expr: 1
  elem:
    seq:
      - id: padding
        type: u1
      - id: value
        type: u1

The following problem is currently being observed:
This show correct location
Type
That location is wrong, must be inside previous region:
Content

Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Feb 23, 2020
Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Feb 23, 2020
Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Feb 23, 2020
Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Aug 9, 2020
Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Aug 9, 2020
Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Oct 18, 2020
Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Oct 18, 2020
Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Nov 19, 2020
Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Nov 19, 2020
Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Aug 8, 2021
Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Aug 8, 2021
Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Aug 9, 2021
Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Aug 9, 2021
@pfroud
Copy link

pfroud commented Jun 3, 2022

The example input works correctly in the web IDE:

image

image

I hope this can get fixed in the Java implementation

Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Jul 13, 2023
Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Jul 13, 2023
Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Sep 12, 2023
Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Sep 12, 2023
Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Mar 8, 2024
Mingun added a commit to Mingun/kaitai_struct_java_runtime that referenced this issue Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants