Mercurial > octave
annotate libinterp/corefcn/error.h @ 26147:216d857732eb
Add static compile-time checking of printf functions (bug #55046).
* build-aux/mk-octave-config-h.sh, oct-conf-post.in.h: New macro
OCTAVE_FORMAT_ATTRIBUTE.
* libinterp/corefcn/error.h: Use macro OCTAVE_FORMAT_ATTRIBUTE for printf
functions.
author | Kai T. Ohlhus <k.ohlhus@gmail.com> |
---|---|
date | Thu, 29 Nov 2018 12:54:15 +0100 |
parents | 389d86d41cbf |
children | 7f6a50f73625 |
rev | line source |
---|---|
1 | 1 /* |
2 | |
25054
6652d3823428
maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
3 Copyright (C) 1993-2018 John W. Eaton |
1 | 4 |
5 This file is part of Octave. | |
6 | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23615
diff
changeset
|
7 Octave is free software: you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
8 under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23615
diff
changeset
|
9 the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
10 (at your option) any later version. |
1 | 11 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
13 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
15 GNU General Public License for more details. |
1 | 16 |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23615
diff
changeset
|
19 <https://www.gnu.org/licenses/>. |
1 | 20 |
21 */ | |
22 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
20785
diff
changeset
|
23 #if ! defined (octave_error_h) |
383 | 24 #define octave_error_h 1 |
1 | 25 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21157
diff
changeset
|
26 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21157
diff
changeset
|
27 |
6355 | 28 #include <cstdarg> |
3935 | 29 #include <string> |
1489 | 30 |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
31 #include "unwind-prot.h" |
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
32 |
18222
6ef8b920a7d6
include stack in exception variable (bug #41117)
Stefan Mahr <dac922@gmx.de>
parents:
17787
diff
changeset
|
33 class octave_map; |
10605
1834132fb50b
allow non-integer ranges as indices conditionally
John W. Eaton <jwe@octave.org>
parents:
10313
diff
changeset
|
34 class octave_value_list; |
22327
d0562b3159c7
move more classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
35 namespace octave |
d0562b3159c7
move more classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
36 { |
d0562b3159c7
move more classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
37 class execution_exception; |
d0562b3159c7
move more classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
38 } |
10605
1834132fb50b
allow non-integer ranges as indices conditionally
John W. Eaton <jwe@octave.org>
parents:
10313
diff
changeset
|
39 |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
21743
diff
changeset
|
40 #define panic_impossible() \ |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
41 panic ("impossible state reached in file '%s' at line %d", __FILE__, __LINE__) |
1 | 42 |
6109 | 43 extern OCTINTERP_API void reset_error_handler (void); |
4318 | 44 |
6109 | 45 extern OCTINTERP_API int warning_enabled (const std::string& id); |
5781 | 46 |
23464
7eb0077e86f0
show stack trace for wrong type arg errors (bug #50894)
John W. Eaton <jwe@octave.org>
parents:
23219
diff
changeset
|
47 extern OCTINTERP_API octave::execution_exception |
7eb0077e86f0
show stack trace for wrong type arg errors (bug #50894)
John W. Eaton <jwe@octave.org>
parents:
23219
diff
changeset
|
48 make_execution_exception (const char *who); |
7eb0077e86f0
show stack trace for wrong type arg errors (bug #50894)
John W. Eaton <jwe@octave.org>
parents:
23219
diff
changeset
|
49 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
50 extern OCTINTERP_API void |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
51 vmessage (const char *name, const char *fmt, va_list args); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
52 |
26147
216d857732eb
Add static compile-time checking of printf functions (bug #55046).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26146
diff
changeset
|
53 OCTAVE_FORMAT_ATTRIBUTE (__printf__, 2, 3) |
6109 | 54 extern OCTINTERP_API void message (const char *name, const char *fmt, ...); |
6338 | 55 |
56 extern OCTINTERP_API void vwarning (const char *fmt, va_list args); | |
26147
216d857732eb
Add static compile-time checking of printf functions (bug #55046).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26146
diff
changeset
|
57 OCTAVE_FORMAT_ATTRIBUTE (__printf__, 1, 2) |
6109 | 58 extern OCTINTERP_API void warning (const char *fmt, ...); |
6338 | 59 |
21040
3e7cfee5f786
maint: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
Rik <rik@octave.org>
parents:
21029
diff
changeset
|
60 OCTAVE_NORETURN OCTINTERP_API extern |
21029
e3b3bb522d62
maint: Move GCC_ attributes to start of declaration for future compatibility.
Rik <rik@octave.org>
parents:
21012
diff
changeset
|
61 void verror (const char *fmt, va_list args); |
e3b3bb522d62
maint: Move GCC_ attributes to start of declaration for future compatibility.
Rik <rik@octave.org>
parents:
21012
diff
changeset
|
62 |
26147
216d857732eb
Add static compile-time checking of printf functions (bug #55046).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26146
diff
changeset
|
63 OCTAVE_FORMAT_ATTRIBUTE (__printf__, 1, 2) |
21040
3e7cfee5f786
maint: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
Rik <rik@octave.org>
parents:
21029
diff
changeset
|
64 OCTAVE_NORETURN OCTINTERP_API extern |
21029
e3b3bb522d62
maint: Move GCC_ attributes to start of declaration for future compatibility.
Rik <rik@octave.org>
parents:
21012
diff
changeset
|
65 void error (const char *fmt, ...); |
6338 | 66 |
21040
3e7cfee5f786
maint: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
Rik <rik@octave.org>
parents:
21029
diff
changeset
|
67 OCTAVE_NORETURN OCTINTERP_API extern |
22327
d0562b3159c7
move more classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
68 void verror (octave::execution_exception&, const char *fmt, va_list args); |
26147
216d857732eb
Add static compile-time checking of printf functions (bug #55046).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26146
diff
changeset
|
69 |
216d857732eb
Add static compile-time checking of printf functions (bug #55046).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26146
diff
changeset
|
70 OCTAVE_FORMAT_ATTRIBUTE (__printf__, 2, 3) |
21040
3e7cfee5f786
maint: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
Rik <rik@octave.org>
parents:
21029
diff
changeset
|
71 OCTAVE_NORETURN OCTINTERP_API extern |
22327
d0562b3159c7
move more classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
72 void error (octave::execution_exception&, const char *fmt, ...); |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
19861
diff
changeset
|
73 |
21040
3e7cfee5f786
maint: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
Rik <rik@octave.org>
parents:
21029
diff
changeset
|
74 OCTAVE_NORETURN OCTINTERP_API extern |
21029
e3b3bb522d62
maint: Move GCC_ attributes to start of declaration for future compatibility.
Rik <rik@octave.org>
parents:
21012
diff
changeset
|
75 void verror_with_cfn (const char *fmt, va_list args); |
26147
216d857732eb
Add static compile-time checking of printf functions (bug #55046).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26146
diff
changeset
|
76 |
216d857732eb
Add static compile-time checking of printf functions (bug #55046).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26146
diff
changeset
|
77 OCTAVE_FORMAT_ATTRIBUTE (__printf__, 1, 2) |
21040
3e7cfee5f786
maint: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
Rik <rik@octave.org>
parents:
21029
diff
changeset
|
78 OCTAVE_NORETURN OCTINTERP_API extern |
21029
e3b3bb522d62
maint: Move GCC_ attributes to start of declaration for future compatibility.
Rik <rik@octave.org>
parents:
21012
diff
changeset
|
79 void error_with_cfn (const char *fmt, ...); |
9753
892e2aa7bc75
improve error messages by auto-prepending current function name
Jaroslav Hajek <highegg@gmail.com>
parents:
7977
diff
changeset
|
80 |
21040
3e7cfee5f786
maint: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
Rik <rik@octave.org>
parents:
21029
diff
changeset
|
81 OCTAVE_NORETURN OCTINTERP_API extern |
21029
e3b3bb522d62
maint: Move GCC_ attributes to start of declaration for future compatibility.
Rik <rik@octave.org>
parents:
21012
diff
changeset
|
82 void vparse_error (const char *fmt, va_list args); |
26147
216d857732eb
Add static compile-time checking of printf functions (bug #55046).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26146
diff
changeset
|
83 |
216d857732eb
Add static compile-time checking of printf functions (bug #55046).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26146
diff
changeset
|
84 OCTAVE_FORMAT_ATTRIBUTE (__printf__, 1, 2) |
21040
3e7cfee5f786
maint: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
Rik <rik@octave.org>
parents:
21029
diff
changeset
|
85 OCTAVE_NORETURN OCTINTERP_API extern |
21029
e3b3bb522d62
maint: Move GCC_ attributes to start of declaration for future compatibility.
Rik <rik@octave.org>
parents:
21012
diff
changeset
|
86 void parse_error (const char *fmt, ...); |
5567 | 87 |
6109 | 88 extern OCTINTERP_API void |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
89 vmessage_with_id (const char *id, const char *name, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
90 const char *fmt, va_list args); |
6338 | 91 |
26147
216d857732eb
Add static compile-time checking of printf functions (bug #55046).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26146
diff
changeset
|
92 OCTAVE_FORMAT_ATTRIBUTE (__printf__, 3, 4) |
6338 | 93 extern OCTINTERP_API void |
5567 | 94 message_with_id (const char *id, const char *name, const char *fmt, ...); |
95 | |
21040
3e7cfee5f786
maint: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
Rik <rik@octave.org>
parents:
21029
diff
changeset
|
96 OCTAVE_NORETURN OCTINTERP_API extern |
21029
e3b3bb522d62
maint: Move GCC_ attributes to start of declaration for future compatibility.
Rik <rik@octave.org>
parents:
21012
diff
changeset
|
97 void vusage_with_id (const char *id, const char *fmt, va_list args); |
6338 | 98 |
26147
216d857732eb
Add static compile-time checking of printf functions (bug #55046).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26146
diff
changeset
|
99 OCTAVE_FORMAT_ATTRIBUTE (__printf__, 2, 3) |
21040
3e7cfee5f786
maint: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
Rik <rik@octave.org>
parents:
21029
diff
changeset
|
100 OCTAVE_NORETURN OCTINTERP_API extern |
21029
e3b3bb522d62
maint: Move GCC_ attributes to start of declaration for future compatibility.
Rik <rik@octave.org>
parents:
21012
diff
changeset
|
101 void usage_with_id (const char *id, const char *fmt, ...); |
5567 | 102 |
6109 | 103 extern OCTINTERP_API void |
6338 | 104 vwarning_with_id (const char *id, const char *fmt, va_list args); |
105 | |
26147
216d857732eb
Add static compile-time checking of printf functions (bug #55046).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26146
diff
changeset
|
106 OCTAVE_FORMAT_ATTRIBUTE (__printf__, 2, 3) |
6338 | 107 extern OCTINTERP_API void |
5567 | 108 warning_with_id (const char *id, const char *fmt, ...); |
109 | |
21040
3e7cfee5f786
maint: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
Rik <rik@octave.org>
parents:
21029
diff
changeset
|
110 OCTAVE_NORETURN OCTINTERP_API extern |
21029
e3b3bb522d62
maint: Move GCC_ attributes to start of declaration for future compatibility.
Rik <rik@octave.org>
parents:
21012
diff
changeset
|
111 void verror_with_id (const char *id, const char *fmt, va_list args); |
6338 | 112 |
26147
216d857732eb
Add static compile-time checking of printf functions (bug #55046).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26146
diff
changeset
|
113 OCTAVE_FORMAT_ATTRIBUTE (__printf__, 2, 3) |
21040
3e7cfee5f786
maint: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
Rik <rik@octave.org>
parents:
21029
diff
changeset
|
114 OCTAVE_NORETURN OCTINTERP_API extern |
21029
e3b3bb522d62
maint: Move GCC_ attributes to start of declaration for future compatibility.
Rik <rik@octave.org>
parents:
21012
diff
changeset
|
115 void error_with_id (const char *id, const char *fmt, ...); |
5567 | 116 |
21040
3e7cfee5f786
maint: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
Rik <rik@octave.org>
parents:
21029
diff
changeset
|
117 OCTAVE_NORETURN OCTINTERP_API extern |
21029
e3b3bb522d62
maint: Move GCC_ attributes to start of declaration for future compatibility.
Rik <rik@octave.org>
parents:
21012
diff
changeset
|
118 void verror_with_id_cfn (const char *id, const char *fmt, va_list args); |
9753
892e2aa7bc75
improve error messages by auto-prepending current function name
Jaroslav Hajek <highegg@gmail.com>
parents:
7977
diff
changeset
|
119 |
26147
216d857732eb
Add static compile-time checking of printf functions (bug #55046).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26146
diff
changeset
|
120 OCTAVE_FORMAT_ATTRIBUTE (__printf__, 2, 3) |
21040
3e7cfee5f786
maint: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
Rik <rik@octave.org>
parents:
21029
diff
changeset
|
121 OCTAVE_NORETURN OCTINTERP_API extern |
21029
e3b3bb522d62
maint: Move GCC_ attributes to start of declaration for future compatibility.
Rik <rik@octave.org>
parents:
21012
diff
changeset
|
122 void error_with_id_cfn (const char *id, const char *fmt, ...); |
e3b3bb522d62
maint: Move GCC_ attributes to start of declaration for future compatibility.
Rik <rik@octave.org>
parents:
21012
diff
changeset
|
123 |
21040
3e7cfee5f786
maint: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
Rik <rik@octave.org>
parents:
21029
diff
changeset
|
124 OCTAVE_NORETURN OCTINTERP_API extern |
21029
e3b3bb522d62
maint: Move GCC_ attributes to start of declaration for future compatibility.
Rik <rik@octave.org>
parents:
21012
diff
changeset
|
125 void vparse_error_with_id (const char *id, const char *fmt, va_list args); |
9753
892e2aa7bc75
improve error messages by auto-prepending current function name
Jaroslav Hajek <highegg@gmail.com>
parents:
7977
diff
changeset
|
126 |
26147
216d857732eb
Add static compile-time checking of printf functions (bug #55046).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26146
diff
changeset
|
127 OCTAVE_FORMAT_ATTRIBUTE (__printf__, 2, 3) |
21040
3e7cfee5f786
maint: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
Rik <rik@octave.org>
parents:
21029
diff
changeset
|
128 OCTAVE_NORETURN OCTINTERP_API extern |
21029
e3b3bb522d62
maint: Move GCC_ attributes to start of declaration for future compatibility.
Rik <rik@octave.org>
parents:
21012
diff
changeset
|
129 void parse_error_with_id (const char *id, const char *fmt, ...); |
6338 | 130 |
26147
216d857732eb
Add static compile-time checking of printf functions (bug #55046).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26146
diff
changeset
|
131 OCTAVE_FORMAT_ATTRIBUTE (__printf__, 1, 2) |
21040
3e7cfee5f786
maint: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
Rik <rik@octave.org>
parents:
21029
diff
changeset
|
132 OCTAVE_NORETURN OCTINTERP_API extern |
21029
e3b3bb522d62
maint: Move GCC_ attributes to start of declaration for future compatibility.
Rik <rik@octave.org>
parents:
21012
diff
changeset
|
133 void panic (const char *fmt, ...); |
1 | 134 |
26146
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
135 //! Helper function for print_usage defined in defun.cc. |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
136 |
6109 | 137 extern OCTINTERP_API void defun_usage_message (const std::string& msg); |
4732 | 138 |
10605
1834132fb50b
allow non-integer ranges as indices conditionally
John W. Eaton <jwe@octave.org>
parents:
10313
diff
changeset
|
139 extern OCTINTERP_API octave_value_list |
1834132fb50b
allow non-integer ranges as indices conditionally
John W. Eaton <jwe@octave.org>
parents:
10313
diff
changeset
|
140 set_warning_state (const std::string& id, const std::string& state); |
1834132fb50b
allow non-integer ranges as indices conditionally
John W. Eaton <jwe@octave.org>
parents:
10313
diff
changeset
|
141 |
1834132fb50b
allow non-integer ranges as indices conditionally
John W. Eaton <jwe@octave.org>
parents:
10313
diff
changeset
|
142 extern OCTINTERP_API octave_value_list |
1834132fb50b
allow non-integer ranges as indices conditionally
John W. Eaton <jwe@octave.org>
parents:
10313
diff
changeset
|
143 set_warning_state (const octave_value_list& args); |
1834132fb50b
allow non-integer ranges as indices conditionally
John W. Eaton <jwe@octave.org>
parents:
10313
diff
changeset
|
144 |
6109 | 145 extern OCTINTERP_API void disable_warning (const std::string& id); |
146 extern OCTINTERP_API void initialize_default_warning_state (void); | |
5794 | 147 |
26146
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
148 //! TRUE means that Octave will try to enter the debugger when an error |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
149 //! is encountered. This will also inhibit printing of the normal |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
150 //! traceback message (you will only see the top-level error message). |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
151 |
7353 | 152 extern OCTINTERP_API bool Vdebug_on_error; |
153 | |
26146
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
154 //! TRUE means that Octave will try to enter the debugger when an error |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
155 //! is encountered within the 'try' section of a 'try' / 'catch' block. |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
156 |
21157
94fc5f13d51b
dbstop: conditional breakpoint, dbstop if caught error etc. (bug #46795)
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21134
diff
changeset
|
157 extern OCTINTERP_API bool Vdebug_on_caught; |
94fc5f13d51b
dbstop: conditional breakpoint, dbstop if caught error etc. (bug #46795)
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21134
diff
changeset
|
158 |
26146
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
159 //! TRUE means that Octave will try to enter the debugger when a warning |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
160 //! is encountered. |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
161 |
7353 | 162 extern OCTINTERP_API bool Vdebug_on_warning; |
163 | |
26146
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
164 //! Current error state. |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
165 |
6109 | 166 extern OCTINTERP_API int error_state; |
143 | 167 |
26146
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
168 //! Current warning state. |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
169 |
6109 | 170 extern OCTINTERP_API int warning_state; |
3489 | 171 |
26146
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
172 //! Tell the error handler whether to print messages, or just store |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
173 //! them for later. Used for handling errors in eval() and |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
174 //! the 'unwind_protect' statement. |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
175 |
6109 | 176 extern OCTINTERP_API int buffer_error_messages; |
1489 | 177 |
26146
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
178 //! The number of layers of try / catch blocks we're in. Used to print |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
179 //! "caught error" instead of "error" when "dbstop if caught error" is on. |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
180 |
21157
94fc5f13d51b
dbstop: conditional breakpoint, dbstop if caught error etc. (bug #46795)
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21134
diff
changeset
|
181 extern OCTINTERP_API int in_try_catch; |
94fc5f13d51b
dbstop: conditional breakpoint, dbstop if caught error etc. (bug #46795)
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21134
diff
changeset
|
182 |
26146
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
183 //! TRUE means error messages are turned off. |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
184 |
6109 | 185 extern OCTINTERP_API bool discard_error_messages; |
3815 | 186 |
26146
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
187 //! TRUE means warning messages are turned off. |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
188 |
6109 | 189 extern OCTINTERP_API bool discard_warning_messages; |
4452 | 190 |
26146
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
191 //! Helper functions to pass last error and warning messages and ids. |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
192 //! @{ |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
193 |
7977
065c28e1c368
Modify Fcellfun to directly access the error message/id rather than use a call to Flasterr
David Bateman <dbateman@free.fr>
parents:
7353
diff
changeset
|
194 extern OCTINTERP_API std::string last_error_message (void); |
065c28e1c368
Modify Fcellfun to directly access the error message/id rather than use a call to Flasterr
David Bateman <dbateman@free.fr>
parents:
7353
diff
changeset
|
195 extern OCTINTERP_API std::string last_error_id (void); |
18222
6ef8b920a7d6
include stack in exception variable (bug #41117)
Stefan Mahr <dac922@gmx.de>
parents:
17787
diff
changeset
|
196 extern OCTINTERP_API octave_map last_error_stack (void); |
7977
065c28e1c368
Modify Fcellfun to directly access the error message/id rather than use a call to Flasterr
David Bateman <dbateman@free.fr>
parents:
7353
diff
changeset
|
197 extern OCTINTERP_API std::string last_warning_message (void); |
065c28e1c368
Modify Fcellfun to directly access the error message/id rather than use a call to Flasterr
David Bateman <dbateman@free.fr>
parents:
7353
diff
changeset
|
198 extern OCTINTERP_API std::string last_warning_id (void); |
065c28e1c368
Modify Fcellfun to directly access the error message/id rather than use a call to Flasterr
David Bateman <dbateman@free.fr>
parents:
7353
diff
changeset
|
199 |
26146
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
200 //! @} |
389d86d41cbf
doc: Add Doxygen documentation.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
25147
diff
changeset
|
201 |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
202 extern OCTINTERP_API void interpreter_try (octave::unwind_protect&); |
11029
4ab04ea74b08
make an internal function for try simulation
Jaroslav Hajek <highegg@gmail.com>
parents:
10605
diff
changeset
|
203 |
1 | 204 #endif |