#
14acc88f |
| 07-Apr-2023 |
kre <kre@NetBSD.org> |
The great shell trailing whitespace cleanup of 2023... Inspired by private e-mail comments from mouse@
NFCI.
|
#
84b7e622 |
| 10-Sep-2021 |
rillig <rillig@NetBSD.org> |
bin: remove unnecessary lint comment CONSTCOND
Since 2021-01-31, lint no longer warns about 'do ... while (0)'.
No functional change.
|
#
d4f69650 |
| 14-Feb-2019 |
kre <kre@NetBSD.org> |
DEBUG mode only change. When pretty-printing a word from a parse tree, don't display a CTLESC which is there only to protect a CTL* char (a data char that happens to have the same value). No actua
DEBUG mode only change. When pretty-printing a word from a parse tree, don't display a CTLESC which is there only to protect a CTL* char (a data char that happens to have the same value). No actual CTL* chars are printed as data, so no escaping is needed to protect data which just happens to look the same. Dropping this avoids the possibility of confusion/ambiguity in what the word actually contains.
NFC for any normal shell build (very little of this file gets compiled there)
show more ...
|
#
0f215c90 |
| 22-Jan-2019 |
kre <kre@NetBSD.org> |
NFCI - DEBUG mode only change.
Add tracing of lexical analyser operations. This is deliberately kept out of the normal "all on" set as it makes a *lot* of noise when enabled (especially in verbose
NFCI - DEBUG mode only change.
Add tracing of lexical analyser operations. This is deliberately kept out of the normal "all on" set as it makes a *lot* of noise when enabled (especially in verbose mode) - but when needed, it helps (evidence for which is coming soon).
As usual, no doc, you need the sources (and of course, a specially built sh to even be able to enable it.)
show more ...
|
#
61564359 |
| 21-Jan-2019 |
kre <kre@NetBSD.org> |
DEBUG mode shell cleanups (NFC for any normal shell).
Add an error DEBUG trace in exraise() (when the shell has detected some error or signal, and is aborting what it is doing)
Fix an arith error i
DEBUG mode shell cleanups (NFC for any normal shell).
Add an error DEBUG trace in exraise() (when the shell has detected some error or signal, and is aborting what it is doing)
Fix an arith error in DEBUG bit assignments (harmless as we haven't reached the limit of flags yet), and add some missing (recently added) debug flags so they are turned on when the user (ie: me) asks for "everything".
show more ...
|
#
2d3e6cd1 |
| 18-Oct-2018 |
kre <kre@NetBSD.org> |
Remove a DEBUG mode transition mechanism (for the transition from the ancient DEBUG TRACE() method, to the newer CTRACE() et. al.) that turns out never really needed committing - the mechanism, and t
Remove a DEBUG mode transition mechanism (for the transition from the ancient DEBUG TRACE() method, to the newer CTRACE() et. al.) that turns out never really needed committing - the mechanism, and the code that obsoleted it, were committed together (May 2017). [It was useful to me while getting to that state...]
NFC. Not even with DEBUG shells.
show more ...
|
#
216424cc |
| 19-Aug-2018 |
kre <kre@NetBSD.org> |
NFC: DEBUG mode only change. When tracing, show >&- as ">&-" rather than ">&-1" (the same op as >&n where internally n < 0 means "close")
|
#
51d5682b |
| 22-Jul-2018 |
kre <kre@NetBSD.org> |
DEBUG mode only change (ie: no effect to any normal shell).
Add tracing of pattern matching (aid in debugging various issues.)
|
#
2e100f01 |
| 30-Jun-2017 |
kre <kre@NetBSD.org> |
NFC: DEBUG only change - provide an externally visible (to the DEBUG sh internals) interface to one of the internal (private to trace code) functions
|
#
ab18ae12 |
| 17-Jun-2017 |
kre <kre@NetBSD.org> |
NFC - DEBUG mode only change - complete a change made earlier (marking the line number when included in the trace line tag to show whether it comes from the parser, or the elsewhere as they tend to b
NFC - DEBUG mode only change - complete a change made earlier (marking the line number when included in the trace line tag to show whether it comes from the parser, or the elsewhere as they tend to be quite different). Initially only one case was changed, while I pondered whether I liked it or not. Now it is all done... Also when there is a line tag at all, always include the root/sub-shell indicator character, not only when the pid is included.
show more ...
|
#
e12820a4 |
| 17-Jun-2017 |
kre <kre@NetBSD.org> |
NFC (normal use) - DEBUG only change, when showing empty arg list don't omit terminating \n.
|
#
44d23b1a |
| 08-Jun-2017 |
kre <kre@NetBSD.org> |
Correct spelling in comments of DEBUG only code...
|
#
28280b8d |
| 07-Jun-2017 |
kre <kre@NetBSD.org> |
A better LINENO implementation. This version deletes (well, #if 0's out) the LINENO hack, and uses the LINENO var for both ${LINENO} and $((LINENO)). (Code to invert the LINENO hack when required,
A better LINENO implementation. This version deletes (well, #if 0's out) the LINENO hack, and uses the LINENO var for both ${LINENO} and $((LINENO)). (Code to invert the LINENO hack when required, like when de-compiling the execution tree to provide the "jobs" command strings, is still included, that can be deleted when the LINENO hack is completely removed - look for refs to VSLINENO throughout the code. The var funclinno in parser.c can also be removed, it is used only for the LINENO hack.)
This version produces accurate results: $((LINENO)) was made as accurate as the LINENO hack made ${LINENO} which is very good. That's why the LINENO hack is not yet completely removed, so it can be easily re-enabled. If you can tell the difference when it is in use, or not in use, then something has broken (or I managed to miss a case somewhere.)
The way that LINENO works is documented in its own (new) section in the man page, so nothing more about that, or the new options, etc, here.
This version introduces the possibility of having a "reference" function associated with a variable, which gets called whenever the value of the variable is required (that's what implements LINENO). There is just one function pointer however, so any particular variable gets at most one of the set function (as used for PATH, etc) or the reference function. The VFUNCREF bit in the var flags indicates which func the variable in question uses (if any - the func ptr, as before, can be NULL).
I would not call the results of this perfect yet, but it is close.
show more ...
|
#
c1674850 |
| 29-May-2017 |
kre <kre@NetBSD.org> |
More DEBUG mode changes. As usual, read the source if you care.
|
#
fa95dd34 |
| 18-May-2017 |
kre <kre@NetBSD.org> |
DEBUG mode only change - mostly to output when option to show shell internal sub-process nesting is enabled, and very deep nesting levels exist.
NFC for anyone else.
|
#
0eaf1d16 |
| 15-May-2017 |
kre <kre@NetBSD.org> |
DEBUG mode shell update (changes nothing for shells which are not compiled for DEBUG.)
Add debug builtin command, and corresponding -D command line option. As usual, for DEBUG related stuff, read th
DEBUG mode shell update (changes nothing for shells which are not compiled for DEBUG.)
Add debug builtin command, and corresponding -D command line option. As usual, for DEBUG related stuff, read the source for info, that's all there is about this.
This completes the infrastructure changes for the updated DEBUG TRACE mechanism, so now converting the rest of the shell's internal tracing can happen as desired - piecemeal.
show more ...
|
#
50396514 |
| 13-May-2017 |
kre <kre@NetBSD.org> |
The beginnings of the great shell DEBUG (tracing) upgrade of 2017...
First, be aware that the DEBUG spoken of here has nothing whatever to do with MKDEBUG=true type builds of NetBSD. The only way
The beginnings of the great shell DEBUG (tracing) upgrade of 2017...
First, be aware that the DEBUG spoken of here has nothing whatever to do with MKDEBUG=true type builds of NetBSD. The only way to get a DEBUG shell is to build it yourself manually.
That said, for non-DEBUG shells, this change makes only one slight (trivial really) difference, which should affect nothing.
Previously some code was defined like ...
function(args) { #ifdef DEBUG /* function code goes here */ #endif }
and called like ...
#ifdef DEBUG function(params); #endif
resulting in several empty functions that are never called being defined in non-DEBUG shells. Those are now gone. If you can detect the difference any way other than using "nm" or similar, I'd be very surprised...
For DEBUG shells, this introduces a whole new TRACE() setup to use to assist in debugging the shell.
I have had this locally (uncommitted) for over a year... it helps.
By itself this change is almost useless, nothing really changes, but it provides the framework to allow other TRACE() calls to be updated over time. This is why I had not committed this earlier, my previous version required a flag day, with all the shell's internal tracing being updated a once - which I had done, but that shell version has bit-rotted so badly now it is almost useless...
Future updates will add the mechanism to allow the new stuff to actually be used in a productive way, and following that, over time, gradual conversion of all the shell tracing to the updated form (as required, or when I am bored...)
The one useful change that we do get now is that the fd that the shell uses for tracing (which was usually 3, but not any more) is now protected from user/script interference, like all the other shell inernal fds.
There is no doc (nor will there be) on any of this, if you are not reading the source code it is useless to you, if you are, you know how it works.
show more ...
|
#
bfca9809 |
| 09-May-2017 |
kre <kre@NetBSD.org> |
If we are going to permit ! ! pipeline (And for now the other places where ! is permitted) we should at least generate the logically correct exit status: ! ! (exit 5); echo $? should print 1, not 5
If we are going to permit ! ! pipeline (And for now the other places where ! is permitted) we should at least generate the logically correct exit status: ! ! (exit 5); echo $? should print 1, not 5. ksh and bosh do it this way - and it makes sense. bash and the FreeBSD sh echo "5" (as did we until now.) dash, zsh, yash all enforce the standard syntax, and prohibit this.
show more ...
|
#
8df98172 |
| 03-May-2017 |
kre <kre@NetBSD.org> |
This change affects shells compiled in DEBUG mode only, for normal shells (anything made by build.sh) there is no change at all.
In DEBUG shells, when tree dumping, remember to include NNOT (same om
This change affects shells compiled in DEBUG mode only, for normal shells (anything made by build.sh) there is no change at all.
In DEBUG shells, when tree dumping, remember to include NNOT (same omission as was just corrected in jobs.c :1.81) - of course, here there are lots of other node types not handled as well.
ALso, avoid a core dump bug when doing a tree dump of a pieline where the commands are not all simple commands (which can only happen with a command string like " cmd | ! cmd | ... ". The "!" in the middle is utter nonsense, and should be forbidden, but for now, at least avoid a core dump.
show more ...
|
#
24c43b9f |
| 16-Mar-2017 |
kre <kre@NetBSD.org> |
Undo local changes not intended to be committed (and certainly not with that commit message) in the previous update. This stuff works, and will probably appear sometime, but not right now.
|
#
9d194a36 |
| 16-Mar-2017 |
kre <kre@NetBSD.org> |
Have "make clean" remove sh.html1 and adapt it to clean trace files the way they have been generated the past 20 years or so...
|
#
466c3ec0 |
| 23-Oct-2016 |
abhinav <abhinav@NetBSD.org> |
Remove unused variables. Fixes the sh(1) build when DEBUG is enabled.
|
#
f3dcd966 |
| 11-May-2016 |
kre <kre@NetBSD.org> |
It was twenty(-two) years ago today J.T. Conklin told us not this way Berkeley 4.4 lite's changed which file And it's traced differently all this while
|
#
ae6e02a9 |
| 29-Feb-2016 |
christos <christos@NetBSD.org> |
Even more debugging improvements (from kre)
|
#
53698c00 |
| 28-Feb-2016 |
christos <christos@NetBSD.org> |
Bug fixes to handling of unterminated here documents (they should be, and now are, a syntax error), and miscellaneous other minor cleanups. (from kre)
|