DCPUTeam / DCPUToolchain

[ARCHIVED] The code repository for the DCPU-16 Toolchain.
http://dcputoolcha.in/
MIT License
97 stars 14 forks source link

Confusing line number information for start of functions #94

Closed kierenj closed 12 years ago

kierenj commented 12 years ago

If I have a function called "main", with the first line of code within it at line 8, this code is generated:

.ULINE 12 "C:\Users\Kieren\Documents\0x10c Devkit\DevkitWorkbench\AppTest\apptest1.c"
.BOUNDARY
.EXPORT cfunc_main
:cfunc_main
    SET PC, cfunc_main_actual
    DAT 0
:cfunc_main_actual
    SUB SP, 0
.ULINE 8 "C:\Users\Kieren\Documents\0x10c Devkit\DevkitWorkbench\AppTest\apptest1.c"
.ULINE 8 "C:\Users\Kieren\Documents\0x10c Devkit\DevkitWorkbench\AppTest\apptest1.c"
.ULINE 8 "C:\Users\Kieren\Documents\0x10c Devkit\DevkitWorkbench\AppTest\apptest1.c"
    SET A, 32768

Note that line 12 is the line with the last closing bracket.

That means effectively that the label :cfunc_main is said to be defined by line 12 of the source, but that's the last line of the method, not the first.

I'm using this information to be able to jump to where a label is defined by name - but when I jump to 'cfunc_main', it shows line 12, which is the last line of the method. Note that _DATA and _data_init are also defined at line 12, meaning when the cursor is at line 12, it's not possible to determine which label best refers to it either.

Let me know if there's a better way of finding out where a method is defined, or if I can help with this issue.

hach-que commented 12 years ago

This issue is now fixed.