Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
osx:
runs-on: macos-14
runs-on: macos-15
steps:
- run: python3 -m pip config set global.break-system-packages true
- run: brew install zmq sdl2 libelf
Expand Down
2 changes: 1 addition & 1 deletion Inc/orbtraceIf.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extern "C" {
#define NO_INTERFACE ((uint8_t)(-1))
#define NO_DEVICE (-1)

enum ORBTraceDevice { DEVICE_NULL, DEVICE_ORBTRACE_MINI, DEVICE_BMP, DEVICE_NUM_DEVICES };
enum ORBTraceDevice { DEVICE_NULL, DEVICE_ORBTRACE_MINI, DEVICE_BMP, DEVICE_ORBTRACE_MAX, DEVICE_NUM_DEVICES };

#define DEVTYPE_ALL 0xffffffff
#define DEVTYPE(x) (1<<x)
Expand Down
5 changes: 3 additions & 2 deletions Src/loadelf.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,8 +724,9 @@ static bool _loadSource( struct symbol *p )

if ( l )
{
*r++ = 0;
l--;
/* Back up to newline and replace it with \0 */
r--;
*r++ = '\0';
}
}
}
Expand Down
38 changes: 24 additions & 14 deletions Src/nwclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
#endif
#endif

#define MAX_WAIT_T 100

/* Master structure for the set of nwclients */
struct nwclientsHandle

Expand Down Expand Up @@ -168,15 +170,14 @@ static void *_listenTask( void *arg )
unsigned long mode = 0;
ioctlsocket( newsockfd, FIONBIO, &mode );
#else
int flags = fcntl( newsockfd, F_GETFL, 0 );

if ( flags == -1 )
{
return false;
}

flags |= O_NONBLOCK;
fcntl( newsockfd, F_SETFL, flags );
struct timeval timeout;
timeout.tv_sec = 0;
timeout.tv_usec = MAX_WAIT_T*1000;

if (setsockopt(newsockfd, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout)) < 0) {
genericsExit( -1, "Failed to set socket write timeout" EOL );
return false;
}
#endif

