GDBOutputFormat.st
author Jan Vrany <jan.vrany@labware.com>
Fri, 08 Sep 2023 12:40:22 +0100
changeset 317 7f63737e0374
parent 272 cdd1c9ad00de
permissions -rw-r--r--
Fix `GDBMIDebugger` after rename of `GDBStXUnixProcess` to `GDBUnixProcess` ...in commit d1422e1ee.

"
jv:libgdbs - GNU Debugger Interface Library
Copyright (C) 2015-now Jan Vrany
Copyright (C) 2020-2023 LabWare

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"
"{ Package: 'jv:libgdbs' }"

"{ NameSpace: Smalltalk }"

Object subclass:#GDBOutputFormat
	instanceVariableNames:'format name description'
	classVariableNames:''
	poolDictionaries:'GDBOutputFormats'
	category:'GDB'
!

!GDBOutputFormat class methodsFor:'documentation'!

copyright
"
jv:libgdbs - GNU Debugger Interface Library
Copyright (C) 2015-now Jan Vrany
Copyright (C) 2020-2023 LabWare

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"
!

documentation
"
    GDBOutputFormat is a reification of one of output formats
    defined by GDB. 

    Do not use this class directly in user code, use constants 
    defined `GDBOutputFormats`

    [author:]
        Jan Vrany <jan.vrany@fit.cvut.cz>

    [instance variables:]

    [class variables:]

    [see also:]
        GDBOutputFormats
        https://sourceware.org/gdb/onlinedocs/gdb/Output-Formats.html#Output-Formats

"
! !

!GDBOutputFormat class methodsFor:'initialization'!

initialize
    "Invoked at system start or when the class is dynamically loaded."

    "/ Following hack is here to allow loading from source and from compiled class lib.
    "/ When loading from source, GDBOutputFormats is not yet initialized
    "/ since it requires this class. So we initialize it now when this
    "/ class is definitely present.
    "/ 
    "/ When loading from binary, classes are initialize after all of them
    "/ are present, therefore we do not need to call initialize again.
    "/ Hence the condition.
    FormatHexadecimal isNil ifTrue: [ 
        GDBOutputFormats initialize.
    ].

    "Modified: / 25-01-2018 / 09:29:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified (comment): / 26-03-2021 / 13:29:20 / Jan Vrany <jan.vrany@labware.com>"
! !

!GDBOutputFormat class methodsFor:'instance creation'!

format:formatArg name:nameArg description:descriptionArg 
    ^ self new format:formatArg name:nameArg description:descriptionArg 
! !

!GDBOutputFormat class methodsFor:'accessing'!

address
    ^ FormatAddress

    "Created: / 28-11-2018 / 14:00:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

all
    ^ GDBOutputFormats all
!

binary
    ^ FormatBinary

    "Created: / 28-11-2018 / 14:00:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

characterConstant
    ^ FormatCharacterConstant

    "Created: / 28-11-2018 / 14:01:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

floatingPoint
    ^ FormatFloatingPoint

    "Created: / 28-11-2018 / 14:01:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

hexadecimal
    ^ FormatHexadecimal

    "Created: / 28-11-2018 / 14:01:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

octal
    ^ FormatOctal

    "Created: / 28-11-2018 / 14:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

paddedHexadecimal
    ^ FormatPaddedHexadecimal

    "Created: / 28-11-2018 / 13:07:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

raw    
    ^ FormatRaw

    "Created: / 28-11-2018 / 14:01:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

signedDecimal
    ^ FormatSignedDecimal

    "Created: / 28-11-2018 / 14:02:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

string
    ^ FormatString

    "Created: / 28-11-2018 / 14:02:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

unsignedDecimal
    ^ FormatUnsignedDecimal

    "Created: / 28-11-2018 / 14:02:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!GDBOutputFormat methodsFor:'accessing'!

description
    ^ description
!

format
    ^ format
!

name
    ^ name
! !

!GDBOutputFormat methodsFor:'displaying'!

displayString
    ^ name

    "Created: / 26-01-2018 / 00:46:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!GDBOutputFormat methodsFor:'initialization'!

format:formatArg name:nameArg description:descriptionArg 
    format := formatArg.
    name := nameArg.
    description := descriptionArg.
! !

!GDBOutputFormat methodsFor:'printing & storing'!

printOn:aStream
    "append a printed representation of the receiver to the argument, aStream"

    super printOn:aStream.
    aStream nextPutAll:'('.
    format printOn:aStream.
    aStream nextPutAll:')'.

    "Modified: / 28-11-2018 / 13:05:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!GDBOutputFormat class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
! !


GDBOutputFormat initialize!