Added stack walker

Originally committed to SVN as r92.
This commit is contained in:
Rodrigo Braz Monteiro 2006-02-21 05:26:13 +00:00
parent e41b6f9988
commit 88df752e48
4 changed files with 81 additions and 27 deletions

View file

@ -19,26 +19,27 @@ Please visit http://aegisub.net to download latest version
- Implemented FexTracker, for automatically tracking positions on the video and placing text accordingly (Tentacle)
- Drag-and-drop files onto the program no longer causes the subs to be unloaded every time, even if no subs were dropped (jfs)
- 1,1+2 recombining lines where 1 is a substring of 2 no longer causes incorrect behavior. 1+2,2 similarly fixed. This fix also gives more sanity-checking in the recombining (jfs)
- Replaced the subtitles grid with a custom control, which should hopefully behave and look better (AMZ)
- Currently active line is now highlighted with a border in the grid (AMZ)
- The subtitles grid can no longer receive focus (AMZ)
- Toolbar will now properly disable the Jump To buttons if more than one line is selected (AMZ)
- Fixed the toolbar "grey area" glitch (was actually a wxWidgets issue) (AMZ)
- Default video zoom can now be set in config.dat and is defaulted to 100% (AMZ)
- Fixed crash in Translation and Styling assistants, when you attempted to move past end of file, and then play (AMZ)
- Fixed linked commit of times, so it will only commit both times if the other was changed (to prevent damage when editing multiple lines) (AMZ)
- Fixed bug related to tag cycling, which would reset grid, move video and force a refresh of everything (slow, and could undo uncommited changes) (AMZ)
- Fixed some bugs related to inserting overrides via the buttons over the edit box (AMZ)
- Implemented Redo (AMZ)
- Fonts collector will now default collection to same folder as script (Set to "?script" on config.dat) (AMZ)
- Alt+Left/Right on the video seek bar will now seek by increments of 10 frames (increment is customizeable in config.dat) (AMZ)
- Added a simple audio resync method for video playback (AMZ)
- Audio timing will now apply to all selected lines, as well as active line (AMZ)
- Rows colliding with the currently active one will now be highlighted in grid (AMZ)
- Selected comments are now highlighted in a different color (AMZ)
- Added a volume slider bar to audio mode (AMZ)
- Fixed behavior of deleting and joining lines on subtitles grid (AMZ)
- Fixed some internal workings, which should make Aegisub use considerably less RAM (especially for large Karaoke files, 3x less RAM usage measured) (AMZ)
- Replaced the subtitles grid with a custom control, which should hopefully behave and look better. (AMZ)
- Currently active line is now highlighted with a border in the grid. (AMZ)
- The subtitles grid can no longer receive focus. (AMZ)
- Toolbar will now properly disable the Jump To buttons if more than one line is selected. (AMZ)
- Fixed the toolbar "grey area" glitch (was actually a wxWidgets issue). (AMZ)
- Default video zoom can now be set in config.dat and is defaulted to 100%. (AMZ)
- Fixed crash in Translation and Styling assistants, when you attempted to move past end of file, and then play. (AMZ)
- Fixed linked commit of times, so it will only commit both times if the other was changed (to prevent damage when editing multiple lines). (AMZ)
- Fixed bug related to tag cycling, which would reset grid, move video and force a refresh of everything (slow, and could undo uncommited changes). (AMZ)
- Fixed some bugs related to inserting overrides via the buttons over the edit box. (AMZ)
- Implemented Redo. (AMZ)
- Fonts collector will now default collection to same folder as script (Set to "?script" on config.dat). (AMZ)
- Alt+Left/Right on the video seek bar will now seek by increments of 10 frames (increment is customizeable in config.dat). (AMZ)
- Added a simple audio resync method afor video playback. (AMZ)
- Audio timing will now apply to all selected lines, as well as active line. (AMZ)
- Rows colliding with the currently active one will now be highlighted in grid. (AMZ)
- Selected comments are now highlighted in a different color. (AMZ)
- Added a volume slider bar to audio mode. (AMZ)
- Fixed behavior of deleting and joining lines on subtitles grid. (AMZ)
- Fixed some internal workings, which should make Aegisub use considerably less RAM (especially for large Karaoke files, 3x less RAM usage measured). (AMZ)
- Aegisub will now dump the stack to stack.txt when it crashes with a fatal exception, which might or might not work. (AMZ)
= 1.09 beta - 2006.01.16 ===========================

