diff -Nru openmsx-debugger-0.1~git20170806/build/msvc/openmsx-debugger.sln openmsx-debugger-0.1~git20200913/build/msvc/openmsx-debugger.sln --- openmsx-debugger-0.1~git20170806/build/msvc/openmsx-debugger.sln 2017-06-09 22:27:57.000000000 +0000 +++ openmsx-debugger-0.1~git20200913/build/msvc/openmsx-debugger.sln 2019-11-05 19:57:56.000000000 +0000 @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2035 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openmsx-debugger", "openmsx-debugger.vcxproj", "{A9B5A99F-45C3-4BF9-B596-568F082A59D6}" EndProject @@ -25,4 +25,7 @@ GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {2ABAA41E-895B-48B7-9665-752AAC63C190} + EndGlobalSection EndGlobal diff -Nru openmsx-debugger-0.1~git20170806/build/msvc/openmsx-debugger.vcxproj openmsx-debugger-0.1~git20200913/build/msvc/openmsx-debugger.vcxproj --- openmsx-debugger-0.1~git20170806/build/msvc/openmsx-debugger.vcxproj 2017-06-09 22:27:57.000000000 +0000 +++ openmsx-debugger-0.1~git20200913/build/msvc/openmsx-debugger.vcxproj 2019-11-05 19:57:56.000000000 +0000 @@ -21,23 +21,24 @@ {A9B5A99F-45C3-4BF9-B596-568F082A59D6} wxCatapult + 10.0 Application - v141 + v142 Application - v141 + v142 Application - v141 + v142 Application - v141 + v142 diff -Nru openmsx-debugger-0.1~git20170806/build/package-darwin/Info.plist openmsx-debugger-0.1~git20200913/build/package-darwin/Info.plist --- openmsx-debugger-0.1~git20170806/build/package-darwin/Info.plist 2017-06-09 22:27:57.000000000 +0000 +++ openmsx-debugger-0.1~git20200913/build/package-darwin/Info.plist 2019-11-05 19:57:56.000000000 +0000 @@ -1,7 +1,11 @@ - + + NSRequiresAquaSystemAppearance + + NSHighResolutionCapable + CFBundleExecutable openmsx-debugger CFBundleGetInfoHTML diff -Nru openmsx-debugger-0.1~git20170806/debian/changelog openmsx-debugger-0.1~git20200913/debian/changelog --- openmsx-debugger-0.1~git20170806/debian/changelog 2020-03-27 12:51:33.000000000 +0000 +++ openmsx-debugger-0.1~git20200913/debian/changelog 2020-09-13 07:48:31.000000000 +0000 @@ -1,15 +1,10 @@ -openmsx-debugger (0.1~git20170806-1ubuntu1) focal; urgency=medium +openmsx-debugger (0.1~git20200913-1) unstable; urgency=medium - * Build-depend on python2. - * Build using python2. + * New snapshot. + * Move build system to Python3. Closes: #937204, #967188 + * Upgrade to standards version 4.5.0. (No changes needed.) - -- Matthias Klose Fri, 27 Mar 2020 13:51:33 +0100 - -openmsx-debugger (0.1~git20170806-1build1) focal; urgency=medium - - * No-change rebuild for libgcc-s1 package name change. - - -- Matthias Klose Sun, 22 Mar 2020 16:52:45 +0100 + -- Bas Wijnen Sun, 13 Sep 2020 09:48:31 +0200 openmsx-debugger (0.1~git20170806-1) unstable; urgency=medium diff -Nru openmsx-debugger-0.1~git20170806/debian/control openmsx-debugger-0.1~git20200913/debian/control --- openmsx-debugger-0.1~git20170806/debian/control 2020-03-27 12:51:32.000000000 +0000 +++ openmsx-debugger-0.1~git20200913/debian/control 2020-09-13 07:48:31.000000000 +0000 @@ -2,8 +2,8 @@ Section: otherosfs Priority: optional Maintainer: Bas Wijnen -Build-Depends: debhelper (>= 10), qtbase5-dev, stx2any, python2, chrpath -Standards-Version: 4.0.0 +Build-Depends: debhelper (>= 10), qtbase5-dev, stx2any, python3, chrpath +Standards-Version: 4.5.0 Package: openmsx-debugger Architecture: any diff -Nru openmsx-debugger-0.1~git20170806/debian/patches/python2.diff openmsx-debugger-0.1~git20200913/debian/patches/python2.diff --- openmsx-debugger-0.1~git20170806/debian/patches/python2.diff 2020-03-27 12:51:33.000000000 +0000 +++ openmsx-debugger-0.1~git20200913/debian/patches/python2.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ ---- openmsx-debugger-0.1~git20170806.orig/build/main.mk -+++ openmsx-debugger-0.1~git20170806/build/main.mk -@@ -19,7 +19,7 @@ - # you might have to be more specific, for example "python2" or "python2.6". - # Or if the Python interpreter is not in the search path, you can specify its - # full path. --PYTHON?=python -+PYTHON?=python2 - - - # Logical Targets diff -Nru openmsx-debugger-0.1~git20170806/debian/patches/python3.patch openmsx-debugger-0.1~git20200913/debian/patches/python3.patch --- openmsx-debugger-0.1~git20170806/debian/patches/python3.patch 1970-01-01 00:00:00.000000000 +0000 +++ openmsx-debugger-0.1~git20200913/debian/patches/python3.patch 2020-09-13 07:43:58.000000000 +0000 @@ -0,0 +1,262 @@ +Description: Convert build system to Python3 + This patch moves the build system from Python2 to Python3. +Author: Bas Wijnen +Bug: https://github.com/openMSX/debugger/issues/72 +Bug-Debian: https://bugs.debian.org/937204 +Forwarded: https://github.com/openMSX/debugger/issues/72 +Last-Update: 2020-09-13 + +--- openmsx-debugger-0.1~git20170806.orig/build/detectsys.py ++++ openmsx-debugger-0.1~git20170806/build/detectsys.py +@@ -79,18 +79,18 @@ def detectOS(): + + if __name__ == '__main__': + try: +- print >> sys.stderr, ' Using Python %s native system detection...' % ( ++ print(' Using Python %s native system detection...' % ( + python_version() +- ) ++ ), file = sys.stderr) + hostCPU = detectCPU() + hostOS = detectOS() + if hostOS == 'mingw32' and hostCPU == 'x86_64': + # It is possible to run MinGW on 64-bit Windows, but producing + # 64-bit code is not supported yet. + hostCPU = 'x86' +- print >> sys.stderr, ' Detected system: %s-%s' % (hostCPU, hostOS) +- print 'OPENMSX_TARGET_CPU=%s' % hostCPU +- print 'OPENMSX_TARGET_OS=%s' % hostOS +- except ValueError, ex: +- print >> sys.stderr, ex ++ print(' Detected system: %s-%s' % (hostCPU, hostOS), file = sys.stderr) ++ print('OPENMSX_TARGET_CPU=%s' % hostCPU) ++ print('OPENMSX_TARGET_OS=%s' % hostOS) ++ except ValueError as ex: ++ print(ex, file = sys.stderr) + sys.exit(1) +--- openmsx-debugger-0.1~git20170806.orig/build/executils.py ++++ openmsx-debugger-0.1~git20170806/build/executils.py +@@ -33,10 +33,10 @@ def captureStdout(log, commandLine): + try: + proc = Popen( + commandParts, bufsize = -1, env = env, +- stdin = None, stdout = PIPE, stderr = PIPE, ++ stdin = None, stdout = PIPE, stderr = PIPE, encoding = 'utf-8' + ) +- except OSError, ex: +- print >> log, 'Failed to execute "%s": %s' % (commandLine, ex) ++ except OSError as ex: ++ print('Failed to execute "%s": %s' % (commandLine, ex), file = log) + return None + stdoutdata, stderrdata = proc.communicate() + if stderrdata: +@@ -51,7 +51,7 @@ def captureStdout(log, commandLine): + if proc.returncode == 0: + return stdoutdata + else: +- print >> log, 'Execution failed with exit code %d' % proc.returncode ++ print('Execution failed with exit code %d' % proc.returncode, file = log) + return None + + def shjoin(parts): +--- openmsx-debugger-0.1~git20170806.orig/build/gitdist.py ++++ openmsx-debugger-0.1~git20170806/build/gitdist.py +@@ -32,7 +32,7 @@ def archiveFromGit(versionedPackageName, + ) + try: + outTarPath = distBase + versionedPackageName + '.tar.gz' +- print 'archive:', outTarPath ++ print('archive:', outTarPath) + if not isdir(distBase): + makedirs(distBase) + outTar = TarFile.open(outTarPath, 'w:gz') +@@ -45,11 +45,11 @@ def archiveFromGit(versionedPackageName, + for info in inTar: + if exclude(info): + if verbose: +- print 'EX', info.name ++ print('EX', info.name) + numExcluded += 1 + else: + if verbose: +- print 'IN', info.name ++ print('IN', info.name) + numIncluded += 1 + info.uid = info.gid = 1000 + info.uname = info.gname = 'openmsx' +@@ -57,8 +57,8 @@ def archiveFromGit(versionedPackageName, + outTar.addfile(info, inTar.extractfile(info)) + finally: + inTar.close() +- print 'entries: %d included, %d excluded' % ( +- numIncluded, numExcluded) ++ print('entries: %d included, %d excluded' % ( ++ numIncluded, numExcluded)) + except: + # Clean up partial output file. + outTar.close() +@@ -72,9 +72,8 @@ def archiveFromGit(versionedPackageName, + else: + data, _ = proc.communicate() + if len(data) != 0: +- print >> sys.stderr, ( +- 'WARNING: %d more bytes of data from "git archive" after ' +- 'tar stream ended' % len(data)) ++ print('WARNING: %d more bytes of data from "git archive" after ' ++ 'tar stream ended' % len(data), file = sys.stderr) + + def niceVersionFromGitDescription(description): + '''Our release tag names are still based on naming limitations from CVS; +@@ -106,9 +105,9 @@ def getDescription(committish): + try: + return check_output(args).rstrip('\n') + except CalledProcessError as ex: +- print >> sys.stderr, '"%s" returned %d' % ( ++ print('"%s" returned %d' % ( + ' '.join(args), ex.returncode +- ) ++ ), file = sys.stderr) + raise + + def main(committish = None): +@@ -120,7 +119,7 @@ def main(committish = None): + try: + archiveFromGit('openmsx-debugger-%s' % version, description) + except (OSError, TarError) as ex: +- print >> sys.stderr, 'ERROR: %s' % ex ++ print('ERROR: %s' % ex, sys.stderr) + sys.exit(1) + + if __name__ == '__main__': +@@ -129,5 +128,5 @@ if __name__ == '__main__': + elif len(sys.argv) == 2: + main(sys.argv[1]) + else: +- print >> sys.stderr, 'Usage: gitdist.py [branch | tag]' ++ print('Usage: gitdist.py [branch | tag]', file = sys.stderr) + sys.exit(2) +--- openmsx-debugger-0.1~git20170806.orig/build/main.mk ++++ openmsx-debugger-0.1~git20170806/build/main.mk +@@ -19,7 +19,7 @@ + # you might have to be more specific, for example "python2" or "python2.6". + # Or if the Python interpreter is not in the search path, you can specify its + # full path. +-PYTHON?=python ++PYTHON?=python3 + + + # Logical Targets +--- openmsx-debugger-0.1~git20170806.orig/build/msysutils.py ++++ openmsx-debugger-0.1~git20170806/build/msysutils.py +@@ -10,7 +10,7 @@ def _determineMounts(): + + # Figure out the root directory of MSYS. + proc = Popen( +- [ msysShell(), '-c', '"%s" -c \'import sys ; print sys.argv[1]\' /' ++ [ msysShell(), '-c', '"%s" -c \'import sys ; print(sys.argv[1])\' /' + % sys.executable.replace('\\', '\\\\') ], + stdin = None, + stdout = PIPE, +@@ -19,9 +19,9 @@ def _determineMounts(): + stdoutdata, stderrdata = proc.communicate() + if stderrdata or proc.returncode: + if stderrdata: +- print >> sys.stderr, 'Error determining MSYS root:', stderrdata ++ print('Error determining MSYS root:', stderrdata, file = sys.stderr) + if proc.returncode: +- print >> sys.stderr, 'Exit code %d' % proc.returncode ++ print('Exit code %d' % proc.returncode, file = sys.stderr) + raise IOError('Error determining MSYS root') + msysRoot = stdoutdata.strip() + +@@ -41,10 +41,10 @@ def _determineMounts(): + mounts[mountPoint] = nativePath + finally: + inp.close() +- except IOError, ex: +- print >> sys.stderr, 'Failed to read MSYS fstab:', ex +- except ValueError, ex: +- print >> sys.stderr, 'Failed to parse MSYS fstab:', ex ++ except IOError as ex: ++ print('Failed to read MSYS fstab:', ex, file = sys.stderr) ++ except ValueError as ex: ++ print('Failed to parse MSYS fstab:', ex, file = sys.stderr) + return mounts + + def msysPathToNative(path): +@@ -73,4 +73,4 @@ else: + msysMounts = None + + if __name__ == '__main__': +- print 'MSYS mounts:', msysMounts ++ print('MSYS mounts:', msysMounts) +--- openmsx-debugger-0.1~git20170806.orig/build/outpututils.py ++++ openmsx-debugger-0.1~git20170806/build/outpututils.py +@@ -26,12 +26,12 @@ def rewriteIfChanged(path, lines): + inp.close() + + if newLines == oldLines: +- print 'Up to date: %s' % path ++ print('Up to date: %s' % path) + return False + else: +- print 'Updating %s...' % path ++ print('Updating %s...' % path) + else: +- print 'Creating %s...' % path ++ print('Creating %s...' % path) + createDirFor(path) + + out = open(path, 'w') +--- openmsx-debugger-0.1~git20170806.orig/build/version.py ++++ openmsx-debugger-0.1~git20170806/build/version.py +@@ -28,11 +28,11 @@ def _extractRevisionFromStdout(log, comm + # pylint 0.18.0 somehow thinks captureStdout() returns a list, not a string. + lines = text.split('\n') # pylint: disable-msg=E1103 + for revision, in filterLines(lines, regex): +- print >> log, 'Revision number found by "%s": %s' % (command, revision) ++ print('Revision number found by "%s": %s' % (command, revision), file = log) + return revision + else: +- print >> log, 'Revision number not found in "%s" output:' % command +- print >> log, text ++ print('Revision number not found in "%s" output:' % command, file = log) ++ print(text, file = log) + return None + + def extractGitRevision(log): +@@ -57,11 +57,11 @@ def extractRevision(): + if not isdir('derived'): + makedirs('derived') + log = open('derived/version.log', 'w') +- print >> log, 'Extracting revision info...' ++ print('Extracting revision info...', file = log) + try: + revision = extractGitRevision(log) +- print >> log, 'Revision string: %s' % revision +- print >> log, 'Revision number: %s' % extractNumberFromGitRevision(revision) ++ print('Revision string: %s' % revision, file = log) ++ print('Revision number: %s' % extractNumberFromGitRevision(revision), file = log) + finally: + log.close() + _cachedRevision = revision +--- openmsx-debugger-0.1~git20170806.orig/build/version2code.py ++++ openmsx-debugger-0.1~git20170806/build/version2code.py +@@ -17,6 +17,5 @@ if __name__ == '__main__': + if len(sys.argv) == 2: + rewriteIfChanged(sys.argv[1], iterVersionInclude()) + else: +- print >> sys.stderr, \ +- 'Usage: python version2code.py VERSION_HEADER' ++ print('Usage: python version2code.py VERSION_HEADER', file = sys.stderr) + sys.exit(2) +--- openmsx-debugger-0.1~git20170806.orig/build/win_resource.py ++++ openmsx-debugger-0.1~git20170806/build/win_resource.py +@@ -21,6 +21,5 @@ if __name__ == '__main__': + if len(sys.argv) == 2: + rewriteIfChanged(sys.argv[1], iterResourceHeader()) + else: +- print >> sys.stderr, \ +- 'Usage: python win-resource.py RESOURCE_HEADER' ++ print('Usage: python win-resource.py RESOURCE_HEADER', file = sys.stderr) + sys.exit(2) diff -Nru openmsx-debugger-0.1~git20170806/debian/patches/series openmsx-debugger-0.1~git20200913/debian/patches/series --- openmsx-debugger-0.1~git20170806/debian/patches/series 2020-03-27 12:51:33.000000000 +0000 +++ openmsx-debugger-0.1~git20200913/debian/patches/series 2020-09-13 07:35:13.000000000 +0000 @@ -1,3 +1,3 @@ hardening verbose -python2.diff +python3.patch diff -Nru openmsx-debugger-0.1~git20170806/src/ConnectDialog.cpp openmsx-debugger-0.1~git20200913/src/ConnectDialog.cpp --- openmsx-debugger-0.1~git20170806/src/ConnectDialog.cpp 2017-06-09 22:27:57.000000000 +0000 +++ openmsx-debugger-0.1~git20200913/src/ConnectDialog.cpp 2019-11-05 19:57:56.000000000 +0000 @@ -49,7 +49,7 @@ int all = QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner | QFile::ReadGroup | QFile::WriteGroup | QFile::ExeGroup | QFile::ReadOther | QFile::WriteOther | QFile::ExeOther; - int needed = QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner; + QFile::Permissions needed = QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner; if ((info.permissions() & all) != needed) { return false; } @@ -68,7 +68,7 @@ int all = QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner | QFile::ReadGroup | QFile::WriteGroup | QFile::ExeGroup | QFile::ReadOther | QFile::WriteOther | QFile::ExeOther; - int needed = QFile::ReadOwner | QFile::WriteOwner; + QFile::Permissions needed = QFile::ReadOwner | QFile::WriteOwner; if ((info.permissions() & all) != needed) { return false; } @@ -145,7 +145,19 @@ static void collectServers(QList& servers) { +#ifdef _WIN32 + DWORD len = GetTempPathW(0, nullptr); + assert(len > 0); // nothing we can do to recover this + //VLA(wchar_t, bufW, (len+1)); + //wchar_t bufW[len+1]; + auto bufW = static_cast(_alloca(sizeof(wchar_t) * (len+1))); + + len = GetTempPathW(len, bufW); + assert(len > 0); // nothing we can do to recover this + QDir dir(QString::fromWCharArray(bufW, len)); +#else QDir dir((getenv("TMPDIR")) ? getenv("TMPDIR") : QDir::tempPath()); +#endif dir.cd("openmsx-" + getUserName()); if (!checkSocketDir(dir)) { // no correct socket directory diff -Nru openmsx-debugger-0.1~git20170806/src/DisasmViewer.cpp openmsx-debugger-0.1~git20200913/src/DisasmViewer.cpp --- openmsx-debugger-0.1~git20170806/src/DisasmViewer.cpp 2017-06-09 22:27:57.000000000 +0000 +++ openmsx-debugger-0.1~git20200913/src/DisasmViewer.cpp 2019-11-05 19:57:56.000000000 +0000 @@ -13,6 +13,7 @@ #include #include #include +#include class CommMemoryRequest : public ReadDebugBlockCommand { @@ -612,6 +613,46 @@ e->accept(); break; } + case Qt::Key_Home: { + setCursorAddress(0, 0, Middle); + e->accept(); + break; + } + case Qt::Key_End: { + setCursorAddress(0xffff, 0, Middle); + e->accept(); + break; + } + case Qt::Key_Right: + case Qt::Key_Return: { + int line = findDisasmLine(cursorAddr, cursorLine); + if (line >= 0 && line < int(disasmLines.size())) { + int naddr = INT_MAX; + const DisasmRow &row = disasmLines[line]; + std::string instr = row.instr; + std::regex re_absolute("(call|jp)\\ .*"); + std::regex re_relative("(djnz|jr)\\ .*"); + if (std::regex_match(instr, re_absolute)) + naddr = memory[row.addr + 1] + memory[row.addr + 2] * 256; + else if (std::regex_match(instr, re_relative)) + naddr = (row.addr + 2 + (signed char)memory[row.addr + 1]) & 0xFFFF; + if(naddr != INT_MAX) { + jumpStack.push_back(cursorAddr); + setCursorAddress(naddr, 0, Middle); + } + } + e->accept(); + break; + } + case Qt::Key_Left: + case Qt::Key_Backspace: { + if(!jumpStack.empty()){ + int addr = jumpStack.takeLast(); + setCursorAddress(addr, 0, Middle); + } + e->accept(); + break; + } default: QFrame::keyReleaseEvent(e); } diff -Nru openmsx-debugger-0.1~git20170806/src/DisasmViewer.h openmsx-debugger-0.1~git20200913/src/DisasmViewer.h --- openmsx-debugger-0.1~git20170806/src/DisasmViewer.h 2017-06-09 22:27:57.000000000 +0000 +++ openmsx-debugger-0.1~git20200913/src/DisasmViewer.h 2019-11-05 19:57:56.000000000 +0000 @@ -56,6 +56,8 @@ quint16 cursorAddr; int cursorLine; + QList jumpStack; + // layout information int frameL, frameR, frameT, frameB; int labelFontHeight, labelFontAscent;