dMZX Forums: MZX Debugging Package - dMZX Forums

Jump to content

If you are new to DMZX, please take the time to look over the FAQ pinned in General before asking a question.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

MZX Debugging Package Help me fix bugs..

#1 User is offline   ajs 

  • carpe diem
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,614
  • Joined: 21-October 00
  • Gender:Male
  • Location:United Kingdom

Posted 02 January 2008 - 01:15 AM

Hi,

One thing that generally sucks about MegaZeux is that if you actually use it for any real length of time, it can crash. Backups help reduce the severity of crashes, but it's still very annoying.

Since I took over maintenance of MegaZeux at 2.81c, there have been ~50 crash bugs fixed. However, it is likely that many bugs still remain, and the recent DoZ showed up a couple bugs that plagued almost everybody that competed, and which still remain unfixed in (but not introduced by) 2.81h:
  • the Block Action menu (in the robot editor) crashes at random;
  • the F1 help system crashes at random.
Unlike many of the other bugs in MegaZeux, I have been unsuccessful reproducing these two reliably. For me, no amount of entering and exiting the Block Action or F1 help system in a blank or non-blank world causes crashes. So in these cases, there is obviously some subtle interaction between these processes and previous actions that is not easy to reproduce.

Debugging Package

This is where the MZX Debugging Package comes in. In reality, is it not one package but several packages which ordinary users can install and run, without having to build MZX from source. Three things are needed for a successful debugging session:
  • a debugger, in this case the GNU debugger;
  • a version of MZX compiled with debug symbols present;
  • a matching source package for the "debug" binary.
The new MegaZeux Developers website provides so called "nightly" builds of MegaZeux from the very latest development sources. These packages are larger because they contain debugging information, and may be slightly slower. They are also not recommended for day-to-day use, however they should remain largely compatible with the previous stable version.

If you wish to help the cause, and see these kinds of bugs fixed, you need to download a recent nightly version of both the source code and binary (x86) packages; e.g. today you would download both mzxsvn-x86-495.zip and mzxsvnsrc-495.tar.bz2.

You also need to do a one-time download of GDB from the MinGW project page (GDB section). The latest version of GDB at the time of this post was gdb-6.7.50.20071127-mingw.tar.bz2. The source package is not necessary.

Extract the source package (e.g. mzxsvnsrc-495.tar.bz2) using WinRAR, 7ZIP or another compatible extractor. You should find the directory "mzxsvn" somewhere. Then, extract only "mzxsvn.exe" and "SDL.dll" from the binary package (e.g. mzxsvn-x86-495.zip) and place these files in the "mzxsvn" directory. Finally, extract "gdb.exe" from the GDB package (e.g. gdb-6.7.50.20071127-mingw) and place it in the "mzxsvn" directory.

Finally, drag the "mzxsvn.exe" file over the "gdb.exe" file to start MegaZeux inside the debugger. Enter "run" to proceed:

Posted Image
(Starting MegaZeux from inside GDB [Windows Vista])

Then, if/when MegaZeux crashes, type "bt" to generate a backtrace. This is the information that you should post on the Bug Report thread, but I may ask you for other information later:

Posted Image
(MegaZeux crashing (SIGSEGV) and GDB backtracing the problem [Windows Vista])

MegaZeux should continue to run at a moderately acceptable speed in the debugger, so it would be ideal if people with regular problems could temporarily switch over to these builds and continuously run MZX inside the debugger. This offers us the greatest opportunity to fix these bugs. Thanks in advance.

--ajs.
0

#2 User is offline   Spectere 

  • Resident Spectere Fanboy
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 3,111
  • Joined: 18-June 04
  • Gender:Male
  • Location:Struthers, OH, USA

Posted 02 January 2008 - 02:39 AM

Thank you for helping us help you help us all. :D

I'll be sure to run MegaZeux like this from now on.
:)
0

#3 User is offline   Old-Sckool 

  • megazeux breaker
  • PipPipPipPip
  • Group: Members
  • Posts: 649
  • Joined: 07-June 05
  • Gender:Male

Posted 02 January 2008 - 03:58 AM

I'LL JOIN.
Hopefully, I'll use MZX more to be able to help out.



'there is no warranty, just type "show warranty" to see for yourself'

This post has been edited by Old-Sckool: 02 January 2008 - 03:59 AM

<Nadir> mzxers don't make GAMES, usually
<phthalocyanine> they make experiences.
<Nadir> demos, more like
<Nadir> a glimpse into what could have been if mzx wasn't such a bore to work with
<Nadir> actually, i'm being unfair
<Nadir> i would have made mzx games if it was capable of running on more than 20 computers worldwide in 1998
<Nadir> >:D

<%Alice> functor
<%nooodl> i hear C++ has a thing called functors and they're completely different from Haskell functors...
<rorirover> the result is the most horrid thing in C++, it's basically black magic and it transforms any code you're writing into some eldritch monstrosity
0

#4 User is offline   Why-Fi 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 336
  • Joined: 21-October 07
  • Gender:Male
  • Location:Portugal

Post icon  Posted 02 January 2008 - 12:15 PM

I wanted to test it, but it has almost killed my computer! When I tried to drag mzxsvn.exe to gdb.exe, it appeared a Blue Screen of Death and I almost had an heart attack! You guys, be careful! If you kill my Vista, you get to pay every damage!
Posted Image
0

