Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing C++ include guards #130

Merged
merged 3 commits into from
Nov 5, 2023
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
9 changes: 8 additions & 1 deletion Inc/loadelf.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#include <stdbool.h>
#include <capstone/capstone.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef unsigned long int symbolMemaddr;
typedef unsigned char *symbolMemptr;

Expand Down Expand Up @@ -121,11 +125,14 @@ char *symbolDisassembleLine( struct symbol *p, enum instructionClass *ic, symbol
void symbolDelete( struct symbol *p );

/* Collect symbol set with specified components */
struct symbol *symbolAquire( char *filename, bool loadlines, bool loadmem, bool loadsource );
struct symbol *symbolAcquire( char *filename, bool loadlines, bool loadmem, bool loadsource );

/* Check if current symbols are valid */
bool symbolSetValid( struct symbol *p );

// ====================================================================================================

#ifdef __cplusplus
}
#endif
#endif
7 changes: 7 additions & 0 deletions Inc/readsource.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
#ifndef _READSOURCE_H_
#define _READSOURCE_H_

#ifdef __cplusplus
extern "C" {
#endif

// ====================================================================================================

char *readsourcefile( char *path, size_t *l );

// ====================================================================================================

#ifdef __cplusplus
}
#endif
#endif

6 changes: 3 additions & 3 deletions Src/loadelf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ bool symbolSetValid( struct symbol *p )

// ====================================================================================================

struct symbol *symbolAquire( char *filename, bool loadlines, bool loadmem, bool loadsource )
struct symbol *symbolAcquire( char *filename, bool loadlines, bool loadmem, bool loadsource )

/* Collect symbol set with specified components */

Expand All @@ -1128,7 +1128,7 @@ struct symbol *symbolAquire( char *filename, bool loadlines, bool loadmem, bool
}

/* Load the functions and source code line mappings if requested */
if ( !_readLines( p ) )
if ( loadlines && !_readLines( p ) )
{
symbolDelete( p );
return NULL;
Expand Down Expand Up @@ -1237,7 +1237,7 @@ void main( int argc, char *argv[] )

{
enum instructionClass ic;
struct symbol *p = symbolAquire( argv[1], true, true, true );
struct symbol *p = symbolAcquire( argv[1], true, true, true );

if ( !p )
{
Expand Down
4 changes: 2 additions & 2 deletions Src/orbmortem.c
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ static bool _dumpBuffer( struct RunTime *r )
{
symbolDelete( r->s );

if ( !( r->s = symbolAquire( r->options->elffile, true, true, true ) ) )
if ( !( r->s = symbolAcquire( r->options->elffile, true, true, true ) ) )
{
genericsReport( V_ERROR, "Elf file or symbols in it not found" EOL );
return false;
Expand Down Expand Up @@ -1270,7 +1270,7 @@ int main( int argc, char *argv[] )
}

/* Check we've got _some_ symbols to start from */
_r.s = symbolAquire( _r.options->elffile, true, true, true );
_r.s = symbolAcquire( _r.options->elffile, true, true, true );

if ( !_r.s )
{
Expand Down
Loading