/* Hook into linked list */
Expand Down Expand Up @@ -233,6 +234,7 @@ void nwclientSend( struct nwclientsHandle *h, uint32_t len, const uint8_t *ipbuf
ssize_t sent = 0;
void *p = ( void * )ipbuffer;

errno = 0;
while ( t && ( sent >= 0 ) )
{
sent = send( n->fdNo, p, t, MSG_NOSIGNAL );
Expand All @@ -242,11 +244,19 @@ void nwclientSend( struct nwclientsHandle *h, uint32_t len, const uint8_t *ipbuf

if ( t )
{
genericsReport( V_INFO, "Killed connection index %d" EOL, n->fdNo );
volatile struct nwClient *newn = n->nextClient;
_clientRemoveNoLock( n );
n = newn;
}
if (errno == EAGAIN)
{
genericsReport( V_WARN, "Index %d not keeping up" EOL, n->fdNo );
}
else
{
genericsReport( V_INFO, "Killed connection index %d" EOL, n->fdNo );
}

volatile struct nwClient *oldn = n;
n = n->nextClient;
_clientRemoveNoLock( oldn );
}
else
{
n = n->nextClient;
Expand Down
3 changes: 2 additions & 1 deletion Src/orbdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ int main( int argc, char *argv[] )

genericsScreenHandling( !options.mono );

/* Reset the OFLOW handler before we start */
/* Reset the handlers before we start */
ITMDecoderInit( &_r.i, options.forceITMSync );
OFLOWInit( &_r.c );
stream = _tryOpenStream();

Expand Down
4 changes: 1 addition & 3 deletions Src/orblcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ static void _paintPixels( struct swMsg *m, struct RunTime *r )
/* For whatever reason we aren't initialised yet */
return;
}

for ( int b = m->len*8/ORBLCD_GET_DEPTH( r->app->modeDescriptor ) - 1; b >= 0; b-- )
//for ( int b = ORBLCD_PIXELS_PER_WORD( r->app->modeDescriptor ) - 1; b >= 0; b-- )
for ( int b = (m->len*8)/ORBLCD_GET_DEPTH( r->app->modeDescriptor ) - 1; b >= 0; b-- )
{
switch ( ORBLCD_DECODE_D( r->app->modeDescriptor ) )
{
Expand Down
2 changes: 1 addition & 1 deletion Src/orbmortem.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ static bool _processOptions( int argc, char *argv[], struct RunTime *r )

case PROT_ETM:
genericsReport( V_INFO, "Decoding ETM directly in legacy flow" EOL );
return false;
break;

default:
genericsReport( V_INFO, "Decoding unknown" EOL );
Expand Down
2 changes: 1 addition & 1 deletion Src/orbtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ int main( int argc, char *argv[] )

assert( _r.dev );

_r.ndevices = OrbtraceIfGetDeviceList( _r.dev, _r.options->sn, DEVTYPE( DEVICE_ORBTRACE_MINI ) );
_r.ndevices = OrbtraceIfGetDeviceList( _r.dev, _r.options->sn, DEVTYPE( DEVICE_ORBTRACE_MINI ) | DEVTYPE( DEVICE_ORBTRACE_MAX ) );

if ( !_r.ndevices )
{
Expand Down
3 changes: 3 additions & 0 deletions Src/orbtraceIf.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ static const struct OrbtraceInterfaceType _validDevices[DEVICE_NUM_DEVICES] =
{
{ 0x1209, 0x3443, DEVICE_ORBTRACE_MINI },
{ 0x1d50, 0x6018, DEVICE_BMP},
{ 0x1209, 0x3445, DEVICE_ORBTRACE_MAX },
{ 0, 0 }
};

Expand Down Expand Up @@ -347,6 +348,7 @@ int OrbtraceIfGetDeviceList( struct OrbtraceIf *o, char *sn, uint32_t devmask )

switch ( d->devtype )
{
case DEVICE_ORBTRACE_MAX:
case DEVICE_ORBTRACE_MINI:
d->powerIf = _getInterface( o, 'P', NULL );
d->traceIf = _getInterface( o, 'T', NULL );
Expand Down Expand Up @@ -528,6 +530,7 @@ bool OrbtraceGetIfandEP( struct OrbtraceIf *o )

break;

case DEVICE_ORBTRACE_MAX:
case DEVICE_ORBTRACE_MINI: // -------------------------------------------------------------------
genericsReport( V_DEBUG, "Searching for trace interface" EOL );
struct libusb_config_descriptor *config;
Expand Down
6 changes: 3 additions & 3 deletions Src/orbuculum.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ void _printVersion( struct RunTime *r )
{
genericsFPrintf( stderr, "orbuculum version " GIT_DESCRIBE EOL );
r->o = OrbtraceIfCreateContext();
int ndevices = OrbtraceIfGetDeviceList( r->o, NULL, DEVTYPE( DEVICE_ORBTRACE_MINI ) | DEVTYPE( DEVICE_BMP ) );
int ndevices = OrbtraceIfGetDeviceList( r->o, NULL, DEVTYPE( DEVICE_ORBTRACE_MAX ) | DEVTYPE( DEVICE_ORBTRACE_MINI ) | DEVTYPE( DEVICE_BMP ) );

if ( !ndevices )
{
Expand Down Expand Up @@ -1080,7 +1080,7 @@ void _actionOrbtraceCommand( struct RunTime *r, char *sn, enum ORBTraceDevice d
{
if ( getenv( ORBTRACEENVNAME ) )
{
snprintf( commandLine, MAX_LINE_LEN, "%s %s %s %s", getenv( ORBTRACEENVNAME ), r->options->otcl, sn ? ( ( d == DEVICE_ORBTRACE_MINI ) ? "-n " : "-s " ) : "", sn ? sn : "" );
snprintf( commandLine, MAX_LINE_LEN, "%s %s %s %s", getenv( ORBTRACEENVNAME ), r->options->otcl, sn ? ( ( d == DEVICE_ORBTRACE_MINI || d == DEVICE_ORBTRACE_MAX ) ? "-n " : "-s " ) : "", sn ? sn : "" );
}
else
{
Expand All @@ -1091,7 +1091,7 @@ void _actionOrbtraceCommand( struct RunTime *r, char *sn, enum ORBTraceDevice d
genericsExit( -1, "Failed to establish base directory" EOL );
}

snprintf( commandLine, MAX_LINE_LEN, "%s" ORBTRACE " %s %s %s", baseDirectory, r->options->otcl, sn ? ( ( d == DEVICE_ORBTRACE_MINI ) ? "-n " : "-s " ) : "", sn ? sn : "" );
snprintf( commandLine, MAX_LINE_LEN, "%s" ORBTRACE " %s %s %s", baseDirectory, r->options->otcl, sn ? ( ( d == DEVICE_ORBTRACE_MINI || d == DEVICE_ORBTRACE_MAX ) ? "-n " : "-s " ) : "", sn ? sn : "" );
free( baseDirectory );
}

Expand Down
3 changes: 2 additions & 1 deletion Src/orbzmq.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,8 @@ int main( int argc, char *argv[] )
_r.zmqSocket = zmq_socket( _r.zmqContext, ZMQ_PUB );
zmq_bind( _r.zmqSocket, "tcp://*:3442" ); //options.bindUrl );

/* Reset the OFLOW handler before we start */
/* Reset the handlers before we start */
ITMDecoderInit( &_r.i, options.forceITMSync );
OFLOWInit( &_r.c );

/* This ensures the signal handler gets called */
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ add_project_arguments('-DSCREEN_HANDLING', language: 'c')
add_project_arguments('-Wno-error=deprecated-declarations', language: 'c')
add_project_arguments(['-include', 'uicolours_default.h'], language: 'c')

libdwarf = subproject('libdwarf').get_variable('libdwarf')
libdwarf = subproject('libdwarf', default_options: ['werror=true']).get_variable('libdwarf')
dependencies += libdwarf

libcapstone = dependency('capstone', version: '>=4', required: false)
Expand Down
10 changes: 5 additions & 5 deletions subprojects/libdwarf.wrap
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[wrap-file]
directory = libdwarf-0.7.0
directory = libdwarf-2.3.2

source_url = https://www.prevanders.net/libdwarf-0.7.0.tar.xz
source_filename = libdwarf-0.7.0.tar.xz
source_hash = 23b71829de875fa5842e49f232c8ee1a5043805749738bc61424d9abc1189f38
source_url = https://github.com/davea42/libdwarf-code/releases/download/v2.3.2/libdwarf-2.3.2.tar.xz
source_filename = libdwarf-2.3.2.tar.xz
source_hash = 7992e7b9019ebfabdda5773e86243517c48cf89fafed3209e853692bc9573efd

diff_files = ./libdwarf/0001-fix-Use-project_source_root-for-subproject-compatibi.patch, ./libdwarf/0002-fix-compilation-clang.patch, ./libdwarf/0003-Fixed-calloc-arguments-order.patch
diff_files = ./libdwarf/0002-fix-compilation-clang.patch, ./libdwarf/0004-fix-remaining-Wall-warnings.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
diff --git a/meson.build b/meson.build
index 83ecd99..4d3fb4e 100644
--- a/meson.build
+++ b/meson.build
@@ -84,6 +84,10 @@ libdwarf_args = [ '-D__USE_MINGW_ANSI_STDIO=0' ]
@@ -150,6 +150,10 @@
if cc.get_id() == 'msvc'
libdwarf_args += [ '-D_CRT_NONSTDC_NO_WARNINGS', '-D_CRT_SECURE_NO_WARNINGS' ]
libdwarf_args += [ '-D_CRT_NONSTDC_NO_WARNINGS']
endif
+if cc.get_id() == 'clang'
+ add_project_arguments('-Wno-error=unused-but-set-variable', language: 'c')
Expand Down
Loading
Loading