Skip to content

Commit

Permalink
more useful GDB_xxx tool functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
rainwoodman committed Nov 26, 2014
1 parent cd18953 commit 03ece76
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions gdbtools.c
Expand Up @@ -7,14 +7,31 @@
/* these are for debuging in GDB */
#include "allvars.h"

int particle_by_id(MyIDType id) {
int GDB_particle_by_id(MyIDType id, int from) {
int i;
for(i = 0; i < NumPart; i++) {
for(i = from; i < NumPart; i++) {
if(P[i].ID == id) return i;
}
return -1;
}
char * particle_by_timebin(int bin) {

int GDB_particle_by_type(int type, int from) {
int i;
for(i = from; i < NumPart; i++) {
if(P[i].Type == type) return i;
}
return -1;
}

int GDB_particle_by_generation(int gen, int from) {
int i;
for(i = from; i < NumPart; i++) {
if(P[i].Generation == gen) return i;
}
return -1;
}

char * GDB_particle_by_timebin(int bin) {
int i;
static char buf[1024];
char tmp[1024];
Expand Down

0 comments on commit 03ece76

Please sign in to comment.