Mesen icon indicating copy to clipboard operation
Mesen copied to clipboard

Certain files almost always appear twice in debugger file dropdown.

Open cacciatc opened this issue 4 years ago • 3 comments

Mesen verion 0.9.9

I've often wondered why this is the case or maybe if there is something wonky with my build process, but the following has happened for a while: ex

The files that appear twice (*.h) all look something like the following:

;
; Generated 2018-07-27T14:18:23-07:00
;
.pushseg
.segment "CODE"

.ifndef _CORE_
_CORE_ = 1

.proc core
	.import __core_dump
	dump = __core_dump

	.import __core_install
	install = __core_install

	ERR_NO_AVAILABLE_THREADS          = $FE
	ERR_NO_AVAILABLE_METASPRITES      = $FD
	ERR_MAX_STATUS_FOR_METASPRITE     = $FC
	ERR_MAX_STATUS                    = $FB
	ERR_UNDEFINED_BANK_FOR_METASPRITE = $FA
	ERR_METASPRITE_INDEX_OVERFLOW     = $F9
	ERR_UNDEFINED_BANK_FOR_SHOT       = $F8
	ERR_BUFFER_STILL_VALID            = $F7
	ERR_UNDEFINED_VEIL_CODE           = $F6

	; everything is ok
	OK = $00
.endproc
.endif

.popseg

They are CA65 assembler with a segment def, ifdef guard, proc, and then one or more imports. I use them to expose certain memory locations and subroutines to other parts of the code.

I was just curious if anyone knew why this happened or if there is something I could change. Functionally, nothing seems to be wrong (e.g. the code doesn't appear twice in the ROM), but it does make the file dropdown a little more cumbersome with the polluting duplicates.

cacciatc avatar Feb 21 '20 19:02 cacciatc

I apologize for the closing/reopening. One shouldn't enter an issue while holding a 11 mo old who really wants to use the mouse... :)

cacciatc avatar Feb 21 '20 19:02 cacciatc

Maybe the compiler is counting it as 2 separate files since it was imported once with _CORE_ undefined, and then once with _CORE_ defined?

I'd imagine the .dbg file that's output by CA65 most likely has doubled up "file" entries for them as well. That said, though, I think I can probably ignore the duplicates fairly easily in the dropdown without altering the rest of the CA65 integration.

SourMesen avatar Feb 22 '20 02:02 SourMesen

Yep, you're right they occur twice:

file	id=17,name="./core/core.h",size=656,mtime=0x5DF3BBD9,mod=3+15+20+24+27+29
file	id=51,name="core/core.h",size=656,mtime=0x5DF3BBD9,mod=19

cacciatc avatar Feb 22 '20 04:02 cacciatc