@@ -12,7 +12,7 @@ import { MemoryContentProvider } from './memory_content_provider';
1212import Reporting from '../reporting' ;
1313
1414import { CortexDebugConfigurationProvider } from './configprovider' ;
15- import { JLinkSocketRTTSource , SocketRTTSource , SocketSWOSource , PeMicroSocketSource } from './swo/sources/socket' ;
15+ import { JLinkSocketRTTSource , SocketRTTSource , SocketSWOSource , PeMicroSocketSource , DefmtSocketRTTSource } from './swo/sources/socket' ;
1616import { FifoSWOSource } from './swo/sources/fifo' ;
1717import { FileSWOSource } from './swo/sources/file' ;
1818import { SerialSWOSource } from './swo/sources/serial' ;
@@ -770,7 +770,7 @@ export class CortexDebugExtension {
770770 private receivedRTTConfigureEvent ( e : vscode . DebugSessionCustomEvent ) {
771771 if ( e . body . type === 'socket' ) {
772772 const decoder : RTTCommonDecoderOpts = e . body . decoder ;
773- if ( ( decoder . type === 'console' ) || ( decoder . type === 'binary' ) ) {
773+ if ( ( decoder . type === 'console' ) || ( decoder . type === 'binary' ) || ( decoder . type === 'defmt' ) ) {
774774 Reporting . sendEvent ( 'RTT' , 'Source' , 'Socket: Console' ) ;
775775 this . rttCreateTerninal ( e , decoder as RTTConsoleDecoderOpts ) ;
776776 } else {
@@ -793,6 +793,7 @@ export class CortexDebugExtension {
793793 // state.
794794 private createRTTSource ( e : vscode . DebugSessionCustomEvent , tcpPort : string , channel : number ) : Promise < SocketRTTSource > {
795795 const mySession = CDebugSession . GetSession ( e . session ) ;
796+ const wsPath = e . session . workspaceFolder . uri . fsPath ;
796797 return new Promise ( ( resolve , reject ) => {
797798 let src = mySession . rttPortMap [ channel ] ;
798799 if ( src ) {
@@ -801,6 +802,8 @@ export class CortexDebugExtension {
801802 }
802803 if ( mySession . config . servertype === 'jlink' ) {
803804 src = new JLinkSocketRTTSource ( tcpPort , channel ) ;
805+ } else if ( e . body . decoder . type === 'defmt' ) {
806+ src = new DefmtSocketRTTSource ( tcpPort , channel , e . body . executable , wsPath ) ;
804807 } else {
805808 src = new SocketRTTSource ( tcpPort , channel ) ;
806809 }
0 commit comments