FCEUX and Mesen conflict over the .dbg extension
Moderator: Moderators
FCEUX and Mesen conflict over the .dbg extension
The full-featured debugger of Mesen-X expects ld65 debug symbols to be named the same as the NES program, with .nes replaced with .dbg. This file contains a list of all symbols in the program. Mesen takes a few seconds to start under Mono 6.8.0.105 on Ubuntu on a ThinkCentre with a Core i3 4130 CPU, and opening Mesen's debugger with a .dbg file containing a full 512 KiB program's worth of debug symbols took about 10 seconds last I checked. Mesen can reload the ROM, which saves some but not all time and incurs an increased risk of either an exception in C# code or a SIGSEGV in native code.
For faster iteration, I often use FCEUX Qt instead of Mesen for quick tests of changes to game logic, where FCEUX's reduced accuracy in timing corner cases is acceptable. However, FCEUX writes its own unrelated debugging information, a list of breakpoints that the user has set. This file is also named the same as the NES program, with .nes replaced with .dbg. Because this is the same name as the conventional name for the ld65 debug file, setting a breakpoint in FCEUX causes FCEUX to overwrite the file, which causes the next run in Mesen to go without debugging symbols. In addition, I can't keep breakpoints from one build to the next because rebuilding the ROM overwrites FCEUX's breakpoint file with the ld65 debug file.
Is there a way to resolve this conflict other than not using FCEUX or not using Mesen?
For faster iteration, I often use FCEUX Qt instead of Mesen for quick tests of changes to game logic, where FCEUX's reduced accuracy in timing corner cases is acceptable. However, FCEUX writes its own unrelated debugging information, a list of breakpoints that the user has set. This file is also named the same as the NES program, with .nes replaced with .dbg. Because this is the same name as the conventional name for the ld65 debug file, setting a breakpoint in FCEUX causes FCEUX to overwrite the file, which causes the next run in Mesen to go without debugging symbols. In addition, I can't keep breakpoints from one build to the next because rebuilding the ROM overwrites FCEUX's breakpoint file with the ld65 debug file.
Is there a way to resolve this conflict other than not using FCEUX or not using Mesen?
Re: FCEUX and Mesen conflict over the .dbg extension
Have your build script make a copy of the output .nes file with a slightly different name for use with FCEUX? One ROM for each emulator, basically.
- rainwarrior
- Posts: 8734
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: FCEUX and Mesen conflict over the .dbg extension
I thought FCEUX always used ".deb" as its debug extension? When did this change? I think this would be worth filing an issue over... especially since FCEUX creates its own file and it's not supplied by the user, it should not be difficult to change back.
Edit: the FCEUX 264 release seems to still use DEB for me, and I am having trouble finding any reference to a DBG extension in the code?
Edit: Hmm, it seems to the the QT version only that does this, the regular version does not have this problem.
Edit: the FCEUX 264 release seems to still use DEB for me, and I am having trouble finding any reference to a DBG extension in the code?
Edit: Hmm, it seems to the the QT version only that does this, the regular version does not have this problem.
Re: FCEUX and Mesen conflict over the .dbg extension
You guessed right that FCEUX Win32 uses .nes.deb and FCEUX Qt uses .dbg.
Speculation: The difference may have something to do with dpkg used on Debian and Ubuntu, which also uses .deb.
Speculation: The difference may have something to do with dpkg used on Debian and Ubuntu, which also uses .deb.
Re: FCEUX and Mesen conflict over the .dbg extension
A combination of what tokumaru said, plus using a script or a batch file to launch the respective emulators (so the emulator automatically loads the correct rom file) seems like a safe way to go.
To get fancier, you could set up a script which does something like this:
To get fancier, you could set up a script which does something like this:
- Find "xxx-fceux.dbg" and rename to "xxx.dbg"
- Run fceux with xxx.nes
- Wait until fceux closes
- Find "xxx.dbg" and rename to "xxx-fceux.dbg"
- rainwarrior
- Posts: 8734
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: FCEUX and Mesen conflict over the .dbg extension
I'd still suggest it in an issue. I think this naming conflict is a valid problem. Not just for Mesen but this is very common cc65 usage at this point. (Maybe would affect Nintendulatordx users as well?)
Since the file is not user-selected to begin with, changing the extension should be easy for qfceux. Maybe "fdb" or "qfd" or something would be suitable?
Since the file is not user-selected to begin with, changing the extension should be easy for qfceux. Maybe "fdb" or "qfd" or something would be suitable?
Re: FCEUX and Mesen conflict over the .dbg extension
How about just ".fceuxdebug", might be a tad long, but extensions aren't limited to 3 characters anymore.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Re: FCEUX and Mesen conflict over the .dbg extension
This is just hilarious. I didn't expect Mesen's code to be that terrible.tepples wrote: ↑Thu Dec 29, 2022 9:18 am opening Mesen's debugger with a .dbg file containing a full 512 KiB program's worth of debug symbols took about 10 seconds last I checked. Mesen can reload the ROM, which saves some but not all time and incurs an increased risk of either an exception in C# code or a SIGSEGV in native code.
Re: FCEUX and Mesen conflict over the .dbg extension
Well... what is the C# exception?
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
- rainwarrior
- Posts: 8734
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: FCEUX and Mesen conflict over the .dbg extension
IIRC, Mesen had a bug that crashed if you put a breakpoint on a line that had a multi-line comment attached. That seemed to be the one crash cause that I ran into most frequently. Unfortunately this cause wasn't discovered until long after Sour hit pause on the project.
Re: FCEUX and Mesen conflict over the .dbg extension
I think Mkwong and novasquirrel currently maintain the emulator? (Though there is no link from the author's frozen github page)
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
- rainwarrior
- Posts: 8734
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: FCEUX and Mesen conflict over the .dbg extension
This is NovaSquirrel's fork: https://github.com/NovaSquirrel/Mesen-X
Sour hasn't abandoned the project, but current development progress is private with no ETA... so with that in mind, the forks are probably somewhat of a temporary, provisional thing.
Sour hasn't abandoned the project, but current development progress is private with no ETA... so with that in mind, the forks are probably somewhat of a temporary, provisional thing.
Re: FCEUX and Mesen conflict over the .dbg extension
I'll try to remember to report a Mesen exception here next time I get one, in order to gauge whether it's worth reporting to Nova as an issue.
Re: FCEUX and Mesen conflict over the .dbg extension
The Qt version of fceux uses the .dbg extension because I arbitrarily chose it. The .deb extension was already used by Debian/Ubuntu so I wanted something different. I also changed the format of that debug file to be human readable text instead of the binary format previously used by the win32 fceux. I wanted to keep the extensions separate because I would routinely run the win32 and Qt/SDL versions side by side to compare behaviors when I was developing. There is no reason that extension identifier can’t be changed. I like the .fdb suggestion. I’m sure if someone creates an issue on the GitHub site, that someone will fix it.