diff -r 21d97c0ee600 -r 70c17add3b24 GDBArchitecture.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GDBArchitecture.st Thu Aug 16 10:06:02 2018 +0100 @@ -0,0 +1,132 @@ +" +jv:libgdbs - GNU Debugger Interface Library +Copyright (C) 2015-now Jan Vrany + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +" +"{ Package: 'jv:libgdbs' }" + +"{ NameSpace: Smalltalk }" + +Object subclass:#GDBArchitecture + instanceVariableNames:'' + classVariableNames:'Architectures' + poolDictionaries:'' + category:'GDB-Core' +! + +!GDBArchitecture class methodsFor:'documentation'! + +copyright +" +jv:libgdbs - GNU Debugger Interface Library +Copyright (C) 2015-now Jan Vrany + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +" +! + +documentation +" + Sub-instances of GDBArchitecture models a target + architecture such as x86_64, PowerPC or RISC-V and + provides architecture-specific services. + + In GDB, each frame has associated architecture (and + may differ from architecture of other frames!!) + + [author:] + Jan Vrany + + [instance variables:] + + [class variables:] + + [see also:] + +" +! ! + +!GDBArchitecture class methodsFor:'initialization'! + +initialize + "Invoked at system start or when the class is dynamically loaded." + + "/ please change as required (and remove this comment) + + Architectures := Dictionary new. + Architectures at: 'i386' put: GDBArch_i386 new. + Architectures at: 'i386:x86_64' put: GDBArch_x86_64 new. + + "Modified: / 16-08-2018 / 08:59:15 / Jan Vrany " +! ! + +!GDBArchitecture class methodsFor:'instance creation'! + +named: aString + ^ Architectures + at: aString + ifAbsentPut:[GDBArch_unknown new setName: aString ]. + + " + GDBArchitecture named: 'i386:x86_64' + GDBArchitecture named: 'mips' + " + + "Created: / 16-08-2018 / 08:57:52 / Jan Vrany " +! ! + +!GDBArchitecture methodsFor:'accessing'! + +name + ^ self subclassResponsibility + + "Created: / 16-08-2018 / 07:35:17 / Jan Vrany " +! ! + +!GDBArchitecture methodsFor:'printing & storing'! + +printOn:aStream + super printOn:aStream. + aStream + nextPut: $(; + nextPutAll: self name; + nextPut: $). + + "Modified: / 16-08-2018 / 09:01:39 / Jan Vrany " +! ! + +!GDBArchitecture methodsFor:'queries'! + +sizeofPointer + self subclassResponsibility + + "Created: / 16-08-2018 / 09:35:04 / Jan Vrany " +! ! + + +GDBArchitecture initialize!