2007-12-30 17:41:49 +01:00
|
|
|
/***************************************************************************
|
|
|
|
|
2009-08-17 12:41:51 +02:00
|
|
|
gbx_debug.h
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2013-08-03 17:38:01 +02:00
|
|
|
(c) 2000-2013 Benoît Minisini <gambas@users.sourceforge.net>
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2009-08-17 12:41:51 +02:00
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
2007-12-30 17:41:49 +01:00
|
|
|
any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2011-06-03 02:51:09 +02:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
2011-12-31 03:39:20 +01:00
|
|
|
MA 02110-1301, USA.
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __GBX_DEBUG_H
|
|
|
|
#define __GBX_DEBUG_H
|
|
|
|
|
|
|
|
#include "gbx_class.h"
|
2011-08-31 04:28:48 +02:00
|
|
|
#include "gbx_stack.h"
|
2007-12-30 17:41:49 +01:00
|
|
|
#include "gb_pcode.h"
|
|
|
|
#include "../lib/debug/gb.debug.h"
|
|
|
|
|
|
|
|
/* Object referencement debugging */
|
|
|
|
#define DEBUG_REF 0
|
|
|
|
/* String referencement debugging */
|
|
|
|
#define DEBUG_STRING 0
|
|
|
|
/* Bytecode debugging */
|
|
|
|
#define DEBUG_PCODE 0
|
|
|
|
/* Class loading debugging */
|
|
|
|
#define DEBUG_LOAD 0
|
|
|
|
/* Event debugging */
|
|
|
|
#define DEBUG_EVENT 0
|
|
|
|
/* Component management debugging */
|
|
|
|
#define DEBUG_COMP 0
|
2008-12-31 16:55:40 +01:00
|
|
|
/* Stream opening debugging */
|
|
|
|
#define DEBUG_STREAM 0
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
#ifndef __GBX_DEBUG_C
|
|
|
|
|
|
|
|
EXTERN DEBUG_INTERFACE DEBUG;
|
|
|
|
EXTERN DEBUG_INFO *DEBUG_info;
|
2014-04-05 02:28:41 +02:00
|
|
|
EXTERN int DEBUG_inside_eval;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2013-12-18 12:21:01 +01:00
|
|
|
#define DEBUG_is_init() (DEBUG_info != NULL)
|
|
|
|
|
2007-12-30 17:41:49 +01:00
|
|
|
void DEBUG_init(void);
|
|
|
|
void DEBUG_exit(void);
|
2012-05-20 19:58:34 +02:00
|
|
|
|
|
|
|
void DEBUG_enter_event_loop(void);
|
|
|
|
void DEBUG_leave_event_loop(void);
|
|
|
|
|
2007-12-30 17:41:49 +01:00
|
|
|
const char *DEBUG_get_position(CLASS *cp, FUNCTION *fp, PCODE *pc);
|
|
|
|
const char *DEBUG_get_current_position(void);
|
|
|
|
void DEBUG_where(void);
|
2012-05-20 19:58:34 +02:00
|
|
|
|
2007-12-30 17:41:49 +01:00
|
|
|
bool DEBUG_get_value(const char *sym, int len, GB_VARIANT *ret);
|
2009-08-24 16:19:32 +02:00
|
|
|
int DEBUG_set_value(const char *sym, int len, VALUE *value);
|
2009-02-16 22:39:07 +01:00
|
|
|
int DEBUG_get_object_access_type(void *object, CLASS *class, int *count);
|
2009-07-29 02:16:48 +02:00
|
|
|
GB_CLASS DEBUG_find_class(const char *name);
|
2014-04-05 02:28:41 +02:00
|
|
|
void DEBUG_enum_keys(void *object, GB_DEBUG_ENUM_CB cb);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2011-08-31 04:28:48 +02:00
|
|
|
void DEBUG_print_backtrace(STACK_BACKTRACE *bt);
|
2012-10-27 02:28:55 +02:00
|
|
|
void DEBUG_print_current_backtrace(void);
|
2011-08-31 04:28:48 +02:00
|
|
|
GB_ARRAY DEBUG_get_string_array_from_backtrace(STACK_BACKTRACE *bt);
|
2010-05-28 09:47:49 +02:00
|
|
|
|
2014-04-05 02:28:41 +02:00
|
|
|
void DEBUG_enter_eval(void);
|
|
|
|
void DEBUG_leave_eval(void);
|
|
|
|
|
2012-05-19 04:55:05 +02:00
|
|
|
#define PROFILE_ENTER_FUNCTION() \
|
|
|
|
if (EXEC_profile && CP && CP->component == COMPONENT_main) \
|
|
|
|
DEBUG.Profile.Begin(CP, FP); \
|
|
|
|
|
|
|
|
#define PROFILE_LEAVE_FUNCTION() \
|
|
|
|
if (EXEC_profile && CP && CP->component == COMPONENT_main) \
|
|
|
|
DEBUG.Profile.End(CP, FP); \
|
|
|
|
|
2007-12-30 17:41:49 +01:00
|
|
|
#endif
|