View file

@ -38,6 +38,7 @@
// Includes
#include "dialog_hotkeys.h"
#include "frame_main.h"
#include "main.h"
///////////////

View file

@ -77,9 +77,9 @@ bool AegisubApp::OnInit() {
// App name
SetAppName(_T("Aegisub"));
#ifndef _DEBUG
//#ifndef _DEBUG
wxHandleFatalExceptions(true);
#endif
//#endif
// Set config file
GetFullPath(argv[0]);
@ -133,13 +133,16 @@ bool AegisubApp::OnInit() {
}
#ifndef _DEBUG
//#ifndef _DEBUG
///////////////////////
// Unhandled exception
void AegisubApp::OnUnhandledException() {
// Attempt to recover file
wxFileName orig(AssFile::top->filename);
wxString filename = folderName + orig.GetName() + _T(".RECOVER.ass");
AssFile::top->Save(filename,false,false);
// Inform user of crash
wxMessageBox(_T("Aegisub has encountered an unhandled exception error and will terminate now. The subtitles you were working on were saved to \"") + filename + _T("\", but they might be corrupt."), _T("Unhandled exception"), wxOK | wxICON_ERROR, NULL);
}
@ -147,12 +150,46 @@ void AegisubApp::OnUnhandledException() {
///////////////////
// Fatal exception
void AegisubApp::OnFatalException() {
// Attempt to recover file
wxFileName orig(AssFile::top->filename);
wxString filename = folderName + orig.GetName() + _T(".RECOVER.ass");
AssFile::top->Save(filename,false,false);
wxMessageBox(_T("Aegisub has encountered a fatal error and will terminate now. The subtitles you were working on were saved to \"") + filename + _T("\", but they have a considerable chance of being corrupt."), _T("Fatal error"), wxOK | wxICON_ERROR, NULL);
// Stack walk
StackWalker walker;
walker.WalkFromException();
// Inform user of crash
wxMessageBox(_T("Aegisub has encountered a fatal error and will terminate now. The subtitles you were working on were saved to \"") + filename + _T("\", but they might be corrupt."), _T("Fatal error"), wxOK | wxICON_ERROR, NULL);
}
//#endif
////////////////
// Stack walker
void StackWalker::OnStackFrame(const wxStackFrame &frame) {
wxString dst = wxString::Format(_T("%03i - 0x%08X: "),frame.GetLevel(),frame.GetAddress()) + frame.GetName() + _T(" on ") + frame.GetFileName() + wxString::Format(_T(":%i"),frame.GetLine());
char temp[2048];
if (file.is_open()) {
strcpy(temp,dst.mb_str());
file << temp << std::endl;
}
else wxLogMessage(dst);
}
StackWalker::StackWalker() {
file.open(wxString(AegisubApp::folderName + _T("/stack.txt")).mb_str(),std::ios::out | std::ios::app);
if (file.is_open()) {
file << std::endl << "Begining stack dump:\n";
}
}
StackWalker::~StackWalker() {
if (file.is_open()) {
file << "End of stack dump.\n\n";
file.close();
}
}
#endif
//////////////////

View file

@ -41,6 +41,8 @@
///////////////////
// Include headers
#include <wx/wxprec.h>
#include <wx/stackwalk.h>
#include <fstream>
#include "aegisublocale.h"
@ -71,14 +73,27 @@ public:
bool OnInit();
int OnRun();
#ifndef _DEBUG
//#ifndef _DEBUG
void OnUnhandledException();
void OnFatalException();
#endif
//#endif
//int OnRun();
DECLARE_EVENT_TABLE()
};
////////////////
// Stack walker
class StackWalker: public wxStackWalker {
private:
std::ofstream file;
public:
StackWalker();
~StackWalker();
void OnStackFrame(const wxStackFrame& frame);
};
#endif