#5 User is offline   ajs 

  • carpe diem
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,614
  • Joined: 21-October 00
  • Gender:Male
  • Location:United Kingdom

Posted 02 January 2008 - 12:21 PM

That'd be the Why-Fi detection I put in:
if (why_fi)
  bluescreen();

Devious!

--ajs.
0

#6 User is offline   Old-Sckool 

  • megazeux breaker
  • PipPipPipPip
  • Group: Members
  • Posts: 649
  • Joined: 07-June 05
  • Gender:Male

Posted 02 January 2008 - 11:07 PM

so MZX crashes, All I do is write out this?

Program recieved signal SIGSEGV, Segmentation Fault
#0 0x0000005b in ?? <>
#1 0x00419513 in update_screen <> at src/graphics.c:565
Bactrace Stopped: frame did not save the PC


also, how do I print out the text?
<Nadir> mzxers don't make GAMES, usually
<phthalocyanine> they make experiences.
<Nadir> demos, more like
<Nadir> a glimpse into what could have been if mzx wasn't such a bore to work with
<Nadir> actually, i'm being unfair
<Nadir> i would have made mzx games if it was capable of running on more than 20 computers worldwide in 1998
<Nadir> >:D

<%Alice> functor
<%nooodl> i hear C++ has a thing called functors and they're completely different from Haskell functors...
<rorirover> the result is the most horrid thing in C++, it's basically black magic and it transforms any code you're writing into some eldritch monstrosity
0

#7 User is offline   Kom 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 611
  • Joined: 05-March 07
  • Gender:Male

Posted 03 January 2008 - 02:25 AM

I will be sure to use this for a while.
0

#8 User is offline   Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,949
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 06 September 2011 - 07:46 PM

Why the heck isn't this thing pinned?
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
0

#9 User is offline   Graham 

  • . "@Master Procrastinator"
  • PipPipPipPip
  • Group: Members
  • Posts: 626
  • Joined: 28-December 12
  • Gender:Male
  • Location:Oregon

Posted 20 November 2013 - 05:32 AM

Ok, I'd like to help out if I can but I may need some assistance first. Is the information at top still relevant? Where do I download this GDB at? I went to the MinGW link and wasn't sure what to download. I tried this: "Looking for the latest version? Download mingw-get-setup.exe (86.5 kB)" and installed it but I'm lost about what to do once it is open.

I went to the MegaZeux Developers website and tried to download the nightly source/binary snapshots. I looked in the latest Trunk and Debytecode folders. each has a source folder, inside that is "mzxgitsrc.tar.xz" which, when unzipped with 7zip contained "mzxgitsrc.tar" I'm stuck here because I don't know what to do with this. Do I open it with the MinGW program?

My dim understanding is that I'm supposed to run the source inside a GDB (debugger) to track bugs, then run the backtrace and post it to the bug report thread if it crashes. I'm just not sure how to get all of this going. Any help is greatly appreciated. Also, I'm sorry for my lack of understanding, this is way out of my territory.
Currently working on Servo for MegaZeux, I hope to complete it by the middle of 2015? Who knows...

"Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you’re a mile away and you have their shoes."
-Jack Handey
1

#10 User is offline   Terryn 

  • ******
  • Group: DigiStaff
  • Posts: 2,966
  • Joined: 12-October 00
  • Gender:Male

Posted 21 November 2013 - 11:25 PM

1) GDB is now HERE. Grab the bin archive.
2) .tar is another archive format, essentially conglomorating all files into one with no compression (a "tarball"). This is why one'd commonly see things like .tar.bz2 or .tar.xz; they're different compression formats for tarballs. You need to extract files from the actual .tar.
3) GDB is what you need to load, not MZX, and mingw is not needed at all. While the instructions above tell you how to do it via file explorer, you can also open up the command prompt and load GDB.exe in it. If GDB's in a different directory than MZX you need to tell GDB where MZX is once you've loaded it ("cd Z:/whatever"), and you also have to tell GDB what it needs to load ("file megazeux.exe").
angelic stream - shed sanguine - ill-adapt - avis - para/lyser - renaissance - dead tangent - phosphene blur - birth breeds death - ________ - painted glass - lagniappe

<Exophase> HES STEALING MAH AIRSHIP!!!!!!11111111
0

#11 User is offline   Graham 

  • . "@Master Procrastinator"
  • PipPipPipPip
  • Group: Members
  • Posts: 626
  • Joined: 28-December 12
  • Gender:Male
  • Location:Oregon

Posted 23 November 2013 - 05:48 AM

Thank you for the help Terryn, I'm getting closer. I downloaded GDB and ran it through command prompt. I can't get it to load MegaZeux though. when I type "file MegaZeux.exe" at the (gdb) command line I get this message: ("c:\~long file path~\MegaZeux.exe": not in executable format: File format not recognized.

Am I supposed to use GDB to load the current version of MegaZeux I'm using or download a different one? I tried downloading the current debytecode and trunk versions but that didn't yield me any different results.
Currently working on Servo for MegaZeux, I hope to complete it by the middle of 2015? Who knows...

"Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you’re a mile away and you have their shoes."
-Jack Handey
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users