Skip to content

Commit 627fb84

Browse files
committed
[debugger] Improve symbol auto-loading
1 parent af10797 commit 627fb84

File tree

7 files changed

+13
-10
lines changed

7 files changed

+13
-10
lines changed

MCP_README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ The server exposes tools organized in the following categories:
271271

272272
### Media & State Management
273273
- `get_media_info` - Get loaded ROM info (file path, type, size, CRC, rotation, EEPROM, BIOS status)
274-
- `load_media` - Load ROM file (.lnx, .lyx, .o, .zip). Automatically loads .sym symbol file if present
274+
- `load_media` - Load ROM file (.lnx, .lyx, .o, .zip). Automatically loads symbol file if present (.sym, .lbl, .noi)
275275
- `list_save_state_slots` - List all 5 save state slots with information (rom name, timestamp, screenshot availability)
276276
- `select_save_state_slot` - Select active save state slot (1-5) for save/load operations
277277
- `save_state` - Save emulator state to currently selected slot

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Don't hesitate to report bugs or ask for new features by [opening an issue](http
133133
### Debugging Features
134134
- **Docking Windows**: In debug mode, you can dock windows together by pressing SHIFT and dragging a window onto another.
135135
- **Multi-viewport**: In Windows or macOS, you can enable "multi-viewport" in the debug menu. You must restart the emulator for the change to take effect. Once enabled, you can drag debugger windows outside the main window.
136-
- **Debug Symbols**: The emulator automatically tries to load a symbol (.sym) file when loading a ROM. For example, for ```path_to_rom_file.rom``` it tries to load ```path_to_rom_file.sym```. You can also load symbol files using the GUI or the CLI. It supports *cc65* (VICE label file), *lyxass* (EQU) and *mads* (lab and hea) file formats.
136+
- **Debug Symbols**: The emulator automatically tries to load a symbol file when loading a ROM. For example, for ```path_to_rom_file.rom``` it tries to load ```path_to_rom_file.sym```, ```path_to_rom_file.lbl``` and ```path_to_rom_file.noi```. You can also load symbol files using the GUI or the CLI. It supports *cc65* (VICE label file), *lyxass* (EQU) and *mads* (lab and hea) file formats.
137137

138138
### Command Line Usage
139139
```

platforms/shared/README.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ Debugging Features:
9999
- Multi-viewport: In Windows or macOS, you can enable "multi-viewport" in the
100100
debug menu. You must restart the emulator for the change to take effect.
101101
Once enabled, you can drag debugger windows outside the main window
102-
- Debug Symbols: The emulator automatically tries to load a symbol (.sym) file
103-
when loading a ROM. It supports cc65 (VICE label file), lyxass (EQU) and
104-
mads (lab and hea) file formats
102+
- Debug Symbols: The emulator automatically tries to load a symbol file
103+
(.sym, .lbl, .noi) when loading a ROM. It supports cc65 (VICE label file),
104+
lyxass (EQU) and mads (lab and hea) file formats
105105

106106
MCP Server:
107107
- Gearlynx includes a Model Context Protocol (MCP) server that enables

platforms/shared/desktop/gui.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,9 @@ void gui_load_rom(const char* path)
290290

291291
std::string str(path);
292292
str = str.substr(0, str.find_last_of("."));
293-
str += ".sym";
294-
gui_debug_load_symbols_file(str.c_str());
293+
if (!gui_debug_load_symbols_file((str + ".sym").c_str()))
294+
if (!gui_debug_load_symbols_file((str + ".lbl").c_str()))
295+
gui_debug_load_symbols_file((str + ".noi").c_str());
295296

296297
gui_debug_auto_load_settings();
297298

platforms/shared/desktop/gui_debug_disassembler.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void gui_debug_reset_disassembler_bookmarks(void)
158158
bookmarks.clear();
159159
}
160160

161-
void gui_debug_load_symbols_file(const char* file_path)
161+
bool gui_debug_load_symbols_file(const char* file_path)
162162
{
163163
std::ifstream file;
164164
open_ifstream_utf8(file, file_path, std::ios::in);
@@ -221,10 +221,12 @@ void gui_debug_load_symbols_file(const char* file_path)
221221
}
222222

223223
file.close();
224+
return true;
224225
}
225226
else
226227
{
227228
Debug("Symbol file %s not found", file_path);
229+
return false;
228230
}
229231
}
230232

platforms/shared/desktop/gui_debug_disassembler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ EXTERN void gui_debug_disassembler_reset(void);
4141
EXTERN void gui_debug_reset_symbols(void);
4242
EXTERN void gui_debug_reset_breakpoints(void);
4343
EXTERN void gui_debug_reset_disassembler_bookmarks(void);
44-
EXTERN void gui_debug_load_symbols_file(const char* file_path);
44+
EXTERN bool gui_debug_load_symbols_file(const char* file_path);
4545
EXTERN void gui_debug_toggle_breakpoint(void);
4646
EXTERN void gui_debug_add_bookmark(void);
4747
EXTERN void gui_debug_add_symbol(void);

platforms/shared/desktop/mcp/mcp_server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ void McpServer::HandleToolsList(const json& request)
751751
tools.push_back({
752752
{"name", "load_media"},
753753
{"title", "Load ROM"},
754-
{"description", "Load a ROM file (.lnx, .lyx, .o, .zip). Automatically loads .sym symbol file if present. Resets emulator on successful load"},
754+
{"description", "Load a ROM file (.lnx, .lyx, .o, .zip). Automatically loads symbol file if present (.sym, .lbl, .noi). Resets emulator on successful load"},
755755
{"inputSchema", {
756756
{"type", "object"},
757757
{"properties", {

0 commit comments

Comments
 (0)