decomp.me icon indicating copy to clipboard operation
decomp.me copied to clipboard

Errors in main file showing the lines in the context file [DS heartgold preset]

Open adrienntindall opened this issue 2 years ago • 8 comments

image

adrienntindall avatar Jun 27 '23 22:06 adrienntindall

can comfirm this also happens in diamond, it's likely for all DS compiler versions

red031000 avatar Jun 27 '23 22:06 red031000

In the example, the 5th line of context.c is being shown instead of code.c, when the error is in code.c

adrienntindall avatar Jun 27 '23 22:06 adrienntindall

We use a #line directive to tell the compiler when code.c begins: https://github.com/decompme/decomp.me/blob/576b0006f40a2a5d4fda9e8d5465c5faaf2c9f04/backend/coreapp/compiler_wrapper.py#L148-L154

This is likely a bug in your compiler - does it support #line?

bates64 avatar Jul 03 '23 08:07 bates64

Also note this part further down: https://github.com/decompme/decomp.me/blob/576b0006f40a2a5d4fda9e8d5465c5faaf2c9f04/backend/coreapp/compiler_wrapper.py#L158-L161C33 If is_mwcc isn't set for your compiler that could be the problem, but it could also be that that workaround isn't particularly stable...

simonlindholm avatar Jul 03 '23 14:07 simonlindholm

this is for the compilers already on site, not for local testing, assuming that everything was set up correctly, then it's likely that the workaround doesn't work, as for #line, I wouldn't be surprised if it didn't work, because mwcc is very tempremental and old, and we often come across things that should work, but don't, ofc I haven't tested this, so it could potentially work just fine, and there's another issue

red031000 avatar Jul 03 '23 23:07 red031000

Can you run the following with the compiler locally?

#line 100 "it_works.c"
#error If this comes from it_works.c, it works!

e.g. clang test.c gives

it_works.c:100:2: error: If this comes from it_works.c, it works!
#error If this comes from it_works.c, it works!
 ^
1 error generated.

bates64 avatar Jul 04 '23 08:07 bates64

(and the same with touch it_works.c first, to check if the workaround works)

simonlindholm avatar Jul 04 '23 08:07 simonlindholm

This was possibly fixed in #828, I'd assumed #505 meant it already wasn't an issue on the ds compilers but this does sound like the same thing I was getting for the wii ones

(The existing workaround was just for DWARF line numbers, not error messages)

SeekyCt avatar Sep 02 '23 09:09 SeekyCt

@adrienntindall do you see this still happening? wondering if we can close this now

ethteck avatar May 20 '24 11:05 ethteck

feel free to report here if it's still an issue

ethteck avatar May 21 '24 06:05 ethteck

just checked, this does appear to be fixed indeed, thanks

red031000 avatar May 21 '24 09:05 red031000