@@ -88,7 +88,9 @@ import {
8888 genGithubHash , md5 , toArray , newMarkdownString , newFileTooltipString , FileTooltipInfo , escapeXml ,
8989 readGithubRepoTxtFile , downloadFile , notifyReloadWindow , formatPath , execInternalCommand ,
9090 copyAndMakeObjectKeysToLowerCase ,
91- sortPaths
91+ sortPaths ,
92+ getGccBinutilsVersion ,
93+ compareVersion
9294} from './utility' ;
9395import { concatSystemEnvPath , DeleteDir , exeSuffix , kill , osType , DeleteAllChildren } from './Platform' ;
9496import { KeilARMOption , KeilC51Option , KeilParser , KeilRteDependence } from './KeilXmlParser' ;
@@ -5010,6 +5012,11 @@ export class ProjectExplorer implements CustomConfigurationProvider {
50105012 exeFile = File . fromArray ( [ prj . getToolchain ( ) . getToolchainDir ( ) . path , 'bin' , `${ toolPrefix } objdump${ exeSuffix ( ) } ` ] ) ;
50115013 if ( ! exeFile . IsFile ( ) ) { throw Error ( `Not found '${ exeFile . name } ' !` ) }
50125014 cmds = [ '-S' , '-l' , elfPath , '>' , dasmFile . path ] ;
5015+ // https://interrupt.memfault.com/blog/gnu-binutils#new-feature-visualize-jumps
5016+ const binutilsVer = getGccBinutilsVersion ( exeFile . dir , toolPrefix , 'objdump' ) ;
5017+ if ( binutilsVer && compareVersion ( binutilsVer , '2.34' ) > 0 ) {
5018+ cmds = [ '--visualize-jumps' ] . concat ( cmds ) ;
5019+ }
50135020 }
50145021 else if ( toolchainName . startsWith ( 'AC' ) ) { // armcc
50155022 exeFile = File . fromArray ( [ prj . getToolchain ( ) . getToolchainDir ( ) . path , 'bin' , `fromelf${ exeSuffix ( ) } ` ] ) ;
@@ -5124,6 +5131,11 @@ export class ProjectExplorer implements CustomConfigurationProvider {
51245131 exeFile = File . fromArray ( [ activePrj . getToolchain ( ) . getToolchainDir ( ) . path , 'bin' , `${ toolPrefix } objdump${ exeSuffix ( ) } ` ] ) ;
51255132 if ( ! exeFile . IsFile ( ) ) { throw Error ( `Not found '${ exeFile . name } ' !` ) }
51265133 cmds = [ '-S' , '-l' , objPath , '>' , tmpFile . path ] ;
5134+ // https://interrupt.memfault.com/blog/gnu-binutils#new-feature-visualize-jumps
5135+ const binutilsVer = getGccBinutilsVersion ( exeFile . dir , toolPrefix , 'objdump' ) ;
5136+ if ( binutilsVer && compareVersion ( binutilsVer , '2.34' ) > 0 ) {
5137+ cmds = [ '--visualize-jumps' ] . concat ( cmds ) ;
5138+ }
51275139 }
51285140 else if ( toolchainName . startsWith ( 'AC' ) ) { // armcc
51295141 exeFile = File . fromArray ( [ activePrj . getToolchain ( ) . getToolchainDir ( ) . path , 'bin' , `fromelf${ exeSuffix ( ) } ` ] ) ;
0 commit comments