eteran / edb-debugger

edb is a cross-platform AArch32/x86/x86-64 debugger.
GNU General Public License v2.0
2.7k stars 325 forks source link

Port to OpenBSD is incomplete #66

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Created attachment 7
WIP port of EDB to OpenBSD, including patches needed to build edb on OpenBSD

Hi,

See attached patches I had to apply to the sources in order to have this build
on OpenBSD. There is even a syntax error in a #ifdef Q_OS_FREEBSD block!

Even after patching it seems the plugins depend upon each other and (I think)
assumes the OS does library chaining, which OpenBSD does not. I think this is a
similar problem to one I once saw with QT Creator, so I will CC in the
developer that fixed that (espie).

Starting EDB Version: 0.9.10 
Please Report Bugs & Requests At: http://bugs.codef00.com/
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZN3edb2v112debuggerBaseE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZTV9MemRegion'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZN3edb2v110debuggerUIE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZN3edb2v119getInstructionBytesEjPhRi'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZNK13SymbolManager10findSymbolEj'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZN9MemRegionD1Ev'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZN3edb2v112currentStateEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZNK3MD56digestEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZN3MD56updateEPKvm'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZNK13SymbolManager7symbolsEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZN3edb2v118locateMainFunctionERK7QString'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZNK5State18instructionPointerEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZN3edb2v113symbolManagerEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZN3MD58finalizeEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZN3edb2v114repaintCPUViewEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZN3edb2v111setAnalyzerEP17AnalyzerInterface'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZN3edb2v120getProcessExecutableEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZNK13MemoryRegions10findRegionEjR9MemRegion'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZN3edb2v113memoryRegionsEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZN3MD5C1Ev'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: undefined symbol
'_ZNK9MemRegion4sizeEv'
[loadPlugins] Cannot load library
/usr/ports/pobj/edb-0.9.10/debugger/libAnalyzer.so: (Cannot load specified
object) 
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZN3edb2v112debuggerBaseE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZTV9MemRegion'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZN3edb2v110debuggerUIE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZNK12BinaryString5valueEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZNK9MemRegion10accessibleEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZN3edb2v115stringToAddressERK7QStringRb'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZN9MemRegionD1Ev'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZN3edb2v112currentStateEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZN12BinaryStringC1EP7QWidget'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZN3edb2v18dumpDataEjb'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZN14ByteShiftArray5clearEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZNK14ByteShiftArray4dataEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZN14ByteShiftArrayD1Ev'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZNK5State12stackPointerEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZNK13MemoryRegions10findRegionEjR9MemRegion'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZN14ByteShiftArrayC1Em'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZN3edb2v113memoryRegionsEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZN13MemoryRegions4syncEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZNK9MemRegion4sizeEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZN14ByteShiftArraylsEh'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: undefined
symbol '_ZN3edb2v19dumpStackEjb'
[loadPlugins] Cannot load library
/usr/ports/pobj/edb-0.9.10/debugger/libBinarySearcher.so: (Cannot load
specified object) 
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBookmarks.so: undefined symbol
'_ZN3edb2v18getDWORDEjRbR15ExpressionErrorPv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBookmarks.so: undefined symbol
'_ZN3edb2v111getVariableERK7QStringRbR15ExpressionErrorPv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBookmarks.so: undefined symbol
'_ZN3edb2v110debuggerUIE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBookmarks.so: undefined symbol
'_ZN3edb2v115stringToAddressERK7QStringRb'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBookmarks.so: undefined symbol
'_ZN3edb2v113jumpToAddressEj'
[loadPlugins] Cannot load library
/usr/ports/pobj/edb-0.9.10/debugger/libBookmarks.so: (Cannot load specified
object) 
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBreakpointManager.so: undefined
symbol '_ZN3edb2v18getDWORDEjRbR15ExpressionErrorPv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBreakpointManager.so: undefined
symbol '_ZN3edb2v112debuggerBaseE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBreakpointManager.so: undefined
symbol '_ZN3edb2v111getVariableERK7QStringRbR15ExpressionErrorPv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBreakpointManager.so: undefined
symbol '_ZN3edb2v110debuggerUIE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBreakpointManager.so: undefined
symbol '_ZN3edb2v115stringToAddressERK7QStringRb'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBreakpointManager.so: undefined
symbol '_ZN3edb2v116createBreakpointEj'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBreakpointManager.so: undefined
symbol '_ZN3edb2v116removeBreakpointEj'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBreakpointManager.so: undefined
symbol '_ZN3edb2v111formatBytesERK10QByteArray'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libBreakpointManager.so: undefined
symbol '_ZN3edb2v118findFunctionSymbolEjRK7QStringPi'
[loadPlugins] Cannot load library
/usr/ports/pobj/edb-0.9.10/debugger/libBreakpointManager.so: (Cannot load
specified object) 
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libCheckVersion.so: undefined symbol
'_ZN3edb2v110edbVersionEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libCheckVersion.so: undefined symbol
'_ZN3edb2v110intVersionERK7QString'
[loadPlugins] Cannot load library
/usr/ports/pobj/edb-0.9.10/debugger/libCheckVersion.so: (Cannot load specified
object) 
[loadPlugins] The file '/usr/ports/pobj/edb-0.9.10/debugger/libDebuggerCore.so'
is not a valid Qt plugin. 
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libDumpState.so: undefined symbol
'_ZN3edb2v112debuggerBaseE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libDumpState.so: undefined symbol
'_ZN3edb2v119getInstructionBytesEjPhRi'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libDumpState.so: undefined symbol
'_ZN3edb2v112currentStateEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libDumpState.so: undefined symbol
'_ZNK5State18instructionPointerEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libDumpState.so: undefined symbol
'_ZNK5State12stackPointerEv'
[loadPlugins] Cannot load library
/usr/ports/pobj/edb-0.9.10/debugger/libDumpState.so: (Cannot load specified
object) 
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libELFBinaryInfo.so: undefined symbol
'_ZN3edb2v118registerBinaryInfoEPFP10BinaryInfoRK7QStringE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libELFBinaryInfo.so: undefined symbol
'_ZN10BinaryInfoC2ERK7QString'
[loadPlugins] Cannot load library
/usr/ports/pobj/edb-0.9.10/debugger/libELFBinaryInfo.so: (Cannot load specified
object) 
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libEnvironment.so: undefined symbol
'_ZN3edb2v112debuggerBaseE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libEnvironment.so: undefined symbol
'_ZN3edb2v110debuggerUIE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libEnvironment.so: undefined symbol
'_ZNK13SymbolManager10findSymbolERK7QString'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libEnvironment.so: undefined symbol
'_ZN3edb2v115loadedLibrariesEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libEnvironment.so: undefined symbol
'_ZN3edb2v115stringToAddressERK7QStringRb'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libEnvironment.so: undefined symbol
'_ZN3edb2v123getASCIIStringAtAddressEjR7QStringiiRi'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libEnvironment.so: undefined symbol
'_ZN3edb2v18dumpDataEjb'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libEnvironment.so: undefined symbol
'_ZN3edb2v16configEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libEnvironment.so: undefined symbol
'_ZN3edb2v113symbolManagerEv'
[loadPlugins] Cannot load library
/usr/ports/pobj/edb-0.9.10/debugger/libEnvironment.so: (Cannot load specified
object) 
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libFunctionDB.so: undefined symbol
'_ZN3edb2v113setFunctionDBEP10FunctionDB'
[loadPlugins] Cannot load library
/usr/ports/pobj/edb-0.9.10/debugger/libFunctionDB.so: (Cannot load specified
object) 
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libFunctionFinder.so: undefined
symbol '_ZN3edb2v110debuggerUIE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libFunctionFinder.so: undefined
symbol '_ZN3edb2v113jumpToAddressEj'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libFunctionFinder.so: undefined
symbol '_ZN3edb2v18analyzerEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libFunctionFinder.so: undefined
symbol '_ZN3edb2v113memoryRegionsEv'
[loadPlugins] Cannot load library
/usr/ports/pobj/edb-0.9.10/debugger/libFunctionFinder.so: (Cannot load
specified object) 
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libHardwareBreakpoints.so: undefined
symbol '_ZN3edb2v112debuggerBaseE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libHardwareBreakpoints.so: undefined
symbol '_ZN3edb2v110debuggerUIE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libHardwareBreakpoints.so: undefined
symbol '_ZNK10DebugEvent6reasonEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libHardwareBreakpoints.so: undefined
symbol '_ZN3edb2v115stringToAddressERK7QStringRb'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libHardwareBreakpoints.so: undefined
symbol '_ZN5StateC1Ev'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libHardwareBreakpoints.so: undefined
symbol '_ZNK10DebugEvent8stopCodeEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libHardwareBreakpoints.so: undefined
symbol '_ZN3edb2v120setDebugEventHandlerEP26DebugEventHandlerInterface'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libHardwareBreakpoints.so: undefined
symbol '_ZN10DebugEventC1ERKS_'
[loadPlugins] Cannot load library
/usr/ports/pobj/edb-0.9.10/debugger/libHardwareBreakpoints.so: (Cannot load
specified object) 
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libHeapAnalyzer.so: undefined symbol
'_ZN3edb2v112debuggerBaseE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libHeapAnalyzer.so: undefined symbol
'_ZN3edb2v110debuggerUIE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libHeapAnalyzer.so: undefined symbol
'_ZNK13SymbolManager10findSymbolERK7QString'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libHeapAnalyzer.so: undefined symbol
'_ZN3edb2v115loadedLibrariesEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libHeapAnalyzer.so: undefined symbol
'_ZN3edb2v123getASCIIStringAtAddressEjR7QStringiiRi'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libHeapAnalyzer.so: undefined symbol
'_ZN3edb2v16configEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libHeapAnalyzer.so: undefined symbol
'_ZN3edb2v123getUTF16StringAtAddressEjR7QStringiiRi'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libHeapAnalyzer.so: undefined symbol
'_ZN3edb2v113symbolManagerEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libHeapAnalyzer.so: undefined symbol
'_ZN3edb2v113dumpDataRangeEjjb'
[loadPlugins] Cannot load library
/usr/ports/pobj/edb-0.9.10/debugger/libHeapAnalyzer.so: (Cannot load specified
object) 
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libOpcodeSearcher.so: undefined
symbol '_ZN3edb2v112debuggerBaseE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libOpcodeSearcher.so: undefined
symbol '_ZN3edb2v110debuggerUIE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libOpcodeSearcher.so: undefined
symbol '_ZN3edb2v113jumpToAddressEj'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libOpcodeSearcher.so: undefined
symbol '_ZN14ByteShiftArray5clearEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libOpcodeSearcher.so: undefined
symbol '_ZNK14ByteShiftArray4dataEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libOpcodeSearcher.so: undefined
symbol '_ZN14ByteShiftArrayD1Ev'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libOpcodeSearcher.so: undefined
symbol '_ZN14ByteShiftArrayC1Em'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libOpcodeSearcher.so: undefined
symbol '_ZN3edb2v113memoryRegionsEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libOpcodeSearcher.so: undefined
symbol '_ZNK9MemRegion4sizeEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libOpcodeSearcher.so: undefined
symbol '_ZN14ByteShiftArraylsEh'
[loadPlugins] Cannot load library
/usr/ports/pobj/edb-0.9.10/debugger/libOpcodeSearcher.so: (Cannot load
specified object) 
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libOpenFiles.so: undefined symbol
'_ZN3edb2v112debuggerBaseE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libOpenFiles.so: undefined symbol
'_ZN3edb2v110debuggerUIE'
[loadPlugins] Cannot load library
/usr/ports/pobj/edb-0.9.10/debugger/libOpenFiles.so: (Cannot load specified
object) 
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libReferences.so: undefined symbol
'_ZN3edb2v112debuggerBaseE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libReferences.so: undefined symbol
'_ZTV9MemRegion'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libReferences.so: undefined symbol
'_ZN3edb2v110debuggerUIE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libReferences.so: undefined symbol
'_ZNK9MemRegion10accessibleEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libReferences.so: undefined symbol
'_ZN3edb2v115stringToAddressERK7QStringRb'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libReferences.so: undefined symbol
'_ZN3edb2v18dumpDataEjb'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libReferences.so: undefined symbol
'_ZN3edb2v113memoryRegionsEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libReferences.so: undefined symbol
'_ZN13MemoryRegions4syncEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libReferences.so: undefined symbol
'_ZNK9MemRegion4sizeEv'
[loadPlugins] Cannot load library
/usr/ports/pobj/edb-0.9.10/debugger/libReferences.so: (Cannot load specified
object) 
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libSessionManager.so: undefined
symbol '_ZN3edb2v121setSessionFileHandlerEP20SessionFileInterface'
[loadPlugins] Cannot load library
/usr/ports/pobj/edb-0.9.10/debugger/libSessionManager.so: (Cannot load
specified object) 
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libStringSearcher.so: undefined
symbol '_ZN3edb2v110debuggerUIE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libStringSearcher.so: undefined
symbol '_ZN3edb2v123getASCIIStringAtAddressEjR7QStringiiRi'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libStringSearcher.so: undefined
symbol '_ZN3edb2v18dumpDataEjb'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libStringSearcher.so: undefined
symbol '_ZN3edb2v16configEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libStringSearcher.so: undefined
symbol '_ZN3edb2v113memoryRegionsEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libStringSearcher.so: undefined
symbol '_ZNK9MemRegion4sizeEv'
[loadPlugins] Cannot load library
/usr/ports/pobj/edb-0.9.10/debugger/libStringSearcher.so: (Cannot load
specified object) 
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libSymbolViewer.so: undefined symbol
'_ZN3edb2v110debuggerUIE'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libSymbolViewer.so: undefined symbol
'_ZNK13SymbolManager10findSymbolEj'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libSymbolViewer.so: undefined symbol
'_ZN3edb2v115stringToAddressERK7QStringRb'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libSymbolViewer.so: undefined symbol
'_ZNK13SymbolManager7symbolsEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libSymbolViewer.so: undefined symbol
'_ZN3edb2v18dumpDataEjb'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libSymbolViewer.so: undefined symbol
'_ZN3edb2v113jumpToAddressEj'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libSymbolViewer.so: undefined symbol
'_ZN3edb2v113symbolManagerEv'
./edb:/usr/ports/pobj/edb-0.9.10/debugger/libSymbolViewer.so: undefined symbol
'_ZN3edb2v19dumpStackEjb'
[loadPlugins] Cannot load library
/usr/ports/pobj/edb-0.9.10/debugger/libSymbolViewer.so: (Cannot load specified
object)

