Skip to content

Commit

Permalink
Add more debug code into swig internals
Browse files Browse the repository at this point in the history
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12928 626c5289-ae23-0410-ae9c-e8d60b6d4f22
  • Loading branch information
joequant committed Mar 17, 2012
1 parent 023d597 commit 1ca411b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Source/Swig/include.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ static List *directories = 0; /* List of include directories */
static String *lastpath = 0; /* Last file that was included */
static List *pdirectories = 0; /* List of pushed directories */
static int dopush = 1; /* Whether to push directories */
static int file_debug = 1;

/* This functions determine whether to push/pop dirs in the preprocessor */
void Swig_set_push_dir(int push) {
Expand Down Expand Up @@ -173,6 +174,9 @@ static FILE *Swig_open_file(const_String_or_char_ptr name, int sysfile, int use_
cname = Char(name);
filename = NewString(cname);
assert(filename);
if (file_debug) {
Printf(stdout, " Open: %s\n", filename);
}
f = fopen(Char(filename), "r");
if (!f && use_include_path) {
spath = Swig_search_path_any(sysfile);
Expand Down Expand Up @@ -386,3 +390,10 @@ char *Swig_file_dirname(const_String_or_char_ptr filename) {
*(++c) = 0;
return tmp;
}

/*
* Swig_file_debug()
*/
void Swig_file_debug_set() {
file_debug = 1;
}
1 change: 1 addition & 0 deletions Source/Swig/swig.h
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ extern int ParmList_is_compactdefargs(ParmList *p);
extern void Swig_typemap_debug(void);
extern void Swig_typemap_search_debug_set(void);
extern void Swig_typemap_used_debug_set(void);
extern void Swig_typemap_register_debug_set(void);

extern String *Swig_typemap_lookup(const_String_or_char_ptr tmap_method, Node *n, const_String_or_char_ptr lname, Wrapper *f);
extern String *Swig_typemap_lookup_out(const_String_or_char_ptr tmap_method, Node *n, const_String_or_char_ptr lname, Wrapper *f, String *actioncode);
Expand Down
1 change: 1 addition & 0 deletions Source/Swig/swigfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ extern char *Swig_file_suffix(const_String_or_char_ptr filename);
extern char *Swig_file_basename(const_String_or_char_ptr filename);
extern char *Swig_file_filename(const_String_or_char_ptr filename);
extern char *Swig_file_dirname(const_String_or_char_ptr filename);
extern void Swig_file_debug_set();

/* Delimiter used in accessing files and directories */

Expand Down
18 changes: 17 additions & 1 deletion Source/Swig/typemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ char cvsroot_typemap_c[] = "$Id$";

static int typemap_search_debug = 0;
static int typemaps_used_debug = 0;
static int typemap_register_debug = 0;
static int in_typemap_search_multi = 0;

static void replace_embedded_typemap(String *s, ParmList *parm_sublist, Wrapper *f, Node *file_line_node);
Expand Down Expand Up @@ -191,9 +192,14 @@ static void typemap_register(const_String_or_char_ptr tmap_method, ParmList *par
String *tm_method;
SwigType *type;
String *pname;

if (!parms)
return;

if (typemap_register_debug) {
Printf(stdout, "Registering - %s\n", tmap_method);
Swig_print_node(parms);
}

tm_method = typemap_method_name(tmap_method);

/* Register the first type in the parameter list */
Expand Down Expand Up @@ -2064,3 +2070,13 @@ void Swig_typemap_used_debug_set(void) {
typemaps_used_debug = 1;
}

/* -----------------------------------------------------------------------------
* Swig_typemap_register_debug_set()
*
* Turn on typemaps used debug display
* ----------------------------------------------------------------------------- */

void Swig_typemap_register_debug_set(void) {
typemap_register_debug = 1;
}

0 comments on commit 1ca411b

Please sign in to comment.