# HG changeset patch # User Jan Vrany # Date 1645532482 0 # Node ID 9e2ac3a4f23cd2376edf0e8180be6847eae5dad4 # Parent 7b97dc7ee9a034d5410431ca3d197a281bf8699f Improved `GDBEvent >> #printOn:` ...to allow printing details. This is usefull when analyzing event processing trace logs. diff -r 7b97dc7ee9a0 -r 9e2ac3a4f23c GDBCommandEvent.st --- a/GDBCommandEvent.st Wed Jan 26 16:06:07 2022 +0000 +++ b/GDBCommandEvent.st Tue Feb 22 12:21:22 2022 +0000 @@ -1,6 +1,7 @@ " jv:libgdbs - GNU Debugger Interface Library Copyright (C) 2015-now Jan Vrany +Copyright (C) 2022 LabWare This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -33,6 +34,7 @@ " jv:libgdbs - GNU Debugger Interface Library Copyright (C) 2015-now Jan Vrany +Copyright (C) 2022 LabWare This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -71,6 +73,14 @@ "Created: / 11-06-2014 / 12:49:40 / Jan Vrany " ! ! +!GDBCommandEvent methodsFor:'printing & storing'! + +printDetailOn: aStream + aStream nextPutAll: command asString + + "Created: / 22-02-2022 / 11:56:18 / Jan Vrany " +! ! + !GDBCommandEvent class methodsFor:'documentation'! version_HG diff -r 7b97dc7ee9a0 -r 9e2ac3a4f23c GDBCommandResultEvent.st --- a/GDBCommandResultEvent.st Wed Jan 26 16:06:07 2022 +0000 +++ b/GDBCommandResultEvent.st Tue Feb 22 12:21:22 2022 +0000 @@ -1,6 +1,7 @@ " jv:libgdbs - GNU Debugger Interface Library Copyright (C) 2015-now Jan Vrany +Copyright (C) 2022 LabWare This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -33,6 +34,7 @@ " jv:libgdbs - GNU Debugger Interface Library Copyright (C) 2015-now Jan Vrany +Copyright (C) 2022 LabWare This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -76,18 +78,13 @@ !GDBCommandResultEvent methodsFor:'printing & storing'! -printOn:aStream - "append a printed representation of the receiver to the argument, aStream" +printDetailOn: aStream + aStream + nextPutAll: result status; + nextPutAll:', '; + nextPutAll: result command asString. - super printOn:aStream. - aStream - nextPut:$(; - nextPutAll: result status; - nextPutAll:': '; - nextPutAll: result command asString; - nextPut:$). - - "Created: / 19-01-2019 / 22:59:13 / Jan Vrany " + "Created: / 22-02-2022 / 11:53:23 / Jan Vrany " ! ! !GDBCommandResultEvent methodsFor:'testing'! diff -r 7b97dc7ee9a0 -r 9e2ac3a4f23c GDBEvent.st --- a/GDBEvent.st Wed Jan 26 16:06:07 2022 +0000 +++ b/GDBEvent.st Tue Feb 22 12:21:22 2022 +0000 @@ -1,7 +1,7 @@ " jv:libgdbs - GNU Debugger Interface Library Copyright (C) 2015-now Jan Vrany -Copyright (C) 2021 LabWare +Copyright (C) 2021-2022 LabWare This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -34,7 +34,7 @@ " jv:libgdbs - GNU Debugger Interface Library Copyright (C) 2015-now Jan Vrany -Copyright (C) 2021 LabWare +Copyright (C) 2021-2022 LabWare This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -108,6 +108,31 @@ "Modified: / 20-06-2014 / 09:05:34 / Jan Vrany " ! ! +!GDBEvent methodsFor:'printing & storing'! + +printDetailOn: aStream + "Nothing special, to be overriden by subclasses" + + "Created: / 22-02-2022 / 11:52:38 / Jan Vrany " +! + +printOn:aStream + "append a printed representation of the receiver to the argument, aStream" + + super printOn:aStream. + aStream nextPut: $(. + token notNil ifTrue: [ + token printOn: aStream base: 10 size: 3 fill: Character space. + ] ifFalse: [ + aStream nextPutAll: '???'. + ]. + aStream nextPutAll: ', '. + self printDetailOn: aStream. + aStream nextPut: $). + + "Created: / 22-02-2022 / 11:52:11 / Jan Vrany " +! ! + !GDBEvent methodsFor:'private - dispatching'! dispatchUsing: aGDBEventDispatcher diff -r 7b97dc7ee9a0 -r 9e2ac3a4f23c GDBEventDispatcher.st --- a/GDBEventDispatcher.st Wed Jan 26 16:06:07 2022 +0000 +++ b/GDBEventDispatcher.st Tue Feb 22 12:21:22 2022 +0000 @@ -1,7 +1,7 @@ " jv:libgdbs - GNU Debugger Interface Library Copyright (C) 2015-now Jan Vrany -Copyright (C) 2021 LabWare +Copyright (C) 2021-2022 LabWare This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -34,7 +34,7 @@ " jv:libgdbs - GNU Debugger Interface Library Copyright (C) 2015-now Jan Vrany -Copyright (C) 2021 LabWare +Copyright (C) 2021-2022 LabWare This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -75,8 +75,7 @@ | index | Logger - log:('event loop: pushing %1 (%2)' bindWith:aGDBEvent class name - with:aGDBEvent token) + log:('event loop: pushing %1' bindWith:aGDBEvent) severity:#trace facility:'GDB' originator:self @@ -98,7 +97,7 @@ "Created: / 02-06-2014 / 22:49:49 / Jan Vrany " "Modified: / 02-10-2018 / 14:30:04 / Jan Vrany " - "Modified (comment): / 22-05-2021 / 16:49:54 / Jan Vrany " + "Modified: / 22-02-2022 / 11:56:54 / Jan Vrany " ! pushEventSet: aGDBEventSet @@ -153,8 +152,7 @@ aGDBEvent debugger: debugger. TraceEvents ifTrue:[ Logger - log:('event loop: broadcasting %1 (%2)' bindWith:aGDBEvent class name - with:aGDBEvent token) + log:('event loop: broadcasting %1' bindWith:aGDBEvent) severity:#trace facility:'GDB' originator:self @@ -182,7 +180,7 @@ "Created: / 02-06-2014 / 22:58:20 / Jan Vrany " "Modified: / 02-10-2018 / 14:36:04 / Jan Vrany " - "Modified: / 29-03-2021 / 12:44:25 / Jan Vrany " + "Modified: / 22-02-2022 / 11:57:30 / Jan Vrany " ! dispatchEvents diff -r 7b97dc7ee9a0 -r 9e2ac3a4f23c GDBFrame.st --- a/GDBFrame.st Wed Jan 26 16:06:07 2022 +0000 +++ b/GDBFrame.st Tue Feb 22 12:21:22 2022 +0000 @@ -1,7 +1,7 @@ " jv:libgdbs - GNU Debugger Interface Library Copyright (C) 2015-now Jan Vrany -Copyright (C) 2021 LabWare +Copyright (C) 2021-2022 LabWare This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -35,7 +35,7 @@ " jv:libgdbs - GNU Debugger Interface Library Copyright (C) 2015-now Jan Vrany -Copyright (C) 2021 LabWare +Copyright (C) 2021-2022 LabWare This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -352,7 +352,13 @@ super printOn: aStream. aStream nextPutAll:'('. - level printOn:aStream base: 10 size: 2 fill: Character space. + "/ In rare occations, level may be nil, for example if frame object + "/ comes from stopped event. sigh... + level isNil ifTrue: [ + aStream nextPutAll: ' ?' + ] ifFalse: [ + level printOn:aStream base: 10 size: 2 fill: Character space. + ]. aStream nextPutAll:' '. addr printOn:aStream. aStream nextPutAll:' '. @@ -364,6 +370,7 @@ aStream nextPutAll:')'. "Modified: / 27-02-2015 / 15:21:13 / Jan Vrany " + "Modified: / 22-02-2022 / 11:24:30 / Jan Vrany " ! ! !GDBFrame methodsFor:'private'! diff -r 7b97dc7ee9a0 -r 9e2ac3a4f23c GDBStreamOutputEvent.st --- a/GDBStreamOutputEvent.st Wed Jan 26 16:06:07 2022 +0000 +++ b/GDBStreamOutputEvent.st Tue Feb 22 12:21:22 2022 +0000 @@ -1,6 +1,7 @@ " jv:libgdbs - GNU Debugger Interface Library Copyright (C) 2015-now Jan Vrany +Copyright (C) 2022 LabWare This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -33,6 +34,7 @@ " jv:libgdbs - GNU Debugger Interface Library Copyright (C) 2015-now Jan Vrany +Copyright (C) 2022 LabWare This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -78,14 +80,9 @@ !GDBStreamOutputEvent methodsFor:'printing & storing'! -printOn:aStream - "append a printed representation if the receiver to the argument, aStream" +printDetailOn:aStream + value printOn:aStream - super printOn:aStream. - aStream nextPut:$(. - value printOn:aStream. - aStream nextPut:$). - - "Modified: / 03-06-2014 / 00:18:39 / Jan Vrany " + "Created: / 22-02-2022 / 11:53:46 / Jan Vrany " ! ! diff -r 7b97dc7ee9a0 -r 9e2ac3a4f23c GDBThread.st --- a/GDBThread.st Wed Jan 26 16:06:07 2022 +0000 +++ b/GDBThread.st Tue Feb 22 12:21:22 2022 +0000 @@ -1,7 +1,7 @@ " jv:libgdbs - GNU Debugger Interface Library Copyright (C) 2015-now Jan Vrany -Copyright (C) 2020-2021 LabWare +Copyright (C) 2020-2022 LabWare This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -34,7 +34,7 @@ " jv:libgdbs - GNU Debugger Interface Library Copyright (C) 2015-now Jan Vrany -Copyright (C) 2020-2021 LabWare +Copyright (C) 2020-2022 LabWare This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -199,10 +199,12 @@ aGDBThreadSelectedEvent setThread: self. "/ Be carefull, thread may be running!! - (false "thread isStopped and:[frame notNil]") ifTrue:[ - "/ This is actually not a good idea. This code is executed - "/ within event dispatching process so one may not execute - "/ more commands - which is what `thread stack` does. Sigh. + (self isStopped and:[frame notNil]) ifTrue:[ + "/ Beware, `self stack` may execute another command + "/ and this is called from within event dispatch loop. + "/ + "/ This was not possible before, but now it should + "/ (see commit bf5cfa214dd4) aGDBThreadSelectedEvent setFrame: (self stack at: (frame level + 1)) ] ifFalse:[ "/ If it is running, at least fixup event's frame, if there's any (it may not @@ -217,6 +219,7 @@ "Created: / 29-07-2018 / 22:21:48 / Jan Vrany " "Modified: / 20-11-2019 / 22:09:37 / Jan Vrany " + "Modified: / 25-01-2022 / 15:23:24 / Jan Vrany " ! ! !GDBThread methodsFor:'initialization'!