summaryrefslogtreecommitdiff
path: root/dbug
diff options
context:
space:
mode:
Diffstat (limited to 'dbug')
-rw-r--r--dbug/dbug.c36
-rw-r--r--dbug/dbug_analyze.c2
-rw-r--r--dbug/example1.c2
-rw-r--r--dbug/example2.c2
-rw-r--r--dbug/example3.c2
-rw-r--r--dbug/factorial.c2
-rw-r--r--dbug/main.c2
-rw-r--r--dbug/sanity.c2
8 files changed, 33 insertions, 17 deletions
diff --git a/dbug/dbug.c b/dbug/dbug.c
index cfe4ca161c6..88d8043c0e5 100644
--- a/dbug/dbug.c
+++ b/dbug/dbug.c
@@ -21,7 +21,8 @@
* all copies and derivative works. Thank you. *
* *
* The author makes no warranty of any kind with respect to this *
- * product and explicitly disclaims any implied warranties of mer- *
+ * product and explicitly disclaims any implied warranties of mer- *ct_lex.table_list.first=0;
+ thd->lex.selec
* chantability or fitness for any particular purpose. *
* *
******************************************************************************
@@ -58,7 +59,7 @@
* seismo!bpa!sjuvax!bbanerje
*
* Michael Widenius:
- * DBUG_DUMP - To dump a pice of memory.
+ * DBUG_DUMP - To dump a block of memory.
* PUSH_FLAG "O" - To be used insted of "o" if we don't
* want flushing (for slow systems)
* PUSH_FLAG "A" - as 'O', but we will append to the out file instead
@@ -69,7 +70,7 @@
#ifdef DBUG_OFF
#undef DBUG_OFF
#endif
-#include <global.h>
+#include <my_global.h>
#include <m_string.h>
#include <errno.h>
#if defined(MSDOS) || defined(__WIN__)
@@ -705,9 +706,15 @@ char ***_sframep_ __attribute__((unused)))
if (!_no_db_)
{
int save_errno=errno;
+ /* Sasha: the test below is so we could call functions with DBUG_ENTER
+ before my_thread_init(). I needed this because I suspected corruption
+ of a block allocated by my_thread_init() itself, so I wanted to use
+ my_malloc()/my_free() in my_thread_init()/my_thread_end()
+ */
+ if (!(state=code_state()))
+ return;
if (!init_done)
_db_push_ (_DBUG_START_CONDITION_);
- state=code_state();
*_sfunc_ = state->func;
*_sfile_ = state->file;
@@ -787,10 +794,10 @@ uint *_slevel_)
if (!_no_db_)
{
int save_errno=errno;
+ if (!(state=code_state()))
+ return;
if (!init_done)
_db_push_ ("");
- if (!(state=code_state()))
- return; /* Only happens at end of program */
if (stack->flags & (TRACE_ON | DEBUG_ON | PROFILE_ON))
{
if (!state->locked)
@@ -855,6 +862,9 @@ uint _line_,
const char *keyword)
{
CODE_STATE *state=code_state();
+ /* Sasha: pre-my_thread_init() safety */
+ if (!state)
+ return;
state->u_line = _line_;
state->u_keyword = (char*) keyword;
}
@@ -890,7 +900,9 @@ void _db_doprnt_ (const char *format,...)
{
va_list args;
CODE_STATE *state;
- state=code_state();
+ /* Sasha: pre-my_thread_init() safety */
+ if (!(state=code_state()))
+ return;
va_start(args,format);
@@ -942,7 +954,9 @@ uint length)
int pos;
char dbuff[90];
CODE_STATE *state;
- state=code_state();
+ /* Sasha: pre-my_thread_init() safety */
+ if (!(state=code_state()))
+ return;
if (_db_keyword_ ((char*) keyword))
{
@@ -1224,7 +1238,9 @@ const char *keyword)
if (!init_done)
_db_push_ ("");
- state=code_state();
+ /* Sasha: pre-my_thread_init() safety */
+ if (!(state=code_state()))
+ return FALSE;
result = FALSE;
if (DEBUGGING &&
state->level <= stack -> maxdepth &&
@@ -1928,7 +1944,7 @@ static void dbug_flush(CODE_STATE *state)
{
if (!(freopen(stack->name,"a",_db_fp_)))
{
- (void) fprintf(stderr, ERR_OPEN, _db_process_);
+ (void) fprintf(stderr, ERR_OPEN, _db_process_, stack->name);
fflush(stderr);
_db_fp_ = stdout;
stack -> out_file = _db_fp_;
diff --git a/dbug/dbug_analyze.c b/dbug/dbug_analyze.c
index bcee5230527..de228c64aa5 100644
--- a/dbug/dbug_analyze.c
+++ b/dbug/dbug_analyze.c
@@ -49,7 +49,7 @@
* if invoked with -v flag.
*/
-#include <global.h>
+#include <my_global.h>
#include <m_string.h>
static char *my_name;
diff --git a/dbug/example1.c b/dbug/example1.c
index 932e269cc4c..e468f065796 100644
--- a/dbug/example1.c
+++ b/dbug/example1.c
@@ -1,5 +1,5 @@
-#include <global.h>
+#include <my_global.h>
main (argc, argv)
int argc;
diff --git a/dbug/example2.c b/dbug/example2.c
index 482691a8a74..5e5f14f0e7e 100644
--- a/dbug/example2.c
+++ b/dbug/example2.c
@@ -1,5 +1,5 @@
-#include <global.h>
+#include <my_global.h>
int debug = 0;
diff --git a/dbug/example3.c b/dbug/example3.c
index b504edf2e61..f177c07425d 100644
--- a/dbug/example3.c
+++ b/dbug/example3.c
@@ -1,5 +1,5 @@
-#include <global.h>
+#include <my_global.h>
main (argc, argv)
int argc;
diff --git a/dbug/factorial.c b/dbug/factorial.c
index 0dda5c7459e..56197aef29e 100644
--- a/dbug/factorial.c
+++ b/dbug/factorial.c
@@ -2,7 +2,7 @@
#undef DBUG_OFF
#endif
-#include <global.h>
+#include <my_global.h>
int factorial (
register int value)
diff --git a/dbug/main.c b/dbug/main.c
index 863b4d319c2..da56c00feb3 100644
--- a/dbug/main.c
+++ b/dbug/main.c
@@ -2,7 +2,7 @@
#undef DBUG_OFF
#endif
-#include <global.h> /* This includes dbug.h */
+#include <my_global.h> /* This includes dbug.h */
int main (argc, argv)
int argc;
diff --git a/dbug/sanity.c b/dbug/sanity.c
index d287a468028..df43fc14ba9 100644
--- a/dbug/sanity.c
+++ b/dbug/sanity.c
@@ -1,6 +1,6 @@
/* Declarate _sanity() if not declared in main program */
-#include <global.h>
+#include <my_global.h>
extern int _sanity(const char *file,uint line);