Mercurial > octave
annotate libinterp/corefcn/toplev.h @ 21244:1473547f50f5
include octave-config.h in public header files
* mk-opts.pl, mkbuiltins, mk-ops.awk, sparse-mk-ops.awk:
Emit "#include octave-config.h" statement for generated header files.
* build-env.h, builtins.h, Cell.h, base-text-renderer.h,
c-file-ptr-stream.h, cdisplay.h, comment-list.h, data.h, debug.h,
defaults.in.h, defun-dld.h, defun-int.h, defun.h, dirfns.h, display.h,
dynamic-ld.h, error.h, errwarn.h, event-queue.h, file-io.h,
ft-text-renderer.h, gl-render.h, gl2ps-print.h, graphics.in.h,
gripes.h, help.h, hook-fcn.h, input.h, jit-ir.h, jit-typeinfo.h,
jit-util.h, load-path.h, load-save.h, ls-ascii-helper.h, ls-hdf5.h,
ls-mat-ascii.h, ls-mat4.h, ls-mat5.h, ls-oct-binary.h, ls-oct-text.h,
ls-utils.h, mex.h, mexproto.h, mxarray.in.h, oct-errno.h, oct-fstrm.h,
oct-handle.h, oct-hdf5-types.h, oct-hdf5.h, oct-hist.h, oct-iostrm.h,
oct-lvalue.h, oct-map.h, oct-obj.h, oct-opengl.h, oct-prcstrm.h,
oct-procbuf.h, oct-stdstrm.h, oct-stream.h, oct-strstrm.h, oct.h,
octave-default-image.h, octave-link.h, octave-preserve-stream-state.h,
pager.h, pr-output.h, procstream.h, profiler.h, pt-jit.h,
sighandlers.h, siglist.h, sparse-xdiv.h, sparse-xpow.h, symtab.h,
sysdep.h, text-renderer.h, toplev.h, txt-eng.h, utils.h, variables.h,
workspace-element.h, xdiv.h, xnorm.h, xpow.h, zfstream.h, oct-qhull.h,
ov-base-diag.h, ov-base-int.h, ov-base-mat.h, ov-base-scalar.h,
ov-base-sparse.h, ov-base.h, ov-bool-mat.h, ov-bool-sparse.h,
ov-bool.h, ov-builtin.h, ov-cell.h, ov-ch-mat.h, ov-class.h,
ov-classdef.h, ov-colon.h, ov-complex.h, ov-cs-list.h, ov-cx-diag.h,
ov-cx-mat.h, ov-cx-sparse.h, ov-dld-fcn.h, ov-fcn-handle.h,
ov-fcn-inline.h, ov-fcn.h, ov-float.h, ov-flt-complex.h,
ov-flt-cx-diag.h, ov-flt-cx-mat.h, ov-flt-re-diag.h, ov-flt-re-mat.h,
ov-int-traits.h, ov-int16.h, ov-int32.h, ov-int64.h, ov-int8.h,
ov-intx.h, ov-java.h, ov-lazy-idx.h, ov-mex-fcn.h, ov-null-mat.h,
ov-oncleanup.h, ov-perm.h, ov-range.h, ov-re-diag.h, ov-re-mat.h,
ov-re-sparse.h, ov-scalar.h, ov-str-mat.h, ov-struct.h,
ov-type-conv.h, ov-typeinfo.h, ov-uint16.h, ov-uint32.h, ov-uint64.h,
ov-uint8.h, ov-usr-fcn.h, ov.h, ovl.h, octave.h, op-int.h, ops.h,
options-usage.h, lex.h, parse.h, pt-all.h, pt-arg-list.h,
pt-array-list.h, pt-assign.h, pt-binop.h, pt-bp.h, pt-cbinop.h,
pt-cell.h, pt-check.h, pt-classdef.h, pt-cmd.h, pt-colon.h,
pt-const.h, pt-decl.h, pt-eval.h, pt-except.h, pt-exp.h,
pt-fcn-handle.h, pt-funcall.h, pt-id.h, pt-idx.h, pt-jump.h,
pt-loop.h, pt-mat.h, pt-misc.h, pt-pr-code.h, pt-select.h, pt-stmt.h,
pt-unop.h, pt-walk.h, pt.h, token.h, version.in.h, Array-util.h,
Array.h, CColVector.h, CDiagMatrix.h, CMatrix.h, CNDArray.h,
CRowVector.h, CSparse.h, DiagArray2.h, MArray.h, MDiagArray2.h,
MSparse.h, Matrix.h, MatrixType.h, PermMatrix.h, Range.h, Sparse.h,
boolMatrix.h, boolNDArray.h, boolSparse.h, chMatrix.h, chNDArray.h,
dColVector.h, dDiagMatrix.h, dMatrix.h, dNDArray.h, dRowVector.h,
dSparse.h, dim-vector.h, fCColVector.h, fCDiagMatrix.h, fCMatrix.h,
fCNDArray.h, fCRowVector.h, fColVector.h, fDiagMatrix.h, fMatrix.h,
fNDArray.h, fRowVector.h, idx-vector.h, int16NDArray.h,
int32NDArray.h, int64NDArray.h, int8NDArray.h, intNDArray.h,
uint16NDArray.h, uint32NDArray.h, uint64NDArray.h, uint8NDArray.h,
f77-fcn.h, lo-error.h, quit.h, CmplxAEPBAL.h, CmplxCHOL.h,
CmplxGEPBAL.h, CmplxHESS.h, CmplxLU.h, CmplxQR.h, CmplxQRP.h,
CmplxSCHUR.h, CmplxSVD.h, CollocWt.h, DAE.h, DAEFunc.h, DAERT.h,
DAERTFunc.h, DASPK.h, DASRT.h, DASSL.h, DET.h, EIG.h, LSODE.h, ODE.h,
ODEFunc.h, ODES.h, ODESFunc.h, Quad.h, base-aepbal.h, base-dae.h,
base-de.h, base-lu.h, base-min.h, base-qr.h, bsxfun-decl.h, bsxfun.h,
dbleAEPBAL.h, dbleCHOL.h, dbleGEPBAL.h, dbleHESS.h, dbleLU.h,
dbleQR.h, dbleQRP.h, dbleSCHUR.h, dbleSVD.h, eigs-base.h,
fCmplxAEPBAL.h, fCmplxCHOL.h, fCmplxGEPBAL.h, fCmplxHESS.h,
fCmplxLU.h, fCmplxQR.h, fCmplxQRP.h, fCmplxSCHUR.h, fCmplxSVD.h,
fEIG.h, floatAEPBAL.h, floatCHOL.h, floatGEPBAL.h, floatHESS.h,
floatLU.h, floatQR.h, floatQRP.h, floatSCHUR.h, floatSVD.h,
lo-mappers.h, lo-specfun.h, oct-convn.h, oct-fftw.h, oct-norm.h,
oct-rand.h, oct-spparms.h, randgamma.h, randmtzig.h, randpoisson.h,
sparse-chol.h, sparse-dmsolve.h, sparse-lu.h, sparse-qr.h,
Sparse-diag-op-defs.h, Sparse-op-decls.h, Sparse-op-defs.h,
Sparse-perm-op-defs.h, mx-base.h, mx-defs.h, mx-ext.h, mx-op-decl.h,
mx-op-defs.h, dir-ops.h, file-ops.h, file-stat.h, lo-sysdep.h,
mach-info.h, oct-env.h, oct-group.h, oct-openmp.h, oct-passwd.h,
oct-syscalls.h, oct-time.h, oct-uname.h, pathlen.h, sysdir.h,
syswait.h, action-container.h, base-list.h, byte-swap.h,
caseless-str.h, cmd-edit.h, cmd-hist.h, data-conv.h, functor.h,
glob-match.h, lo-array-errwarn.h, lo-array-gripes.h, lo-cutils.h,
lo-ieee.h, lo-macros.h, lo-math.h, lo-regexp.h, lo-traits.h,
lo-utils.h, oct-alloc.h, oct-base64.h, oct-binmap.h, oct-cmplx.h,
oct-glob.h, oct-inttypes.h, oct-locbuf.h, oct-mutex.h, oct-refcount.h,
oct-rl-edit.h, oct-rl-hist.h, oct-shlib.h, oct-sort.h, oct-sparse.h,
pathsearch.h, singleton-cleanup.h, sparse-sort.h, sparse-util.h,
statdefs.h, str-vec.h, sun-utils.h, unwind-prot.h, url-transfer.h:
Include octave-config.h.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 10 Feb 2016 14:25:53 -0500 |
parents | 850e3d2533d4 |
children | 909129eb77c5 |
rev | line source |
---|---|
1 | 1 /* |
2 | |
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19597
diff
changeset
|
3 Copyright (C) 1993-2015 John W. Eaton |
1 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
1 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
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 |
19 <http://www.gnu.org/licenses/>. | |
1 | 20 |
21 */ | |
22 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
20535
diff
changeset
|
23 #if ! defined (octave_toplev_h) |
1670 | 24 #define octave_toplev_h 1 |
1 | 25 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20956
diff
changeset
|
26 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20956
diff
changeset
|
27 |
1355 | 28 #include <cstdio> |
1 | 29 |
7552
6070c3bd69c4
Arbitrary call stack access for external debuggers changeset
ryanru@PrinceHumperdinck
parents:
7409
diff
changeset
|
30 #include <deque> |
3503 | 31 #include <string> |
32 | |
2086 | 33 class octave_value; |
2796 | 34 class octave_value_list; |
5743 | 35 class octave_function; |
5744 | 36 class octave_user_script; |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
37 class tree_statement; |
578 | 38 class tree_statement_list; |
1572 | 39 class charMatrix; |
1 | 40 |
9217
ee7cf4d963f3
smarter handling of quit()
Jaroslav Hajek <highegg@gmail.com>
parents:
9144
diff
changeset
|
41 #include "quit.h" |
ee7cf4d963f3
smarter handling of quit()
Jaroslav Hajek <highegg@gmail.com>
parents:
9144
diff
changeset
|
42 |
7752
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
43 #include "input.h" |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
44 #include "oct-map.h" |
17084
872947f3f9f1
* toplev.cc: Include symtab.h
John W. Eaton <jwe@octave.org>
parents:
16892
diff
changeset
|
45 #include "symtab.h" |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
46 |
9217
ee7cf4d963f3
smarter handling of quit()
Jaroslav Hajek <highegg@gmail.com>
parents:
9144
diff
changeset
|
47 |
9221
659657942ba6
declare octave_exit using a typedef
Jaroslav Hajek <highegg@gmail.com>
parents:
9218
diff
changeset
|
48 typedef void (*octave_exit_func) (int); |
659657942ba6
declare octave_exit using a typedef
Jaroslav Hajek <highegg@gmail.com>
parents:
9218
diff
changeset
|
49 extern OCTINTERP_API octave_exit_func octave_exit; |
9217
ee7cf4d963f3
smarter handling of quit()
Jaroslav Hajek <highegg@gmail.com>
parents:
9144
diff
changeset
|
50 |
9255
1c2d2c9f4a8d
don't allow quit() in embedded mode by default, make configurable
Jaroslav Hajek <highegg@gmail.com>
parents:
9247
diff
changeset
|
51 extern OCTINTERP_API bool quit_allowed; |
1c2d2c9f4a8d
don't allow quit() in embedded mode by default, make configurable
Jaroslav Hajek <highegg@gmail.com>
parents:
9247
diff
changeset
|
52 |
9383 | 53 extern OCTINTERP_API bool quitting_gracefully; |
54 | |
55 extern OCTINTERP_API int exit_status; | |
9217
ee7cf4d963f3
smarter handling of quit()
Jaroslav Hajek <highegg@gmail.com>
parents:
9144
diff
changeset
|
56 |
7250 | 57 extern OCTINTERP_API void |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16354
diff
changeset
|
58 clean_up_and_exit (int status, bool safe_to_return = false); |
574 | 59 |
7250 | 60 extern OCTINTERP_API void recover_from_exception (void); |
7202 | 61 |
9247
b2790fd23800
More export symbols to allow usage from an IDE.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9237
diff
changeset
|
62 extern OCTINTERP_API int main_loop (void); |
1907 | 63 |
7250 | 64 extern OCTINTERP_API void |
7409 | 65 octave_add_atexit_function (const std::string& fname); |
66 | |
67 extern OCTINTERP_API bool | |
68 octave_remove_atexit_function (const std::string& fname); | |
69 | |
4217 | 70 // TRUE means we are ready to interpret commands, but not everything |
71 // is ready for interactive use. | |
7185 | 72 extern OCTINTERP_API bool octave_interpreter_ready; |
4217 | 73 |
4172 | 74 // TRUE means we've processed all the init code and we are good to go. |
7185 | 75 extern OCTINTERP_API bool octave_initialized; |
4172 | 76 |
5743 | 77 class |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9221
diff
changeset
|
78 OCTINTERP_API |
5743 | 79 octave_call_stack |
80 { | |
81 protected: | |
82 | |
7752
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
83 octave_call_stack (void) : cs (), curr_frame (0) { } |
5743 | 84 |
85 public: | |
86 | |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
87 class stack_frame |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
88 { |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
89 public: |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
90 |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
91 friend class octave_call_stack; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
92 |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
93 stack_frame (octave_function *fcn = 0, symbol_table::scope_id scope = 0, |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
94 symbol_table::context_id context = 0, size_t prev = 0) |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
95 : m_fcn (fcn), m_line (-1), m_column (-1), m_scope (scope), |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
96 m_context (context), m_prev (prev) |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
97 { } |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
98 |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
99 stack_frame (const stack_frame& elt) |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
100 : m_fcn (elt.m_fcn), m_line (elt.m_line), m_column (elt.m_column), |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
101 m_scope (elt.m_scope), m_context (elt.m_context), m_prev (elt.m_prev) |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
102 { } |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
103 |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
104 int line (void) const { return m_line; } |
7901 | 105 |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
106 int column (void) const { return m_column; } |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
107 |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
108 std::string fcn_file_name (void) const; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
109 |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
110 std::string fcn_name (bool print_subfn = true) const; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
111 |
20511
9502e0142c19
Simplify error output if max_recursion_depth is exceeded (Bug #45843).
Stefan Miereis <stefan.miereis@gmx.de>
parents:
20428
diff
changeset
|
112 bool operator== (const stack_frame &rhs) const; |
9502e0142c19
Simplify error output if max_recursion_depth is exceeded (Bug #45843).
Stefan Miereis <stefan.miereis@gmx.de>
parents:
20428
diff
changeset
|
113 |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
114 private: |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
115 |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
116 octave_function *m_fcn; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
117 int m_line; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
118 int m_column; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
119 symbol_table::scope_id m_scope; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
120 symbol_table::context_id m_context; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
121 size_t m_prev; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
122 }; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
123 |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
124 typedef std::deque<stack_frame>::iterator iterator; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
125 typedef std::deque<stack_frame>::const_iterator const_iterator; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
126 |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
127 typedef std::deque<stack_frame>::reverse_iterator reverse_iterator; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
128 typedef std::deque<stack_frame>::const_reverse_iterator const_reverse_iterator; |
7901 | 129 |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
130 static void create_instance (void); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
131 |
5743 | 132 static bool instance_ok (void) |
133 { | |
134 bool retval = true; | |
135 | |
136 if (! instance) | |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
137 create_instance (); |
5743 | 138 |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
139 if (! instance) |
20956
850e3d2533d4
maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
140 error ("unable to create call stack object!"); |
5743 | 141 |
142 return retval; | |
143 } | |
144 | |
145 // Current function (top of stack). | |
9484
bbe033dcfe13
make dbwhere work when called at keyboard prompt
John W. Eaton <jwe@octave.org>
parents:
9396
diff
changeset
|
146 static octave_function *current (void) |
bbe033dcfe13
make dbwhere work when called at keyboard prompt
John W. Eaton <jwe@octave.org>
parents:
9396
diff
changeset
|
147 { |
bbe033dcfe13
make dbwhere work when called at keyboard prompt
John W. Eaton <jwe@octave.org>
parents:
9396
diff
changeset
|
148 return instance_ok () ? instance->do_current () : 0; |
bbe033dcfe13
make dbwhere work when called at keyboard prompt
John W. Eaton <jwe@octave.org>
parents:
9396
diff
changeset
|
149 } |
5743 | 150 |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
151 // Current line in current function. |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
152 static int current_line (void) |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
153 { |
7877 | 154 return instance_ok () ? instance->do_current_line () : -1; |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
155 } |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
156 |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
157 // Current column in current function. |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
158 static int current_column (void) |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
159 { |
7877 | 160 return instance_ok () ? instance->do_current_column () : -1; |
161 } | |
162 | |
163 // Line in user code caller. | |
7923
c3d21b9b94b6
eliminate octave_call_stack member functions caller_user_script and caller_user_function, and unused difference_type args
John W. Eaton <jwe@octave.org>
parents:
7912
diff
changeset
|
164 static int caller_user_code_line (void) |
7877 | 165 { |
7923
c3d21b9b94b6
eliminate octave_call_stack member functions caller_user_script and caller_user_function, and unused difference_type args
John W. Eaton <jwe@octave.org>
parents:
7912
diff
changeset
|
166 return instance_ok () ? instance->do_caller_user_code_line () : -1; |
7877 | 167 } |
168 | |
169 // Column in user code caller. | |
7923
c3d21b9b94b6
eliminate octave_call_stack member functions caller_user_script and caller_user_function, and unused difference_type args
John W. Eaton <jwe@octave.org>
parents:
7912
diff
changeset
|
170 static int caller_user_code_column (void) |
7877 | 171 { |
7923
c3d21b9b94b6
eliminate octave_call_stack member functions caller_user_script and caller_user_function, and unused difference_type args
John W. Eaton <jwe@octave.org>
parents:
7912
diff
changeset
|
172 return instance_ok () ? instance->do_caller_user_code_column () : -1; |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
173 } |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
174 |
5743 | 175 // Caller function, may be built-in. |
176 static octave_function *caller (void) | |
177 { | |
7942
db6478d9c669
out_of_date_check_internal: make it work for class methods
John W. Eaton <jwe@octave.org>
parents:
7923
diff
changeset
|
178 return instance_ok () ? instance->do_caller () : 0; |
5743 | 179 } |
180 | |
7752
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
181 static size_t current_frame (void) |
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
182 { |
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
183 return instance_ok () ? instance->do_current_frame () : 0; |
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
184 } |
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
185 |
7890 | 186 static size_t size (void) |
187 { | |
188 return instance_ok () ? instance->do_size () : 0; | |
189 } | |
190 | |
7901 | 191 static size_t num_user_code_frames (octave_idx_type& curr_user_frame) |
192 { | |
193 return instance_ok () | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
194 ? instance->do_num_user_code_frames (curr_user_frame) : 0; |
7901 | 195 } |
196 | |
197 static symbol_table::scope_id current_scope (void) | |
198 { | |
199 return instance_ok () ? instance->do_current_scope () : 0; | |
200 } | |
201 | |
202 static symbol_table::context_id current_context (void) | |
203 { | |
204 return instance_ok () ? instance->do_current_context () : 0; | |
205 } | |
206 | |
20946 | 207 #if 0 |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
208 static stack_frame frame (size_t idx) |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
209 { |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
210 return instance_ok () ? instance->do_frame (idx) : stack_frame (); |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
211 } |
20946 | 212 #endif |
213 | |
7552
6070c3bd69c4
Arbitrary call stack access for external debuggers changeset
ryanru@PrinceHumperdinck
parents:
7409
diff
changeset
|
214 // Function at location N on the call stack (N == 0 is current), may |
6070c3bd69c4
Arbitrary call stack access for external debuggers changeset
ryanru@PrinceHumperdinck
parents:
7409
diff
changeset
|
215 // be built-in. |
6070c3bd69c4
Arbitrary call stack access for external debuggers changeset
ryanru@PrinceHumperdinck
parents:
7409
diff
changeset
|
216 static octave_function *element (size_t n) |
6070c3bd69c4
Arbitrary call stack access for external debuggers changeset
ryanru@PrinceHumperdinck
parents:
7409
diff
changeset
|
217 { |
6070c3bd69c4
Arbitrary call stack access for external debuggers changeset
ryanru@PrinceHumperdinck
parents:
7409
diff
changeset
|
218 return instance_ok () ? instance->do_element (n) : 0; |
6070c3bd69c4
Arbitrary call stack access for external debuggers changeset
ryanru@PrinceHumperdinck
parents:
7409
diff
changeset
|
219 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
220 |
7923
c3d21b9b94b6
eliminate octave_call_stack member functions caller_user_script and caller_user_function, and unused difference_type args
John W. Eaton <jwe@octave.org>
parents:
7912
diff
changeset
|
221 // First user-defined function on the stack. |
c3d21b9b94b6
eliminate octave_call_stack member functions caller_user_script and caller_user_function, and unused difference_type args
John W. Eaton <jwe@octave.org>
parents:
7912
diff
changeset
|
222 static octave_user_code *caller_user_code (size_t nskip = 0) |
5743 | 223 { |
7923
c3d21b9b94b6
eliminate octave_call_stack member functions caller_user_script and caller_user_function, and unused difference_type args
John W. Eaton <jwe@octave.org>
parents:
7912
diff
changeset
|
224 return instance_ok () ? instance->do_caller_user_code (nskip) : 0; |
5743 | 225 } |
226 | |
18267
bc139ccccef9
Don't echo scripts not executed from the cmd line when using 'echo on'(bug #41202)
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
227 // Return TRUE if all elements on the call stack are scripts. |
bc139ccccef9
Don't echo scripts not executed from the cmd line when using 'echo on'(bug #41202)
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
228 static bool all_scripts (void) |
bc139ccccef9
Don't echo scripts not executed from the cmd line when using 'echo on'(bug #41202)
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
229 { |
bc139ccccef9
Don't echo scripts not executed from the cmd line when using 'echo on'(bug #41202)
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
230 return instance_ok () ? instance->do_all_scripts () : false; |
bc139ccccef9
Don't echo scripts not executed from the cmd line when using 'echo on'(bug #41202)
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
231 } |
bc139ccccef9
Don't echo scripts not executed from the cmd line when using 'echo on'(bug #41202)
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
232 |
7752
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
233 static void |
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
234 push (octave_function *f, |
10313 | 235 symbol_table::scope_id scope = symbol_table::current_scope (), |
236 symbol_table::context_id context = symbol_table::current_context ()) | |
5743 | 237 { |
238 if (instance_ok ()) | |
7752
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
239 instance->do_push (f, scope, context); |
5743 | 240 } |
241 | |
9144
c6463412aebb
eliminate symbol_table::scope_stack; fix scoping issue with evalin
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
242 static void |
c6463412aebb
eliminate symbol_table::scope_stack; fix scoping issue with evalin
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
243 push (symbol_table::scope_id scope = symbol_table::current_scope (), |
10313 | 244 symbol_table::context_id context = symbol_table::current_context ()) |
9144
c6463412aebb
eliminate symbol_table::scope_stack; fix scoping issue with evalin
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
245 { |
c6463412aebb
eliminate symbol_table::scope_stack; fix scoping issue with evalin
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
246 if (instance_ok ()) |
c6463412aebb
eliminate symbol_table::scope_stack; fix scoping issue with evalin
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
247 instance->do_push (0, scope, context); |
c6463412aebb
eliminate symbol_table::scope_stack; fix scoping issue with evalin
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
248 } |
c6463412aebb
eliminate symbol_table::scope_stack; fix scoping issue with evalin
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
249 |
16354
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
250 static void set_location (int l, int c) |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
251 { |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
252 if (instance_ok ()) |
16354
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
253 instance->do_set_location (l, c); |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
254 } |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
255 |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
256 static void set_line (int l) |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
257 { |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
258 if (instance_ok ()) |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
259 instance->do_set_line (l); |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
260 } |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
261 |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
262 static void set_column (int c) |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
263 { |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
264 if (instance_ok ()) |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
265 instance->do_set_column (c); |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
266 } |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
267 |
7752
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
268 static bool goto_frame (size_t n = 0, bool verbose = false) |
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
269 { |
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
270 return instance_ok () ? instance->do_goto_frame (n, verbose) : false; |
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
271 } |
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
272 |
9396
17af7cce7d1b
yet more unwind_protect improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
9383
diff
changeset
|
273 static void restore_frame (size_t n) |
17af7cce7d1b
yet more unwind_protect improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
9383
diff
changeset
|
274 { |
17af7cce7d1b
yet more unwind_protect improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
9383
diff
changeset
|
275 goto_frame (n); |
17af7cce7d1b
yet more unwind_protect improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
9383
diff
changeset
|
276 } |
17af7cce7d1b
yet more unwind_protect improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
9383
diff
changeset
|
277 |
7752
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
278 static bool goto_frame_relative (int n, bool verbose = false) |
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
279 { |
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
280 return instance_ok () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
281 ? instance->do_goto_frame_relative (n, verbose) : false; |
7752
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
282 } |
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
283 |
7901 | 284 static void goto_caller_frame (void) |
285 { | |
286 if (instance_ok ()) | |
287 instance->do_goto_caller_frame (); | |
288 } | |
289 | |
290 static void goto_base_frame (void) | |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
291 { |
7901 | 292 if (instance_ok ()) |
293 instance->do_goto_base_frame (); | |
294 } | |
295 | |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
296 static octave_map backtrace (size_t nskip = 0) |
7901 | 297 { |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
298 octave_idx_type curr_user_frame = -1; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
299 |
7901 | 300 return instance_ok () |
18440
96a495813047
Don't put parent function in subfunction stack structure name (bug #41506).
Rik <rik@octave.org>
parents:
18267
diff
changeset
|
301 ? instance->do_backtrace (nskip, curr_user_frame, true) |
96a495813047
Don't put parent function in subfunction stack structure name (bug #41506).
Rik <rik@octave.org>
parents:
18267
diff
changeset
|
302 : octave_map (); |
96a495813047
Don't put parent function in subfunction stack structure name (bug #41506).
Rik <rik@octave.org>
parents:
18267
diff
changeset
|
303 } |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19415
diff
changeset
|
304 |
18440
96a495813047
Don't put parent function in subfunction stack structure name (bug #41506).
Rik <rik@octave.org>
parents:
18267
diff
changeset
|
305 static octave_map backtrace (size_t nskip, octave_idx_type& curr_user_frame, |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
306 bool print_subfn = true) |
18440
96a495813047
Don't put parent function in subfunction stack structure name (bug #41506).
Rik <rik@octave.org>
parents:
18267
diff
changeset
|
307 { |
96a495813047
Don't put parent function in subfunction stack structure name (bug #41506).
Rik <rik@octave.org>
parents:
18267
diff
changeset
|
308 return instance_ok () |
96a495813047
Don't put parent function in subfunction stack structure name (bug #41506).
Rik <rik@octave.org>
parents:
18267
diff
changeset
|
309 ? instance->do_backtrace (nskip, curr_user_frame, print_subfn) |
96a495813047
Don't put parent function in subfunction stack structure name (bug #41506).
Rik <rik@octave.org>
parents:
18267
diff
changeset
|
310 : octave_map (); |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
311 } |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
312 |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
313 static std::list<octave_call_stack::stack_frame> |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
314 backtrace_frames (size_t nskip = 0) |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
315 { |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
316 octave_idx_type curr_user_frame = -1; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
317 |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
318 return instance_ok () |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
319 ? instance->do_backtrace_frames (nskip, curr_user_frame) |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
320 : std::list<octave_call_stack::stack_frame> (); |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
321 } |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19415
diff
changeset
|
322 |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
323 static std::list<octave_call_stack::stack_frame> |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
324 backtrace_frames (size_t nskip, octave_idx_type& curr_user_frame) |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
325 { |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
326 return instance_ok () |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
327 ? instance->do_backtrace_frames (nskip, curr_user_frame) |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
328 : std::list<octave_call_stack::stack_frame> (); |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
329 } |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
330 |
10767
2b041d3995a3
modernize some map usage on toplev.cc and error.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
331 static octave_map empty_backtrace (void); |
2b041d3995a3
modernize some map usage on toplev.cc and error.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
332 |
5743 | 333 static void pop (void) |
334 { | |
335 if (instance_ok ()) | |
336 instance->do_pop (); | |
337 } | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
338 |
5743 | 339 static void clear (void) |
340 { | |
341 if (instance_ok ()) | |
342 instance->do_clear (); | |
343 } | |
7552
6070c3bd69c4
Arbitrary call stack access for external debuggers changeset
ryanru@PrinceHumperdinck
parents:
7409
diff
changeset
|
344 |
5743 | 345 private: |
346 | |
347 // The current call stack. | |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
348 std::deque<stack_frame> cs; |
5743 | 349 |
7752
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
350 size_t curr_frame; |
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
351 |
5743 | 352 static octave_call_stack *instance; |
353 | |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
354 static void cleanup_instance (void) { delete instance; instance = 0; } |
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
355 |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
356 int do_current_line (void) const; |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
357 |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
358 int do_current_column (void) const; |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
359 |
7923
c3d21b9b94b6
eliminate octave_call_stack member functions caller_user_script and caller_user_function, and unused difference_type args
John W. Eaton <jwe@octave.org>
parents:
7912
diff
changeset
|
360 int do_caller_user_code_line (void) const; |
7877 | 361 |
7923
c3d21b9b94b6
eliminate octave_call_stack member functions caller_user_script and caller_user_function, and unused difference_type args
John W. Eaton <jwe@octave.org>
parents:
7912
diff
changeset
|
362 int do_caller_user_code_column (void) const; |
7877 | 363 |
7942
db6478d9c669
out_of_date_check_internal: make it work for class methods
John W. Eaton <jwe@octave.org>
parents:
7923
diff
changeset
|
364 octave_function *do_caller (void) const |
db6478d9c669
out_of_date_check_internal: make it work for class methods
John W. Eaton <jwe@octave.org>
parents:
7923
diff
changeset
|
365 { |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
366 return curr_frame > 1 ? cs[curr_frame-1].m_fcn : cs[0].m_fcn; |
7942
db6478d9c669
out_of_date_check_internal: make it work for class methods
John W. Eaton <jwe@octave.org>
parents:
7923
diff
changeset
|
367 } |
db6478d9c669
out_of_date_check_internal: make it work for class methods
John W. Eaton <jwe@octave.org>
parents:
7923
diff
changeset
|
368 |
7752
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
369 size_t do_current_frame (void) { return curr_frame; } |
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
370 |
7890 | 371 size_t do_size (void) { return cs.size (); } |
372 | |
7901 | 373 size_t do_num_user_code_frames (octave_idx_type& curr_user_frame) const; |
374 | |
375 symbol_table::scope_id do_current_scope (void) const | |
376 { | |
377 return curr_frame > 0 && curr_frame < cs.size () | |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
378 ? cs[curr_frame].m_scope : 0; |
7901 | 379 } |
380 | |
381 symbol_table::context_id do_current_context (void) const | |
382 { | |
383 return curr_frame > 0 && curr_frame < cs.size () | |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
384 ? cs[curr_frame].m_context : 0; |
7901 | 385 } |
386 | |
20946 | 387 #if 0 |
388 const stack_frame& do_frame (size_t idx) | |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
389 { |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
390 static stack_frame foobar; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
391 |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
392 return idx < cs.size () ? cs[idx] : foobar; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
393 } |
20946 | 394 #endif |
395 | |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
396 octave_function *do_element (size_t n) |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
397 { |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
398 octave_function *retval = 0; |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
399 |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
400 if (cs.size () > n) |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
401 { |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
402 stack_frame& elt = cs[n]; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
403 retval = elt.m_fcn; |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
404 } |
5743 | 405 |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
406 return retval; |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
407 } |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
408 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
409 octave_user_code *do_caller_user_code (size_t nskip) const; |
5744 | 410 |
18267
bc139ccccef9
Don't echo scripts not executed from the cmd line when using 'echo on'(bug #41202)
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
411 bool do_all_scripts (void) const; |
bc139ccccef9
Don't echo scripts not executed from the cmd line when using 'echo on'(bug #41202)
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
412 |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
413 void do_push (octave_function *fcn, symbol_table::scope_id scope, |
10313 | 414 symbol_table::context_id context) |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
415 { |
7901 | 416 size_t prev_frame = curr_frame; |
417 curr_frame = cs.size (); | |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
418 cs.push_back (stack_frame (fcn, scope, context, prev_frame)); |
7901 | 419 symbol_table::set_scope_and_context (scope, context); |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
420 } |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
421 |
9484
bbe033dcfe13
make dbwhere work when called at keyboard prompt
John W. Eaton <jwe@octave.org>
parents:
9396
diff
changeset
|
422 octave_function *do_current (void) const |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
423 { |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
424 octave_function *retval = 0; |
5744 | 425 |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
426 if (! cs.empty ()) |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
427 { |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
428 const stack_frame& elt = cs[curr_frame]; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
429 retval = elt.m_fcn; |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
430 } |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
431 |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
432 return retval; |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
433 } |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
434 |
16354
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
435 void do_set_location (int l, int c) |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
436 { |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
437 if (! cs.empty ()) |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
438 { |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
439 stack_frame& elt = cs.back (); |
16354
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
440 |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
441 elt.m_line = l; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
442 elt.m_column = c; |
16354
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
443 } |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
444 } |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
445 |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
446 void do_set_line (int l) |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
447 { |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
448 if (! cs.empty ()) |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
449 { |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
450 stack_frame& elt = cs.back (); |
16354
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
451 |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
452 elt.m_line = l; |
16354
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
453 } |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
454 } |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
455 |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
456 void do_set_column (int c) |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
457 { |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
458 if (! cs.empty ()) |
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
459 { |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
460 stack_frame& elt = cs.back (); |
16354
fb27f1e08297
track line and column info directly in call stack (bug #38556)
John W. Eaton <jwe@octave.org>
parents:
16177
diff
changeset
|
461 |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
462 elt.m_column = c; |
7734
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
463 } |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
464 } |
2dee19385d32
eliminate tree_statement_stack; handle current statement info in octave_call_stack
John W. Eaton <jwe@octave.org>
parents:
7733
diff
changeset
|
465 |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
466 std::list<octave_call_stack::stack_frame> |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
467 do_backtrace_frames (size_t nskip, octave_idx_type& curr_user_frame) const; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
468 |
10767
2b041d3995a3
modernize some map usage on toplev.cc and error.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
469 octave_map do_backtrace (size_t nskip, |
18440
96a495813047
Don't put parent function in subfunction stack structure name (bug #41506).
Rik <rik@octave.org>
parents:
18267
diff
changeset
|
470 octave_idx_type& curr_user_frame, |
96a495813047
Don't put parent function in subfunction stack structure name (bug #41506).
Rik <rik@octave.org>
parents:
18267
diff
changeset
|
471 bool print_subfn) const; |
5744 | 472 |
7752
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
473 bool do_goto_frame (size_t n, bool verbose); |
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
474 |
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
475 bool do_goto_frame_relative (int n, bool verbose); |
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
476 |
7901 | 477 void do_goto_caller_frame (void); |
478 | |
479 void do_goto_base_frame (void); | |
480 | |
5743 | 481 void do_pop (void) |
482 { | |
7901 | 483 if (cs.size () > 1) |
7752
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
484 { |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
485 const stack_frame& elt = cs.back (); |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
486 curr_frame = elt.m_prev; |
10313 | 487 cs.pop_back (); |
19415
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
488 const stack_frame& new_elt = cs[curr_frame]; |
972abb60c30f
emit stack trace immediately at point of error
John W. Eaton <jwe@octave.org>
parents:
18440
diff
changeset
|
489 symbol_table::set_scope_and_context (new_elt.m_scope, new_elt.m_context); |
7752
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7736
diff
changeset
|
490 } |
5743 | 491 } |
492 | |
493 void do_clear (void) { cs.clear (); } | |
494 }; | |
495 | |
14014
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
496 // Call a function with exceptions handled to avoid problems with |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
497 // errors while shutting down. |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
498 |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
499 #define OCTAVE_IGNORE_EXCEPTION(E) \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
500 catch (E) \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
501 { \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
502 std::cerr << "error: ignoring " #E " while preparing to exit" << std::endl; \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
503 recover_from_exception (); \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
504 } |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
505 |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
506 #define OCTAVE_SAFE_CALL(F, ARGS) \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
507 do \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
508 { \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
509 try \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
510 { \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
511 unwind_protect frame; \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
512 \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
513 frame.protect_var (Vdebug_on_error); \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
514 frame.protect_var (Vdebug_on_warning); \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
515 \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
516 Vdebug_on_error = false; \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
517 Vdebug_on_warning = false; \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
518 \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
519 F ARGS; \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
520 } \ |
20535
b70cc4bd8109
begin removal of global error_state variable
John W. Eaton <jwe@octave.org>
parents:
20511
diff
changeset
|
521 OCTAVE_IGNORE_EXCEPTION (const octave_interrupt_exception&) \ |
b70cc4bd8109
begin removal of global error_state variable
John W. Eaton <jwe@octave.org>
parents:
20511
diff
changeset
|
522 OCTAVE_IGNORE_EXCEPTION (const octave_execution_exception&) \ |
b70cc4bd8109
begin removal of global error_state variable
John W. Eaton <jwe@octave.org>
parents:
20511
diff
changeset
|
523 OCTAVE_IGNORE_EXCEPTION (const std::bad_alloc&) \ |
14014
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
524 } \ |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
525 while (0) |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13983
diff
changeset
|
526 |
1 | 527 #endif |