Original issue reported on code.google.com by evan.teran on 3 Oct 2012 at 3:21

GoogleCodeExporter commented 9 years ago

Original comment by evan.teran on 3 Oct 2012 at 4:29

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you for your bug report and patches!

The linux port is the only version that is currently expected to work, but this 
will definitely help things move in the right direction. I've been wanting to 
add support for any of the BSDs for a while, but am a little unfamiliar with 
the system APIs I'll need to dive into. (For example, I need to learn more 
about how to get a process's memory statistics without /proc/ and such).

As for the linker errors, I **think** I know what the problem is. Basically, 
the current module system works by having the plugins reference symbols which 
are exported by the main binary. On some configurations, it may need some 
linker flags to make this happen correctly, but I believe that it should work 
on BSD unixes as well. So I'll look into that. I am nearly 100% sure that is 
the problem because the symbols I've seen so far all resolve to 
"edb::v1::whatever" and the edb::v1 namespace is found entirely in the main 
executable.

I'll be setting up an OpenBSD VM so I can test and apply these patches and 
hopefully get it to load up correctly.

Thanks Again,
Evan Teran

Original comment by evan.teran on 3 Oct 2012 at 4:30

GoogleCodeExporter commented 9 years ago
edb builds and now has basic functionality implemented for openbsd. Not all 
features are supported (or work perfectly), but the core feature set seems to 
work well.

