Mercurial > octave
annotate etc/gdbinit @ 33624:e0c037a01fde default tip
redirect stdout and stderr into experimental terminal widget
* command-widget.cc (command_widget): open temp files for redirecting
stdout and stderr, setup a file system watcher for signals on changes
to these files;
(~command_widget): close and remove the temp. files;
(insert_interpreter_output): use the style as second argument
(print_stream): add new contents of temp. files for stdout and stderr
to the end of the terminal contents;
(notice_settings): set the terminal preferences to the new lexer of
the console;
(console): create and set new lexer;
(new_command_line): use prompt style for the prompt;
(execute_command): use second command line argument for the style;
(append_string): use style as second argument and style the added
text accordingly;
* command-widget.h (console) append_string with second argument for style,
(command_widget): now with destructor, new method print_stream,
insert_interpreter_output with second argument for style, new class
variables for temp. file descriptors and file system watcher
* console-lexer.cc/h: new lexer derived from QScintillas default lexer
for styling the terminal output, styles used so far: Default, Error,
and Prompt
* gui-preferences-cs.h: new constants for error and prompt colors
* libgui/src/module.mk: new files console_lexer.cc/h
* qt-interpreter-events.cc (display_exception): interpreter_output_signal
with second argument for the style, here Error style
* qt-interpreter-events.h: interpreter_output_signal with second
argument for the style
* terminal-dock-widget.h: interpreter_output_signal with second
argument for the style
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Sat, 25 May 2024 14:36:01 +0200 |
parents | 2e484f9f1f18 |
children |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 ######################################################################## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 ## |
32632
2e484f9f1f18
maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
31706
diff
changeset
|
3 ## Copyright (C) 2010-2024 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
4 ## |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 ## See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 ## distribution or <https://octave.org/copyright/>. |
24537
11729ca6eb81
Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents:
23083
diff
changeset
|
7 ## |
11729ca6eb81
Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents:
23083
diff
changeset
|
8 ## This file is part of Octave. |
11729ca6eb81
Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents:
23083
diff
changeset
|
9 ## |
11729ca6eb81
Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents:
23083
diff
changeset
|
10 ## Octave is free software: you can redistribute it and/or modify it |
11729ca6eb81
Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents:
23083
diff
changeset
|
11 ## under the terms of the GNU General Public License as published by |
11729ca6eb81
Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents:
23083
diff
changeset
|
12 ## the Free Software Foundation, either version 3 of the License, or |
11729ca6eb81
Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents:
23083
diff
changeset
|
13 ## (at your option) any later version. |
11729ca6eb81
Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents:
23083
diff
changeset
|
14 ## |
11729ca6eb81
Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents:
23083
diff
changeset
|
15 ## Octave is distributed in the hope that it will be useful, but |
11729ca6eb81
Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents:
23083
diff
changeset
|
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
11729ca6eb81
Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents:
23083
diff
changeset
|
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11729ca6eb81
Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents:
23083
diff
changeset
|
18 ## GNU General Public License for more details. |
11729ca6eb81
Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents:
23083
diff
changeset
|
19 ## |
11729ca6eb81
Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents:
23083
diff
changeset
|
20 ## You should have received a copy of the GNU General Public License |
11729ca6eb81
Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents:
23083
diff
changeset
|
21 ## along with Octave; see the file COPYING. If not, see |
11729ca6eb81
Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents:
23083
diff
changeset
|
22 ## <https://www.gnu.org/licenses/>. |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 ## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 ######################################################################## |
24537
11729ca6eb81
Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents:
23083
diff
changeset
|
25 |
11729ca6eb81
Add GPL license header to more Octave source files.
Rik <rik@octave.org>
parents:
23083
diff
changeset
|
26 ############################################################ |
16602
2c11d7c6cc21
turn off gdb thread messages by default
John W. Eaton <jwe@octave.org>
parents:
13690
diff
changeset
|
27 ## Disable the next line if you really need to see the |
2c11d7c6cc21
turn off gdb thread messages by default
John W. Eaton <jwe@octave.org>
parents:
13690
diff
changeset
|
28 ## thread create/exit messages. |
2c11d7c6cc21
turn off gdb thread messages by default
John W. Eaton <jwe@octave.org>
parents:
13690
diff
changeset
|
29 |
2c11d7c6cc21
turn off gdb thread messages by default
John W. Eaton <jwe@octave.org>
parents:
13690
diff
changeset
|
30 set print thread-events off |
2c11d7c6cc21
turn off gdb thread messages by default
John W. Eaton <jwe@octave.org>
parents:
13690
diff
changeset
|
31 |
10360 | 32 ## Helpful macros for debugging Octave. |
33 | |
24845
578ebece3dc7
* etc/gdbinit: Fix syntax. (bug #53241)
John W. Eaton <jwe@octave.org>
parents:
24537
diff
changeset
|
34 ## Programming Note: Don't strip the trailing space from the lines that |
578ebece3dc7
* etc/gdbinit: Fix syntax. (bug #53241)
John W. Eaton <jwe@octave.org>
parents:
24537
diff
changeset
|
35 ## end with '\ '. GDB strips spaces from the ends of the lines, so |
578ebece3dc7
* etc/gdbinit: Fix syntax. (bug #53241)
John W. Eaton <jwe@octave.org>
parents:
24537
diff
changeset
|
36 ## these are required to preserve the whitespace. |
578ebece3dc7
* etc/gdbinit: Fix syntax. (bug #53241)
John W. Eaton <jwe@octave.org>
parents:
24537
diff
changeset
|
37 |
13328
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
38 ############################################################ |
10360 | 39 ## Display a dim-vector object. |
40 | |
41 define display-dims | |
24845
578ebece3dc7
* etc/gdbinit: Fix syntax. (bug #53241)
John W. Eaton <jwe@octave.org>
parents:
24537
diff
changeset
|
42 echo ndims: \ |
30030
06f4e4d986a1
* gdbinit: Update for new array data member names.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
43 output $arg0.m_num_dims |
24845
578ebece3dc7
* etc/gdbinit: Fix syntax. (bug #53241)
John W. Eaton <jwe@octave.org>
parents:
24537
diff
changeset
|
44 echo \ndims: \ |
30030
06f4e4d986a1
* gdbinit: Update for new array data member names.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
45 output *$arg0.m_dims@$arg0.m_num_dims |
10360 | 46 echo \n |
47 dont-repeat | |
48 end | |
49 | |
13328
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
50 document display-dims |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
51 Usage: display-dims DIM_VECTOR |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
52 Display the contents of an Octave dimension vector. |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
53 end |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
54 |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
55 ############################################################ |
10360 | 56 ## Display a dense array object. |
57 | |
58 define display-dense-array | |
24845
578ebece3dc7
* etc/gdbinit: Fix syntax. (bug #53241)
John W. Eaton <jwe@octave.org>
parents:
24537
diff
changeset
|
59 echo array object: \ |
10360 | 60 output $arg0 |
61 echo \ndimensions:\n | |
30030
06f4e4d986a1
* gdbinit: Update for new array data member names.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
62 display-dims $arg0.m_dimensions |
24845
578ebece3dc7
* etc/gdbinit: Fix syntax. (bug #53241)
John W. Eaton <jwe@octave.org>
parents:
24537
diff
changeset
|
63 echo \nrep = \ |
30030
06f4e4d986a1
* gdbinit: Update for new array data member names.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
64 output *$arg0.m_rep |
24845
578ebece3dc7
* etc/gdbinit: Fix syntax. (bug #53241)
John W. Eaton <jwe@octave.org>
parents:
24537
diff
changeset
|
65 echo \nrep.data = \ |
30030
06f4e4d986a1
* gdbinit: Update for new array data member names.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
66 output *$arg0.m_rep.m_data@$arg0.m_rep.m_len |
06f4e4d986a1
* gdbinit: Update for new array data member names.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
67 echo \nrep.slice_data = \ |
06f4e4d986a1
* gdbinit: Update for new array data member names.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
68 output *$arg0.m_slice_data@$arg0.m_slice_len |
10360 | 69 echo \n |
70 dont-repeat | |
71 end | |
72 | |
13328
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
73 document display-dense-array |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
74 Usage: display-dense-array ARRAY |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
75 Display the contents of an ordinary, i.e., dense Octave array. |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
76 |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
77 See also [display-sparse-array] for showing the contents |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
78 of sparse Octave arrays. |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
79 end |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
80 |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
81 ############################################################ |
10360 | 82 ## Display a sparse array object. |
83 | |
84 define display-sparse-array | |
24845
578ebece3dc7
* etc/gdbinit: Fix syntax. (bug #53241)
John W. Eaton <jwe@octave.org>
parents:
24537
diff
changeset
|
85 echo sparse object: \ |
10360 | 86 output $arg0 |
30030
06f4e4d986a1
* gdbinit: Update for new array data member names.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
87 echo \ndimensions:\n |
06f4e4d986a1
* gdbinit: Update for new array data member names.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
88 display-dims $arg0.m_dimensions |
24845
578ebece3dc7
* etc/gdbinit: Fix syntax. (bug #53241)
John W. Eaton <jwe@octave.org>
parents:
24537
diff
changeset
|
89 echo \nrep = \ |
30030
06f4e4d986a1
* gdbinit: Update for new array data member names.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
90 output *$arg0.m_rep |
06f4e4d986a1
* gdbinit: Update for new array data member names.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
91 echo \nrep.data = \ |
06f4e4d986a1
* gdbinit: Update for new array data member names.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
92 output *$arg0.m_rep.m_data@$arg0.m_rep.m_nzmax |
06f4e4d986a1
* gdbinit: Update for new array data member names.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
93 echo \nrep.ridx = \ |
06f4e4d986a1
* gdbinit: Update for new array data member names.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
94 output *$arg0.m_rep.m_ridx@$arg0.m_rep.m_nzmax |
06f4e4d986a1
* gdbinit: Update for new array data member names.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
95 echo \nrep.cidx = \ |
06f4e4d986a1
* gdbinit: Update for new array data member names.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
96 output *$arg0.m_rep.m_cidx@($arg0.m_rep.m_ncols+1) |
10360 | 97 echo \n |
98 dont-repeat | |
99 end | |
13328
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
100 |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
101 document display-sparse-array |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
102 Usage: display-sparse-array SPARSE_ARRAY |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
103 Display the contents of a sparse Octave array. |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
104 |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
105 See also [display-dense-array] for showing the contents |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
106 of ordinary Octave arrays. |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
107 end |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
108 |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
109 ############################################################ |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
110 |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
16602
diff
changeset
|
111 ## Display Octave debugging stack |
13328
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
112 |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
113 define show-octave-dbstack |
13690
f0daeb0eab45
gdbinit: Fix declaration of new show-octave-dbstack macro
Rik <octave@nomad.inbox5.com>
parents:
13328
diff
changeset
|
114 call show_octave_dbstack () |
13328
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
115 end |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
116 |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
117 document show-octave-dbstack |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
118 Usage: show-octave-dbstack |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
119 Display the contents of the current Octave debugging stack. |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
120 |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
121 This is the function stack that the Octave interpreter is processing |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
122 and will be different from the C++ stack being debugged with gdb. |
a2144dbc2f3a
gdbinit: Add documentation for macros. Add alias for new show_octave_dbstack command.
Rik <octave@nomad.inbox5.com>
parents:
12733
diff
changeset
|
123 end |