Debugger in MSX-DOS

Page 1/2
| 2

By Briqunullus

Master (174)

Briqunullus's picture

01-10-2020, 09:18

I tried the openMSX debugger with a small application under MSX-DOS. However, the memory layout and code view in the debugger show the BIOS in page 0. If I try to set a break point to address $100 (even in any slot) it won't work. Which piece of the puzzle did I just miss?

Login or register to post comments

By Manuel

Ascended (16961)

Manuel's picture

01-10-2020, 13:27

didn't the break point trigger? I just tried it myself and the break point did trigger. But the disassembly was not OK. I worked around that by doing step-into and then step-back.

By Briqunullus

Master (174)

Briqunullus's picture

01-10-2020, 20:01

No it doesn't trigger. Or I should say, after fiddling around I managed to get it triggered exactly once. But I can't reproduce that anymore. I'm puzzled.

Is it possible to change the memory layout in the debugger? To view what is outside the current scope? As for now, I can't even check if the breakpoint has been set at all...

By Grauw

Ascended (9337)

Grauw's picture

01-10-2020, 20:08

Probably you paused or set the breakpoint during the interrupt or key input handling.

If I want to set a breakpoint on program start I usually trigger it from code by OUT-ing to an I/O port with a watchpoint at the start of the program. What can also work is pausing / resuming until you are not in the BIOS. Or stepping forward / back (usually a lot of clicks though).

Probably something more clever can be done by hooking into DOS somehow to make it trigger at the point where it is about to execute the program, but I’ve never looked into it.

By Briqunullus

Master (174)

Briqunullus's picture

01-10-2020, 22:27

All I do is boot from a MSX-DOS disk. Open the debugger, connect and set a breakpoint at $100. Then when I run my program I expect the breakpoint to be triggered so I can verify what it's doing.

I'll check out your other suggestions tomorrow.

By Manuel

Ascended (16961)

Manuel's picture

01-10-2020, 22:56

I did just that. Boot to MSX-DOS, connect, then in the debugger Breakpoint -> Add, $0100. Then I run command.com again and it triggers.

By mcolom

Expert (112)

mcolom's picture

02-10-2020, 00:42

Briqunullus wrote:

All I do is boot from a MSX-DOS disk. Open the debugger, connect and set a breakpoint at $100. Then when I run my program I expect the breakpoint to be triggered so I can verify what it's doing.

It works fine for me.
You can also check in the openMSX terminal (F10) that the BP is actually set, with debug list_bp.

By saccopharynx

Master (150)

saccopharynx's picture

02-10-2020, 01:41

I know what Briqunullus is talking about. It happens to me all the time and it is indeed very frustrating, and eventually, I get it to trigger!!!! This is an odd and very old issue that I have seen for a long time!!!

From my experience, I think that, perhaps, it is related to what is actually connected to the page associated with address space where the breakpoint is set, at the particular moment you do so. For example, if the BIOS is connected to Page 0 when you set the breakpoint, it won't be triggered when MSX-DOS connects a segment of the memory mapper.

By Manuel

Ascended (16961)

Manuel's picture

02-10-2020, 07:36

So, does it depend on the used MSX machine?

By saccopharynx

Master (150)

saccopharynx's picture

02-10-2020, 12:21

I couldn't exactly tell you. However, I mostly emulate a Talent TPC-310, and I guess Briqunullus emulates a different machine, so, in my opinion, the issue probably has nothing to do with the emulated hardware!

By Briqunullus

Master (174)

Briqunullus's picture

02-10-2020, 14:11

@mcolom Thanks for that 'debug list_bp' comment. That put me on track. I have found the missing piece of the puzzle...

There are three parameters for breakpoints (besides the address of course): slot, subslot and segment. I was kind of ignoring the segment part, thinking I wouldn't need that. My bad. If segment is set to any as well, the breakpoint will happily trigger all the time. Cool

Page 1/2
| 2