Original comment by evan.teran on 3 Oct 2012 at 4:30

GoogleCodeExporter commented 9 years ago
Is this the subversion code we are talking about? If so, where can I obtain 
this?

Original comment by evan.teran on 3 Oct 2012 at 4:30

GoogleCodeExporter commented 9 years ago
I am actually referring to the latest public release :-) 0.9.16. I am also 
looking into setting up a public SVN so that people can take a more active role 
in contributing.

Evan Teran

Original comment by evan.teran on 3 Oct 2012 at 4:30

GoogleCodeExporter commented 9 years ago
Is this expected to build *outside* the ports infrastructure? I fetched the 
most recent version and attempted a build in my home dir:

---8<---
cd src/ && make -f Makefile
g++ -c -pipe -O2 -fno-wrapv  -ansi -pedantic -W -Wall -Wno-long-long 
-Wnon-virtual-dtor -O2 -fno-wrapv  -Wall -W -pthread -DQT_NO_DEBUG -DQT_GUI_LIB 
-DQT_CORE_LIB -DQT_SHARED -I/usr/local/lib/qt4/mkspecs/openbsd-g++4 -I. 
-I/usr/local/include/X11/qt4/QtCore -I/usr/local/include/X11/qt4/QtGui 
-I/usr/local/include/X11/qt4 -Iwidgets -I../include -Ios/unix 
-I../include/os/unix -Ios/unix/openbsd -I../include/os/unix/openbsd 
-I/usr/local/include -Iarch/x86_64 -I../include/arch/x86_64 
-I.moc/release-shared -I.uic -I/include -o .obj/release-shared/MemRegion.o 
os/unix/openbsd/MemRegion.cpp
In file included from /usr//include/g++/memory:60,
                 from /usr//include/g++/string:48,
                 from ../include/arch/x86_64/../../../src/edisassm/edisassm_util.h:23,
                 from ../include/arch/x86_64/../../../src/edisassm/Instruction.h:23,
                 from ../include/arch/x86_64/Instruction.h:1,
                 from ../include/arch/x86_64/ArchTypes.h:24,
                 from ../include/Types.h:23,
                 from ../include/os/unix/openbsd/MemRegion.h:23,
                 from os/unix/openbsd/MemRegion.cpp:20:
