PH7 Engine does not track line numbers at run-time #3

Closed
opened 2018-07-13 06:50:33 +02:00 by belliash · 3 comments
Owner

Aer Information

  • Aer Version (or commit ref): e53cfb8ba0
  • Operating System: Linux
  • System Architecture (eg. arm, x86_64, ...): x86_64

Your problem description

debug_backtrace() and probably any other related function returns always 1 as a file line. Root cause is PH7 Engine not tracking line numbers at run-time. This is hard-coded in vm.c, lines: 9300 - 9304.

<!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please take a moment to check that your issue doesn't already exist. 3. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> # Aer Information - Aer Version (or commit ref): e53cfb8ba0 - Operating System: Linux - System Architecture (eg. arm, x86_64, ...): x86_64 # Your problem description debug_backtrace() and probably any other related function returns always 1 as a file line. Root cause is PH7 Engine not tracking line numbers at run-time. This is hard-coded in vm.c, lines: 9300 - 9304.
belliash added the
bug
enhancement
labels 2018-07-13 06:50:33 +02:00
First-time contributor

To implement this feature, in the compilation bytecode header must store a mapping of the opcode's position with the associated source code line.

source -> compile -> bytecodes + header with lines for each bytecode jump

This issue is a structural problem in generating the bytecode, which is necessary to generate with the header that contains this mapping.

For example, it follows the attachment how Java handles this mapping. This image is a example of method with yours bytecodes and yours lines associated.

To implement this feature, in the compilation bytecode header must store a mapping of the opcode's position with the associated source code line. source -> compile -> bytecodes + header with lines for each bytecode jump This issue is a structural problem in generating the bytecode, which is necessary to generate with the header that contains this mapping. For example, it follows the attachment how Java handles this mapping. This image is a example of method with yours bytecodes and yours lines associated.
Author
Owner

This is connected with #2, I think. There is a general problem with information about file & line position in PH7. FILE shows some trash, while debug_backtrace() simply gets currently processed file and returns only last callback instead of whole backtrace.

This is connected with #2, I think. There is a general problem with information about file & line position in PH7. __FILE__ shows some trash, while debug_backtrace() simply gets currently processed file and returns only last callback instead of whole backtrace.
devnexen self-assigned this 2018-07-19 20:45:52 +02:00
Member

gitea seems annoyingly to close the ticket once you mention it in a commit message.

gitea seems annoyingly to close the ticket once you mention it in a commit message.
devnexen reopened this issue 2018-07-20 16:19:14 +02:00
devnexen referenced this issue from a commit 2018-07-22 20:24:30 +02:00
devnexen referenced this issue from a commit 2018-07-22 20:24:31 +02:00
devnexen was assigned by belliash 2018-07-28 19:22:53 +02:00
belliash referenced this issue from a commit 2020-06-20 00:29:11 +02:00
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: aerscript/Aer#3
No description provided.