summaryrefslogtreecommitdiff
path: root/lib/perl5db.pl
Commit message (Collapse)AuthorAgeFilesLines
* bump perl5db.pl $VERSION to 1.61Tony Cook2021-06-221-1/+1
|
* fix comment.Atsushi SUGAWARA2021-06-221-1/+1
|
* lib/perl5db.pl: cmd_l() no longer exists.Atsushi SUGAWARA2021-06-221-1/+1
| | | | | Subroutine cmd_l() no longer exists. Now we should call cmd_l_main().
* bump perl5db.pl's $VERSIONTony Cook2020-12-091-1/+1
|
* Allow debugger aliases that start with '-' and '.'jkahrman2020-12-091-1/+1
| | | | | Since the '.' and '-' commands don't take any arguments and don't run if any are provided, don't treat commands starting with these characters as the single commands '.' and '-'. Restores behavior that existed prior to https://github.com/Perl/perl5/commit/7fdd4f080863703d44282c6988834455d129040 (v5.27) at least back to v5.8.8 https://github.com/Perl/perl5/commit/7fdd4f080863703d44282c6988834455d129040
* perl5db.pl - remove redundant share()Richard Leach2020-10-141-1/+0
|
* Add crosslinks between perl5db.pl and perldebug-related docsDan Book2020-10-081-1/+3
|
* fix `l $var` where $var is a lexical variableTony Cook2020-08-101-273/+276
| | | | | As with `i $obj` the DB::Obj in the call stack prevented DB::eval from compiling/executing in the context of the debugged code.
* fix C<i $obj> where $obj is a lexicalTony Cook2020-08-101-32/+33
| | | | | | | | | | | | | | | the DB::eval function depends on the special behaviour of eval "" within the DB package, which evaluates the string within the context of the first non-DB sub or eval scope, working up the call stack. The debugger refactor moved handling for the 'i' command from the DB package to the DB::Obj package, so the eval in DB::eval was working in the context of the DB::Obj::cmd_i function, not in the calling scope. Fixed by moving the handling for the i command back to DB. Fixes #17661.
* perl5db: allow the recorded history item length to be configuredRicardo Signes2020-07-301-6/+6
| | | | | | | | | | | | | This requires a few small changes. 1. add a new option, which I stored in what looked like one of the standard ways 2. only store the item in terminal history if >= this length 3. only add to @hist if >= this length 4. only display hist item if >= this length I believe #4 is redundant and should be removed, but the code was already effectively there.
* Clearing DB::action at the end is no longer neededE. Choroba2020-07-301-4/+0
| | | | as it's cleared right after it's been run.
* After running an action in the debugger, turn it offE. Choroba2020-07-301-1/+2
| | | | | | | When running with "c", there was no problem, but when running with "n" or "s", once the action was executed, it kept executing on the following lines, which wasn't expected. Clearing $action here prevents this unwanted behaviour.
* Fix a bunch of repeated-word typosDagfinn Ilmari Mannsåker2020-05-221-3/+3
| | | | | Mostly in comments and docs, but some in diagnostic messages and one case of 'or die die'.
* perl5db.pl: the "i" command must load mro.pm before useRicardo Signes2020-03-231-1/+4
|
* (perl #124203) fix a similar problem with DB::lsubTony Cook2019-03-081-24/+25
|
* bump $DB::VERSION for perl5db.pl to 1.55Tony Cook2019-03-081-1/+1
|
* (perl #124203) avoid a deadlock in DB::subTony Cook2019-03-081-104/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I don't know how this ever worked. Previously, DB::sub() would hold a lock on $DB::DBGR for it's entire body, including the call to the subroutine being called. This could cause problems in two cases: a) on creation of a new thread, CLONE() is called in the context of the new interpreter before the new thread is created. So you'd have a sequence like: threads->new DB::sub for threads::new (lock $DBGR) call into threads::new which creates a new interpreter Cwd::CLONE() (in the new interpreter) DB::sub for Cwd::CLONE (in the new interpreter) (deadlock trying to lock $DBGR) One workaround I tried for this was to prevent pp_entersub calling DB::sub if we were cloning (by checking PL_ptr_table). This did improve matters, but wasn't needed in the final patch. Note that the recursive lock on $DBGR would have been fine if the new code was executing in the same interpreter, since the locking code simply bumps a reference count if the current interpreter already holds the lock. b) when the called subroutine blocks. For the test case this could happen with the call to $thr->join. There would be a sequence like: (parent) $thr->join (parent) DB::sub for threads::join (lock $DBGR) (parent) call threads::join and block (child) try to call main::sub1 (child) DB::sub for main::sub1 (deadlock trying to lock $DBGR) This isn't limited to threads::join obviously, one thread could be waiting for input, sleeping, or performing a complex calculation. The solution I chose here was the obvious one - don't hold the lock for the actual call. This required some rearrangement of the code and removed some duplication too.
* fix typosAlexandr Savca2018-10-091-2/+2
| | | | | | | | Committer: For porting tests: Update $VERSION in 4 files. Run: ./perl -Ilib regen/mk_invlists.pl ./perl -Ilib regen/regcharclass.pl
* lib/perl5db.pl: don't dump argless argsDavid Mitchell2017-11-151-8/+4
| | | | | | | | | | | | | | | | | | | | dump_trace() prints a stack backtrace - including caller args - by using caller() and @DB::args. However, if a sub is called using the '&foo;' argless mechanism, caller() doesn't populate @DB::args, so it continues to hold whatever it was set to previously. This might include SVs which have since been freed or re-allocated. So only display args for a particular caller depth if that sub was called with args. This was causing smoke failures in lib/perl5db.t when TERM was unset. It only started failing recently, due I guess to subtle changes in what SVs were left hanging about in @DB::args from a previous use of caller(). See http://nntp.perl.org/group/perl.perl5.porters/247032 Subject: Smoke FAIL's for lib/perl5db.t
* Debugger cmds not requiring spacesSmylers2017-09-301-2/+5
| | | | | | | | | | | | | Make debugger commands like these work again, not requiring a space between a single-letter command and a following argument which starts with punctuation: p$^V x@ARGV x\@ARGV x\%INC Regressions were in d478d7a0 and 8f144dfc.
* RT#113960: perl5db should ignore /dev/tty on non-Unix systemsJames E Keenan2017-01-041-8/+11
| | | | | | | | | If a Win32 system happens to have a \dev\tty file at the root of the current drive, we were incorrectly treating that as an indicator that the system is in fact Unix-like. Fix this by looking at the filesystem for that file only after considering all the OS platforms that we know aren't Unix-like in that way.
* Switch most open() calls to three-argument form.John Lightsey2016-12-231-9/+9
| | | | | | | | | | Switch from two-argument form. Filehandle cloning is still done with the two argument form for backward compatibility. Committer: Get all porting tests to pass. Increment some $VERSIONs. Run: ./perl -Ilib regen/mk_invlists.pl; ./perl -Ilib regen/regcharclass.pl For: RT #130122
* bump perl5db.pl's $VERSIONTony Cook2016-07-261-1/+2
| | | | | | Add a note about version numbering, since if we use X.XX_XX versions in blead it's harder to find an unused version number if the module is modified in maint.
* perl5db.pl: ensure PadWalker is loaded from standard pathsTony Cook2016-07-261-2/+8
|
* lib/perl5db.pl: Fix pod error.Karl Williamson2016-04-231-2/+2
|
* perl5db.pl version bumpJarkko Hietaniemi2016-03-021-1/+1
|
* Defaulting to VMS is probably not right.Jarkko Hietaniemi2016-03-021-3/+8
|
* amigaos4: use CONSOLE:, not VMS sys$commandAndy Broad2016-03-021-0/+8
|
* Ensure 'q' works in debugger with RemotePort.Shlomi Fish2015-12-021-2/+7
| | | | | | Patch submitted by Shlomi Fish. For: RT #126735
* Fix RT#71678 (-d a command after exit) with a test.Shlomi Fish2015-06-031-1/+4
| | | | | Credits to Heiko Eissfeldt for the reported bug, the test program and a proposed fix.
* bump perl5db.pl's $VERSIONTony Cook2015-04-161-1/+1
|
* lib/perl5db.pl: Restore noop lock prototypeJames McCoy2015-04-161-0/+1
| | | | | | | | | | | | | | | | | | cde405a6b9b86bd8110f63531b42d89590a4c56e removed the lock prototype "because it's already a do-nothing weak keyword without threads". However, that causes "perl -d threaded-script.pl" to complain lock can only be used on shared values at /usr/share/perl/5.20/perl5db.pl line 4101. BEGIN failed--compilation aborted at threaded-script.pl line 2. lock can only be used on shared values at /usr/share/perl/5.20/perl5db.pl line 2514. END failed--call queue aborted at threaded-script.pl line 2. Unbalanced scopes: 3 more ENTERs than LEAVEs because threaded-script.pl's importing of threads::shared enable's lock()'s non-noop behavior. Restoring the lock() prototype fixes the inconsistency between lock() and share() usage. Signed-off-by: James McCoy <vega.james@gmail.com>
* lib/perl5db.pl: Fix pod typoKarl Williamson2015-03-191-1/+1
|
* lib/perl5db.pl: Generalize for EBCDICKarl Williamson2015-03-191-2/+4
|
* Create single fcn for dup'd /lib codeKarl Williamson2015-03-191-6/+5
| | | | | | | | | | | | | | | | | | | | | Several /lib .pm's have the same code which is complicated enough to warrant being placed in a shared function. This commit creates a .pm to be used by these .pm's. This implements the perhaps archaic 'Meta' notation wherein characters above 0x7f are displayed as M- plus the ASCII-range character derived by looking at only the lower 7 bits of the upper range one. There are problems with this, in that a literal control character can be in the string, whereas it is trying to get rid of control characters. But I left it to work as-is, just centralizing the code. On EBCDIC platforms this notation makes no sense because the bit patterns are all mixed up about having the upper bit set. So this commit fixes things on these platforms, so these are changed to \x{...}. No literal control characters are emitted. Another potential problem is that characters above 0xFF are passed through, unchanged. But again, I let the existing behavior stand.
* Increase perl5db.pl’s $VERSION to 1.47Father Chrysostomos2015-01-051-1/+1
|
* perl5db.pl: Undefined subroutine &DB::db_warnE. Choroba2015-01-051-8/+8
| | | | | | | | | | | | | | | | | | | Perl debugger sometimes tries to call a non-existent subroutine db_warn. It's real name is _db_warn, though. How to replicate: perl -d -e1 !/ Output: /bin/bash: /: Is a directory Undefined subroutine &DB::db_warn called at /usr/lib/perl5/5.18.1/perl5db.pl line 6740. at /usr/lib/perl5/5.18.1/perl5db.pl line 6740. DB::_db_system('/bin/bash', '-c', '/') called at /usr/lib/perl5/5.18.1/perl5db.pl line 3923 DB::Obj::_handle_sh_command('DB::Obj=HASH(0x105df48)') called at /usr/lib/perl5/5.18.1/perl5db.pl line 2992 DB::DB called at -e line 1
* fix debugger y command scope levelTony Cook2014-08-151-2/+2
| | | | | | 5c2b78e73d3 moved handling of the y command into its own function, but did not adjust the provided scope level to account for the extra scope.
* Fix RT #121509 : perl -d handling chdir().Shlomi Fish2014-05-281-0/+12
| | | | | | | | | See: https://rt.perl.org/Ticket/Display.html?id=121509 [perl #121509] perl debugger doesn't save starting dir to restart from Thanks to Linda Walsh for reporting the problem and RJBS for commenting for initial approval. Fix and a regression test by Shlomi Fish.
* bump perl5db.pl $VERSION to 1.45Tony Cook2014-05-281-1/+1
|
* Implement get_fork_TTY for tmuxRob Hoelz2014-05-281-0/+42
|
* bump version on debuggerRicardo Signes2014-04-071-1/+1
|
* properly reset ReadLine's knowledge of handles after pagerHiroo Hayashi2014-04-071-0/+3
| | | | [perl #121456]
* Crash in tab completion with Term::ReadLine::Gnu.Shlomi Fish2014-01-061-2/+2
| | | | | | Perhaps it also affects Term::ReadLine::Perl / Term::ReadLine::Perl5 . I still need to test with PadWalker installed. No tests were added, but it passes all existing tests.
* Fix RT #41461 (with a test).Shlomi Fish2013-08-101-2/+6
| | | | | | | A problem with the perl debugger of writing to an undef $LINEINFO. Bump $VERSION to 1.42. For: RT #41461
* [perl #118839] Make ‘n’ debugger cmd respect lv subsFather Chrysostomos2013-07-131-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ‘n’ debugger command, which is supposed to step over subs, was not stepping over lvalue subs. This is a regression from 5.8, but 5.8 was worse. This bug did not occur in 5.8 because there was no mechanism back then for handling lvalue subs specially (via DB::lsub), so assignment to an lvalue sub was completely broken under the debugger. Perl 5.10 introduced DB::lsub. The implementation in perl5db.pl contains these lines at the end of the sub: # Pop the single-step value back off the stack. $single |= $stack[ $stack_depth-- ]; # call the original lvalue sub. &$sub; The regular DB::sub does this: { no strict 'refs'; @ret = &$sub; } # Pop the single-step value back off the stack. $single |= $stack[ $stack_depth-- ]; Notice how $single (i.e., $DB::single) is modified before and after the sub call, respectively. The order is different. There are two types of lvalue list context for lvalue subs. (foo)=3 will allow sub foo:lvalue{@a} to return the array itself. \(foo) and bar(foo) will flatten the array. So there is no way in pure Perl to capture the return value and have it returned to the caller unchanged. That is why DB::lsub has to call the sub last of all (and have the context propagated). The solution here is to use localisation to accomplish the assigment to $single after the lvalue sub exits.
* perl5db.pl: Remove obsolete commentFather Chrysostomos2013-07-131-3/+0
| | | | The regexp engine is now fully reëntrant.
* Increase perl5db.pl’s $VERSION to 1.41Father Chrysostomos2013-06-221-1/+1
|
* Fixed verbatim lines in POD over 79 charactersBrian Gottreu2013-06-221-1/+2
|
* Fix the mutability of @_ in perl -d.Shlomi Fish2013-06-101-9/+18
| | | | | | With a test. See Father C.'s comment on RT #118169.