/usr//include/g++/limits: In static member function 'static char 
std::numeric_limits<char>::min()':
/usr//include/g++/limits:375: warning: overflow in implicit constant conversion
/usr//include/g++/limits: In static member function 'static wchar_t 
std::numeric_limits<wchar_t>::max()':
/usr//include/g++/limits:530: warning: overflow in implicit constant conversion
In file included from /usr//include/g++/bits/locale_facets.h:47,
                 from /usr//include/g++/bits/basic_ios.h:44,
                 from /usr//include/g++/ios:50,
                 from /usr//include/g++/istream:44,
                 from /usr//include/g++/iomanip:45,
                 from ../include/arch/x86_64/../../../src/edisassm/Operand.tcc:28,
                 from ../include/arch/x86_64/../../../src/edisassm/Operand.h:220,
                 from ../include/arch/x86_64/../../../src/edisassm/Instruction.h:60,
                 from ../include/arch/x86_64/Instruction.h:1,
                 from ../include/arch/x86_64/ArchTypes.h:24,
                 from ../include/Types.h:23,
                 from ../include/os/unix/openbsd/MemRegion.h:23,
                 from os/unix/openbsd/MemRegion.cpp:20:
/usr//include/g++/amd64-unknown-openbsd4.8/bits/ctype_base.h: At global scope:
/usr//include/g++/amd64-unknown-openbsd4.8/bits/ctype_base.h:55: warning: 
overflow in implicit constant conversion
os/unix/openbsd/MemRegion.cpp:100: error: prototype for 'void 
MemRegion::set_permissions(bool, bool, bool, edb::address_t)' does not match 
any in class 'MemRegion'
../include/os/unix/openbsd/MemRegion.h:82: error: candidate is: void 
MemRegion::set_permissions(bool, bool, bool)
os/unix/openbsd/MemRegion.cpp:100: warning: unused parameter 'read'
os/unix/openbsd/MemRegion.cpp:100: warning: unused parameter 'write'
os/unix/openbsd/MemRegion.cpp:100: warning: unused parameter 'execute'
os/unix/openbsd/MemRegion.cpp:100: warning: unused parameter 'temp_address'
os/unix/openbsd/MemRegion.cpp:115: warning: unused parameter 'read'
os/unix/openbsd/MemRegion.cpp:115: warning: unused parameter 'write'
os/unix/openbsd/MemRegion.cpp:115: warning: unused parameter 'execute'
*** Error code 1

