|
Joined: Mar 2001
Posts: 16,892 Likes: 51
Very Senior Member
|
Very Senior Member
Joined: Mar 2001
Posts: 16,892 Likes: 51 |
Had to back out the change. It caused the debugger to seize control of KDE's virtual desktops and not allow me to switch over to, for instance, my Win7 VMWare instance. And that's unfortunately a much worse violation of my workflow than 'source' being broken. Maybe Andrew can come up with a real fix given these hints though  qmc2: you ever seen that kind of weird behavior from Qt?
Last edited by R. Belmont; 05/24/14 02:42 AM.
|
|
|
|
Joined: Jan 2012
Posts: 877 Likes: 7
Senior Member
|
Senior Member
Joined: Jan 2012
Posts: 877 Likes: 7 |
On Windows it wouldn't allow any other debugger windows to get focus while stopped. Putting,
if(firststop)
bring_main_window_to_front();
at line 281 fixes it.
|
|
|
|
Joined: Mar 2001
Posts: 16,892 Likes: 51
Very Senior Member
|
Very Senior Member
Joined: Mar 2001
Posts: 16,892 Likes: 51 |
Ok, that fixes my Linux problems too. Nicely spotted 
|
|
|
|
Joined: Apr 2010
Posts: 57
Member
|
OP
Member
Joined: Apr 2010
Posts: 57 |
Has anyone else ever experienced having running behavior of a driver change just as a result of having a watchpoint set, even if the watchpoint is never triggered?
|
|
|
|
Joined: Apr 2004
Posts: 1,556
Very Senior Member
|
Very Senior Member
Joined: Apr 2004
Posts: 1,556 |
Yes, this usually happens with read handlers that have side effects like clearing IRQs. Then the debugger is actually the one triggering the side effect instead of the emulated system.
|
|
|
|
Joined: Apr 2010
Posts: 57
Member
|
OP
Member
Joined: Apr 2010
Posts: 57 |
I have some write watchpoints set up to try and catch when a pointer in the driver's ram gets corrupted. None of the watchpoints get triggered, because before execution reaches them a different pointer gets corrupted, but only when the watchpoints are set. If I never set the watchpoints, this other pointer never gets corrupted.
|
|
|
|
Joined: Mar 2001
Posts: 16,892 Likes: 51
Very Senior Member
|
Very Senior Member
Joined: Mar 2001
Posts: 16,892 Likes: 51 |
You may need to find the real address of that RAM and use an external-to-MAME memory breakpoint (MSVC, GDB, and LLDB all have facilities for this).
|
|
|
|
Joined: Apr 2010
Posts: 57
Member
|
OP
Member
Joined: Apr 2010
Posts: 57 |
Bugger, not looking forward to sorting this out. In the program in question, the issue comes from a garbage value of a pointer being dereferenced. This value happens to be unaligned which causes a memory exception fault in the emulated CPU (MIPS). However, it is very difficult to predict where this pointer is stored, as in the emulated program, it exists within a dynamically allocated object on the heap. Furthermore, the program periodically moves things around on the heap to compact/defrag the dynamic memory pool. I suspect the issue may come from an incomplete copy of a dynamic object leaving garbage values in the new location, but I have not been able to trace this, as the issue only seems to occur once for every few hundred operations. The bug seems to be mostly deterministic however, as I can get the same garbage value in the same memory location triggering the memory exception sometimes. If anyone has any suggestions on how to simplify this task, I would appreciate the help.
|
|
|
|
Joined: Dec 2007
Posts: 301
Senior Member
|
Senior Member
Joined: Dec 2007
Posts: 301 |
Happy,
If you actually know the location of the code you are trying to check, don't use the watch points. Just change the code so that it goes into a loop. With the program trapped in a loop, you can start the debugger and check the contents of any registers or memory.
I don't know what cpu is in your system, but a simple trap in MC6809 code could be: loop bra loop
|
|
|
|
Joined: Mar 2001
Posts: 16,892 Likes: 51
Very Senior Member
|
Very Senior Member
Joined: Mar 2001
Posts: 16,892 Likes: 51 |
For MIPS you'll get more repeatable behavior using the interpreter, but you probably already knew that.
|
|
|
Forums9
Topics9,071
Posts118,945
Members5,014
|
Most Online890 Jan 17th, 2020
|
|
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!
|
|
|
|