diff --git a/.github/workflows/build-osx.yml b/.github/workflows/build-osx.yml index 68797735..2a50dae3 100644 --- a/.github/workflows/build-osx.yml +++ b/.github/workflows/build-osx.yml @@ -6,8 +6,9 @@ on: jobs: osx: - runs-on: macos-12 + runs-on: macos-14 steps: + - run: rm /usr/lib/python3.11/EXTERNALLY-MANAGED - run: brew install zmq sdl2 libelf - run: pip3 install meson - run: pip3 install ninja diff --git a/Inc/generics.h b/Inc/generics.h index 7f1d8b23..becbea74 100644 --- a/Inc/generics.h +++ b/Inc/generics.h @@ -20,6 +20,7 @@ extern "C" { #endif /* Error return codes .. may already be defined by ncurses */ +typedef int errcode; #ifndef OK #define OK 0 #endif diff --git a/README.md b/README.md index 0a249769..d22a58e2 100644 --- a/README.md +++ b/README.md @@ -737,7 +737,8 @@ line for orbtop would be; One useful command line option for orbtop (and indeed, for the majority of the rest of the suite) is `-s localhost:2332`, which will connect directly to any source you might have exporting -SWO data on its TCP its port, with no requirement for the orbuculum multiplexer in the way. +SWO data on its TCP its port, with no requirement for the orbuculum multiplexer in the way. If +you set the source explicitly, you also need to set the protocol explicitly using `-p`. Command line options for orbtop are; @@ -769,6 +770,10 @@ Command line options for orbtop are; `-O, --objdump-opts [opts]`: Set options to pass directly to objdump + `-p, --protocol [OFLOW|ITM]`: Protocol to communicate. Must be set explicitly if -s is set + + `-P, --pace `: Delay in block of data transmission to clients + `-r, --routines `: Number of lines to record in history file `-R, --report-file [filename]`: Report filenames as part of function discriminator diff --git a/Src/orbtop.c b/Src/orbtop.c index 3f1b0b52..8674aac1 100644 --- a/Src/orbtop.c +++ b/Src/orbtop.c @@ -953,7 +953,7 @@ static struct option _longOptions[] = {NULL, no_argument, NULL, 0} }; // ==================================================================================================== -bool _processOptions( int argc, char *argv[] ) +errcode _processOptions( int argc, char *argv[] ) { int c, optionIndex = 0; @@ -1053,7 +1053,7 @@ bool _processOptions( int argc, char *argv[] ) if ( options.protocol == PROT_UNKNOWN ) { genericsReport( V_ERROR, "Unrecognised protocol type" EOL ); - return false; + return ERR; } break; @@ -1066,7 +1066,7 @@ bool _processOptions( int argc, char *argv[] ) if ( options.paceDelay <= 0 ) { genericsReport( V_ERROR, "paceDelay is out of range" EOL ); - return false; + return ERR; } break; @@ -1082,7 +1082,7 @@ bool _processOptions( int argc, char *argv[] ) if ( !isdigit( *optarg ) ) { genericsReport( V_ERROR, "-v requires a numeric argument." EOL ); - return false; + return ERR; } genericsSetReportLevel( atoi( optarg ) ); @@ -1132,7 +1132,7 @@ bool _processOptions( int argc, char *argv[] ) // ------------------------------------ case 'V': _printVersion(); - return -EINVAL; + return ERR; // ------------------------------------ case '?': @@ -1145,25 +1145,26 @@ bool _processOptions( int argc, char *argv[] ) genericsReport( V_ERROR, "Unknown option character `\\x%x'." EOL, optopt ); } - return -EINVAL; + return ERR; // ------------------------------------ default: genericsReport( V_ERROR, "Unknown option %c" EOL, optopt ); - return -EINVAL; + return ERR; // ------------------------------------ } /* If we set an explicit server and port and didn't set a protocol chances are we want ITM, not OFLOW */ if ( serverExplicit && !protExplicit ) { - options.protocol = PROT_ITM; + genericsReport( V_ERROR, "Protocol must be explicit when server is explicit" EOL ); + return ERR; } if ( !options.elffile ) { genericsReport( V_ERROR, "Elf File not specified" EOL ); - exit( -EBADF ); + return ERR; } genericsReport( V_INFO, "orbtop version " GIT_DESCRIBE EOL ); @@ -1197,14 +1198,14 @@ bool _processOptions( int argc, char *argv[] ) break; default: - genericsReport( V_INFO, "Decoding unknown" EOL ); - return false; + genericsReport( V_ERROR, "Decoding unknown" EOL ); + return ERR; } if ( ( options.paceDelay ) && ( !options.file ) ) { genericsReport( V_ERROR, "Pace Delay only makes sense when input is from a file" EOL ); - return false; + return ERR; } return OK; diff --git a/Src/symbols.c b/Src/symbols.c index d428b79c..13bd93cb 100644 --- a/Src/symbols.c +++ b/Src/symbols.c @@ -950,8 +950,6 @@ bool SymbolLookup( struct SymbolSet *s, uint32_t addr, struct nameEntry *n ) return true; } - - printf("%08x ",addr); n->fileindex = n->functionindex = n->line = 0; n->source = ""; n->assy = NULL;