Stop in /home/edd/debugger/src (line 990 of Makefile).
*** Error code 1

Stop in /home/edd/debugger (line 40 of Makefile).
---8<---

I am running OpenBSD-current (a recent snapshot) on amd64.

Cheers

Original comment by evan.teran on 3 Oct 2012 at 4:31

GoogleCodeExporter commented 9 years ago
One thing I forgot to mention is that for openBSD only i386 is supported. I 
haven't tested 64-bit yet. It may build on x86_64, or it may not. It definitely 
won't work yet though because I need to make it use the 64-bit process state 
structures in the DebuggerCore. Also, it seems that my last minute header 
cleanup backfired :-(.

The function declared on line 100 of MemRegion "void 
MemRegion::set_permissions(bool read, bool write, bool execute, edb::address_t 
temp_address)" was supposed to be chopped out.

Sorry about that. Try removing that function entirely (it just has a TODO 
comment in it anyway) and see if it builds for i386. I'll do this and push it 
to my website (no version change though).

Original comment by evan.teran on 3 Oct 2012 at 4:31

GoogleCodeExporter commented 9 years ago
Actually, it may work on x86_64 :-P. I just looked at the source code. It seems 
that I at least put in code for the DebuggerCore for x86_64 process state.

Let me know if it does! Also I just put up the patched version. Sorry for the 
build issues.

Original comment by evan.teran on 3 Oct 2012 at 4:32

GoogleCodeExporter commented 9 years ago
Sigh... No - There is still breakage, although atleast it builds now.

File->open, /usr/bin/mail

Program received signal SIGSEGV, Segmentation fault.
[Switching to process 5854, thread 0x8b9ee400]
kvm_close (kd=0x0) at /usr/src/lib/libkvm/kvm.c:619
619     /usr/src/lib/libkvm/kvm.c: No such file or directory.
        in /usr/src/lib/libkvm/kvm.c
(gdb) bt
#0  kvm_close (kd=0x0) at /usr/src/lib/libkvm/kvm.c:619
#1  0x1c0a3336 in MemoryRegions::sync ()
#2  0x1c07ae5d in DebuggerMain::set_initial_debugger_state ()
#3  0x1c07bd12 in DebuggerMain::common_open ()
#4  0x1c07bf25 in DebuggerMain::execute ()
#5  0x1c07c67e in DebuggerMain::open_file ()
#6  0x1c07c779 in DebuggerMain::on_action_Open_triggered ()
#7  0x1c0ef7bd in DebuggerMain::qt_metacall ()
#8  0x06de6863 in QMetaObject::metacall () from /usr/local/lib/libQtCore.so.8.0
#9  0x06df43d6 in QMetaObject::activate () from /usr/local/lib/libQtCore.so.8.0
#10 0x07c7cc39 in QAction::triggered () from /usr/local/lib/libQtGui.so.9.0
#11 0x07c7e3ef in QAction::activate () from /usr/local/lib/libQtGui.so.9.0
#12 0x0814ac40 in QMenuPrivate::activateCausedStack () from 
/usr/local/lib/libQtGui.so.9.0
#13 0x0815133b in QMenuPrivate::activateAction () from 
/usr/local/lib/libQtGui.so.9.0
#14 0x0815347d in QMenu::mouseReleaseEvent () from 
/usr/local/lib/libQtGui.so.9.0
#15 0x07ce94a9 in QWidget::event () from /usr/local/lib/libQtGui.so.9.0
#16 0x08150cd4 in QMenu::event () from /usr/local/lib/libQtGui.so.9.0
#17 0x07c8435c in QApplicationPrivate::notify_helper () from 
/usr/local/lib/libQtGui.so.9.0
#18 0x07c8bdac in QApplication::notify () from /usr/local/lib/libQtGui.so.9.0
#19 0x06de050b in QCoreApplication::notifyInternal () from 
/usr/local/lib/libQtCore.so.8.0
#20 0x07c86b59 in QApplicationPrivate::sendMouseEvent () from 
/usr/local/lib/libQtGui.so.9.0
#21 0x07d188c7 in QETWidget::translateMouseEvent () from 
/usr/local/lib/libQtGui.so.9.0
#22 0x07d17fcd in QApplication::x11ProcessEvent () from 
/usr/local/lib/libQtGui.so.9.0
#23 0x07d43e44 in QGuiEventDispatcherGlib::processEvents () from 
/usr/local/lib/libQtGui.so.9.0
#24 0x0ce56e47 in g_main_context_dispatch () from 
/usr/local/lib/libglib-2.0.so.2600.0
#25 0x0ce5a7be in g_main_context_prepare () from 
/usr/local/lib/libglib-2.0.so.2600.0
#26 0x0ce5ade5 in g_main_context_iteration () from 
/usr/local/lib/libglib-2.0.so.2600.0
#27 0x06e107cb in QEventDispatcherGlib::processEvents () from 
/usr/local/lib/libQtCore.so.8.0
#28 0x07d43c35 in QGuiEventDispatcherGlib::processEvents () from 
/usr/local/lib/libQtGui.so.9.0
#29 0x06ddf4f3 in QEventLoop::processEvents () from 
/usr/local/lib/libQtCore.so.8.0
#30 0x06ddf86a in QEventLoop::exec () from /usr/local/lib/libQtCore.so.8.0
#31 0x06de1d56 in QCoreApplication::exec () from /usr/local/lib/libQtCore.so.8.0
#32 0x07c83cf7 in QApplication::exec () from /usr/local/lib/libQtGui.so.9.0
#33 0x1c0a0576 in main ()

How do you enable debuging symbols globally? So far I have found that you have 
to add 'CONFIG += debug' to every project, which sucks. Do you know a way?

This is on an i386 machine now, using OpenBSD-current.

Cheers

Original comment by evan.teran on 3 Oct 2012 at 4:32

GoogleCodeExporter commented 9 years ago
Well that's no good. My guess is that one of the kvm_reads's is failing :-(. 
Did you try running it as root? (I know not good practice, but for diagnostic 
purposes).

If that's the problem, then adding proper error handling should fix it.

anyway, to do a general debug build, you can do this in the root project 
directory.

make distclean
qmake-qt CONFIG+=debug
make

you should do the distclean first to make sure that all makefiles are 
re-created. This should make everything build in debug mode.

Thanks for you efforts and sorry for the troubles with this port.

Original comment by evan.teran on 3 Oct 2012 at 4:32

GoogleCodeExporter commented 9 years ago
Indeed, it does work as root. Can you take a look?

Cheers

Original comment by evan.teran on 3 Oct 2012 at 4:32

GoogleCodeExporter commented 9 years ago
Glad to hear it works as root!

I think I know what happened. If I recall correctly, in my test VM I added my 
normal user to the "kvm" group. This is probably a reasonable enough solution.

When not either root or in the kvm group, kvm_getproc2() will return NULL. The 
current code doesn't check that...oops.

Anyway, I think the best I can do is catch that NULL and put up a messagebox 
recommending they either add themselves to the kvm group or run an a root.

The only alternative is an ugly one.

Move that particular functionality to a separate binary which is suid root and 
use IPC to get the info when I need it. It would be functional, but not pretty 
at all.

Original comment by evan.teran on 3 Oct 2012 at 4:33

GoogleCodeExporter commented 9 years ago
Hrm. Is there an alternative method than by using kvm functions? I have spoken 
with others and we would rather not import code which requires users in the 
kmem group.

Original comment by evan.teran on 3 Oct 2012 at 4:33

GoogleCodeExporter commented 9 years ago
I agree that having users in the kmem group is not ideal. Unfortunately, I'm 
not currently aware of alternate techniques to get the two pieces of 
information that I am currently using the kvm API for:

1) process memory map
2) the fine details of the current signal being delivered to the child

But that doesn't mean that there isn't an alternative, I'm far more familiar 
with the Linux APIs than I am with OpenBSD's. So it is possible that I just 
need to do a little more research to get the information that I need.

Original comment by evan.teran on 3 Oct 2012 at 4:34

eteran commented 9 years ago

Superseded by issue #261