annotate src/nbdebug.h @ 16350:ffa791471a4c v8.1.1180

patch 8.1.1180: Vim script debugger tests are old style commit https://github.com/vim/vim/commit/113bf0672b114af5800fa642bcd09f674758e5d5 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Apr 17 16:54:05 2019 +0200 patch 8.1.1180: Vim script debugger tests are old style Problem: Vim script debugger tests are old style. Solution: Turn into new style tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/4259)
author Bram Moolenaar <Bram@vim.org>
date Wed, 17 Apr 2019 17:00:06 +0200
parents c7ba5fed403c
children 6e3dc2d630c2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10042
4aead6a9b7a9 commit https://github.com/vim/vim/commit/edf3f97ae2af024708ebb4ac614227327033ca47
Christian Brabandt <cb@256bit.org>
parents: 7807
diff changeset
1 /* vi:set ts=8 sw=8 noet:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 * VIM - Vi IMproved by Bram Moolenaar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 * Visual Workshop integration by Gordon Prieur
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 * Do ":help uganda" in Vim to read copying and usage conditions.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 * Do ":help credits" in Vim to see a list of people who contributed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 #ifndef NBDEBUG_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 #define NBDEBUG_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 #ifdef NBDEBUG
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 #ifndef ASSERT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 #define ASSERT(c) \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 if (!(c)) { \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 fprintf(stderr, "Assertion failed: line %d, file %s\n", \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 __LINE__, __FILE__); \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 fflush(stderr); \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 abort(); \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
1624
18ee39301b82 updated for version 7.2a
vimboss
parents: 378
diff changeset
26 #define nbdebug(a) nbdbg a
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 #define NB_TRACE 0x00000001
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 #define NB_TRACE_VERBOSE 0x00000002
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 #define NB_TRACE_COLONCMD 0x00000004
33
f6033dcbaf31 updated for version 7.0020
vimboss
parents: 7
diff changeset
31 #define NB_PRINT 0x00000008
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 #define NB_DEBUG_ALL 0xffffffff
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 #define NBDLEVEL(flags) (nb_debug != NULL && (nb_dlevel & (flags)))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 #define NBDEBUG_TRACE 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 typedef enum {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 WT_ENV = 1, /* look for env var if set */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 WT_WAIT, /* look for ~/.gvimwait if set */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 WT_STOP /* look for ~/.gvimstop if set */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 } WtWait;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
15874
c7ba5fed403c patch 8.1.0944: format of nbdbg() arguments is not checked
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
45 void nbdbg(char *, ...)
c7ba5fed403c patch 8.1.0944: format of nbdbg() arguments is not checked
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
46 #ifdef USE_PRINTF_FORMAT_ATTRIBUTE
c7ba5fed403c patch 8.1.0944: format of nbdbg() arguments is not checked
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
47 __attribute__((format(printf, 1, 2)))
c7ba5fed403c patch 8.1.0944: format of nbdbg() arguments is not checked
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
48 #endif
c7ba5fed403c patch 8.1.0944: format of nbdbg() arguments is not checked
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
49 ;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
7807
1a5d34492798 commit https://github.com/vim/vim/commit/d99df423c559d85c17779b3685426c489554908c
Christian Brabandt <cb@256bit.org>
parents: 1817
diff changeset
51 void nbdebug_wait(u_int wait_flags, char *wait_var, u_int wait_secs);
1a5d34492798 commit https://github.com/vim/vim/commit/d99df423c559d85c17779b3685426c489554908c
Christian Brabandt <cb@256bit.org>
parents: 1817
diff changeset
52 void nbdebug_log_init(char *log_var, char *level_var);
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 extern FILE *nb_debug;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 extern u_int nb_dlevel; /* nb_debug verbosity level */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 # else /* not NBDEBUG */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 #ifndef ASSERT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 # define ASSERT(c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 /*
33
f6033dcbaf31 updated for version 7.0020
vimboss
parents: 7
diff changeset
64 * The following 3 stubs are needed because a macro cannot be used because of
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 * the variable number of arguments.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 nbdbg(
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 char *fmt,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 ...)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 #endif /* NBDEBUG */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 #endif /* NBDEBUG_H */