summaryrefslogtreecommitdiff
path: root/deb.c
Commit message (Collapse)AuthorAgeFilesLines
* Perl_deb_stack_all() - handle empty CX stackDavid Mitchell2023-02-281-1/+4
| | | | | | | | | | | | | | | | | This function handles perl -Dsv, producing output like STACK 0: MAIN CX 0: BLOCK => CX 1: SUB => UNDEF PV("main"\0) retop=leave STACK 1: MAGIC CX 0: SUB => IV(1) When a CX stack had zero contexts pushed (like can sometimes happen when something has just done a PUSHSTACKi() and no op has pushed a BLOCK or SUB or whatever yet), then the code for determining where the next markstack pointer is (by peeking ahead into the first CX of the next SI) was accessing random garbage at cx[0]. This commit fixes that.
* Use `LINE_Tf` thoroughly for formatting the value of CopLINE()TAKAI Kousuke2022-10-131-3/+4
| | | | | | The value of CopLINE() used to be formatted with various way; sometimes with `%ld` and `(long)` cast, sometimes `IVdf` and `(IV)` cast, or `%d` and so on.
* deb.c - when PL_copline is NOLINE show 0 not 2^32-1.Yves Orton2022-08-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOLINE is defined to be U32_MAX (not sure why it is not 0, as lines in files by convention are numbered from 1 so 0 should be an illegal line number), some parts of our code explicitly set the cop_line to be NOLINE. When we debug we should show this as line 0, the U32_MAX value is somewhat confusing. We could also just not show a line at all, but for now this makes more sense, especially as the deb.c logic was using 0 when there is no curcop. Without this patch: $ ./perl -Dl -e'eval "1+;"x10' (-e:0) ENTER scope 2 (savestack=38) at op.c:10897 (-e:4294967295) LEAVE scope 2 (savestack=46) at op.c:10937 (-e:4294967295) savestack: releasing items 46 -> 38 (-e:0) ENTER scope 2 (savestack=40) at perly.c:289 (-e:1) ENTER scope 3 (savestack=78) at toke.c:4868 With this patch: $ ./perl -Dl -e'eval "1+;"x10' (-e:0) ENTER scope 2 (savestack=38) at op.c:10897 (-e:0) LEAVE scope 2 (savestack=46) at op.c:10937 (-e:0) savestack: releasing items 46 -> 38 (-e:0) ENTER scope 2 (savestack=40) at perly.c:289 (-e:1) ENTER scope 3 (savestack=78) at toke.c:4868 This fixes GH Issue #20175
* perlapi: Document Perl_deb and kinKarl Williamson2022-05-191-0/+26
|
* perlapi: Document debstackKarl Williamson2022-05-121-1/+7
|
* perlapi: Mark debstackptrs as internalKarl Williamson2022-05-121-1/+1
| | | | This is unused in Perl since at least Perl 5 Alpha, and unused in CPAN.
* replace all instances of PERL_IMPLICIT_CONTEXT with MULTIPLICITYTomasz Konojacki2021-06-091-1/+1
| | | | | | | | | | | | Since the removal of PERL_OBJECT (acfe0abcedaf592fb4b9cb69ce3468308ae99d91) PERL_IMPLICIT_CONTEXT and MULTIPLICITY have been synonymous and they're being used interchangeably. To simplify the code, this commit replaces all instances of PERL_IMPLICIT_CONTEXT with MULTIPLICITY. PERL_IMPLICIT_CONTEXT will stay defined for compatibility with XS modules.
* style: Detabify indentation of the C code maintained by the core.Michael G. Schwern2021-01-171-126/+126
| | | | | | | | | | | This just detabifies to get rid of the mixed tab/space indentation. Applying consistent indentation and dealing with other tabs are another issue. Done with `expand -i`. * vutil.* left alone, it's part of version. * Left regen managed files alone for now.
* Change white space to avoid C++ deprecation warningKarl Williamson2016-11-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | C++11 requires space between the end of a string literal and a macro, so that a feature can unambiguously be added to the language. Starting in g++ 6.2, the compiler emits a warning when there isn't a space (presumably so that future versions can support C++11). Unfortunately there are many such instances in the perl core. This commit fixes those, including those in ext/, but individual commits will be used for the other modules, those in dist/ and cpan/. This commit also inserts space at the end of a macro before a string literal, even though that is not deprecated, and removes useless "" literals following a macro (instead of inserting a blank). The result is easier to read, making the macro stand out, and be clearer as to the intention. Code and modules included with the Perl core need to be compilable using C++. This is so that perl can be embedded in C++ programs. (Actually, only the hdr files need to be so compilable, but it would be hard to test that just the hdrs are compilable.) So we need to accommodate changes to the C++ language.
* Perl_deb_stack_all() - handle CXt_SUBST betterDavid Mitchell2016-08-251-7/+8
| | | | | | | | | | RT #129029 There's a loop which skips CXt_SUBST context entries - but it wasn't checking that the *current* cx is that type, but instead was always checking the base cx and was effectively a noop Also fixup a few code comments in that function.
* Cannot do much if putc fails in debug output.Jarkko Hietaniemi2015-06-261-1/+1
| | | | Coverity CID 104782 (only flagged the deb.c spot)
* fix si_names context debugging namesDavid Mitchell2015-06-241-1/+1
| | | | | | | | | I recently added a new context stack type, MULTICALL. The table si_names[], which contains the stack type names to display with -Dsv a new label added, "MULTICALL", but the previous label didn't have a comma after it, so the two labels were actually being concatenated. Spotted by Coverity
* add PERLSI_MULTICALLDavid Mitchell2015-06-191-0/+1
| | | | | | | | | | | | | | | | Currently when MULTICALL pushes a new stackinfo, it uses the si_type PERLSI_SORT. This is probably just a hangover from when the MULTICALL code was created from similar code used to implement sort. Change it to use the new PERLSI_MULTICALL si_type. The si_type value is mainly used for debugging/dumping purposes, apart from a few places where we check for whether this is the top stack (PERLSI_MAIN); or check for a sort BLOCK (cxix = 0, CXt_NULL, PERLSI_SORT). So this commit should have no immediate effect. It will in future however allow us to detect whether we have a sort or a true MULTICALL.
* Replace common Emacs file-local variables with dir-localsDagfinn Ilmari Mannsåker2015-03-221-6/+0
| | | | | | | | | | | | | | | | An empty cpan/.dir-locals.el stops Emacs using the core defaults for code imported from CPAN. Committer's work: To keep t/porting/cmp_version.t and t/porting/utils.t happy, $VERSION needed to be incremented in many files, including throughout dist/PathTools. perldelta entry for module updates. Add two Emacs control files to MANIFEST; re-sort MANIFEST. For: RT #124119.
* Unused dVARs found by g++ -DPERL_GLOBAL_STRUCT_PRIVATE.Jarkko Hietaniemi2014-07-241-4/+0
|
* Remove or downgrade unnecessary dVAR.Jarkko Hietaniemi2014-06-251-1/+0
| | | | | | | | You need to configure with g++ *and* -Accflags=-DPERL_GLOBAL_STRUCT or -Accflags=-DPERL_GLOBAL_STRUCT_PRIVATE to see any difference. (g++ does not do the "post-annotation" form of "unused".) The version code has some of these issues, reported upstream.
* Silence -Wunused-parameter my_perl under threads.Jarkko Hietaniemi2014-06-191-0/+2
| | | | | | | | | | | | | | For S_ functions, remove the context. For Perl_ functions, add PERL_UNUSED_CONTEXT. Tricky because sometimes depends on DEBUGGING, and sometimes on whether we are have PERL_IMPLICIT_SYS. (Why all the mathoms Perl_is_uni_... and Perl_is_utf8_... functions are not being whined about is a mystery.) vutil.c (included via util.c) has one of these, but it's cpan/, and a known problem: https://rt.cpan.org/Ticket/Display.html?id=96100
* si_names access one past the end.Jarkko Hietaniemi2014-05-291-1/+3
| | | | Fix for Coverity perl5 CID 45359.
* Omnibus removal of register declarationsKarl Williamson2012-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes most register declarations in C code (and accompanying documentation) in the Perl core. Retained are those in the ext directory, Configure, and those that are associated with assembly language. See: http://stackoverflow.com/questions/314994/whats-a-good-example-of-register-variable-usage-in-c which says, in part: There is no good example of register usage when using modern compilers (read: last 10+ years) because it almost never does any good and can do some bad. When you use register, you are telling the compiler "I know how to optimize my code better than you do" which is almost never the case. One of three things can happen when you use register: The compiler ignores it, this is most likely. In this case the only harm is that you cannot take the address of the variable in the code. The compiler honors your request and as a result the code runs slower. The compiler honors your request and the code runs faster, this is the least likely scenario. Even if one compiler produces better code when you use register, there is no reason to believe another will do the same. If you have some critical code that the compiler is not optimizing well enough your best bet is probably to use assembler for that part anyway but of course do the appropriate profiling to verify the generated code is really a problem first.
* update the editor hints for spaces, not tabsRicardo Signes2012-05-291-2/+2
| | | | | This updates the editor hints in our files for Emacs and vim to request that tabs be inserted as spaces.
* PATCH: Large omnibus patch to clean up the JRRT quotesTom Christiansen2008-11-021-2/+4
| | | | | | Message-ID: <25940.1225611819@chthon> Date: Sun, 02 Nov 2008 01:43:39 -0600 p4raw-id: //depot/perl@34698
* Update copyright years.Nicholas Clark2008-10-251-2/+2
| | | p4raw-id: //depot/perl@34585
* assert() that every NN argument is not NULL. Otherwise we have theNicholas Clark2008-02-121-0/+7
| | | | | | | | | | | | ability to create landmines that will explode under someone in the future when they upgrade their compiler to one with better optimisation. We've already done this at least twice. (Yes, some of the assertions are after code that would already have SEGVd because it already deferences a pointer, but they are put in to make it easier to automate checking that each and every case is covered.) Add a tool, checkARGS_ASSERT.pl, to check that every case is covered. p4raw-id: //depot/perl@33291
* Move retop first in structs block_sub, block_format and block_eval.Nicholas Clark2008-01-201-2/+1
| | | | | This simplifies some code in Perl_deb_stack_all(). p4raw-id: //depot/perl@33016
* Fix up copyright years for files modified in 2007.Nicholas Clark2007-11-071-2/+2
| | | p4raw-id: //depot/perl@32237
* misc blead stuffJarkko Hietaniemi2007-08-301-3/+2
| | | | | Message-ID: <46D617B5.3000002@iki.fi> p4raw-id: //depot/perl@31765
* Display the process id as part of the trace output if running with -DvNicholas Clark2007-01-241-4/+9
| | | | | | (Might be nice to display the thread ID too under ithreads, but I can't see a clean way to get that) p4raw-id: //depot/perl@29960
* g++ stage 1 reachedJarkko Hietaniemi2006-08-081-3/+1
| | | | | Message-ID: <44D7AA6B.4040802@iki.fi> p4raw-id: //depot/perl@28674
* g++ large patchJarkko Hietaniemi2006-08-071-1/+3
| | | | | Message-ID: <44D2E203.5050201@iki.fi> p4raw-id: //depot/perl@28662
* Re: [PATCH] cleanup 212 warnings emitted by gcc-4.2Marcus Holland-Moritz2006-04-261-2/+2
| | | | | Message-ID: <20060424232038.7550f9b6@r2d2> p4raw-id: //depot/perl@27962
* unused context warningsAndy Lester2006-02-241-0/+5
| | | | | Message-ID: <20060221062711.GA16160@petdance.com> p4raw-id: //depot/perl@27300
* More NullXXX macro removal from Andy LesterRafael Garcia-Suarez2006-02-201-4/+2
| | | p4raw-id: //depot/perl@27238
* Trying my "remove the pTHXes" patch againAndy Lester2006-02-091-1/+3
| | | | | Message-ID: <20060209154018.GA14610@petdance.com> p4raw-id: //depot/perl@27136
* Update copyright years (including some years where we made changes butNicholas Clark2006-01-081-1/+1
| | | | | did not update) p4raw-id: //depot/perl@26732
* sprinkle dVARJarkko Hietaniemi2006-01-061-0/+5
| | | | | Message-ID: <43BE7C4D.1010302@gmail.com> p4raw-id: //depot/perl@26675
* More consting, and putting stuff in embed.fncAndy Lester2005-12-061-2/+3
| | | | | Message-ID: <20051205194613.GB7791@petdance.com> p4raw-id: //depot/perl@26281
* Cleaning up some warnings generated by "gcc -W"Steve Peters2005-11-191-0/+11
| | | p4raw-id: //depot/perl@26175
* Consting and localizing: Part LXVIIIAndy Lester2005-11-071-7/+6
| | | | | Message-ID: <20051104211256.GA12651@petdance.com> p4raw-id: //depot/perl@26028
* Post-YAPC consting, now with an attachment!Andy Lester2005-07-041-1/+1
| | | | | Message-ID: <20050703233156.GA20967@petdance.com> p4raw-id: //depot/perl@25067
* Include vim/emacs modelines in generated files to open themRafael Garcia-Suarez2005-05-111-2/+2
| | | | | | in read-only mode. Make vi modelines compatible with non-vim vi versions. p4raw-id: //depot/perl@24445
* Add editor boilerplates to all C filesRafael Garcia-Suarez2005-05-101-1/+9
| | | | | (except the generated ones) p4raw-id: //depot/perl@24440
* Update copyrights.Rafael Garcia-Suarez2005-03-301-1/+1
| | | p4raw-id: //depot/perl@24106
* Third consting batchAndy Lester2005-03-241-8/+3
| | | | | Message-Id: <2f14220e7101a03f7659dbe79a03b115@petdance.com> p4raw-id: //depot/perl@24074
* More consting goodnessAndy Lester2005-03-211-1/+1
| | | | | Message-ID: <20050319072830.GA7721@petdance.com> p4raw-id: //depot/perl@24049
* Add comment to top of reentr.c and fix typos in other filesDave Mitchell2004-08-011-2/+2
| | | p4raw-id: //depot/perl@23180
* Add comment to the top of most .c files explaining their purposeDave Mitchell2004-07-311-0/+5
| | | p4raw-id: //depot/perl@23176
* remove the return stack PL_retstack, and store return ops in the CXDave Mitchell2004-07-231-9/+8
| | | | | structure directly instead p4raw-id: //depot/perl@23156
* Fix up Larry's copyright statements to my best knowledge.Jarkko Hietaniemi2003-04-161-1/+2
| | | | | | | (Lots of Perl 5 source code archaeology was involved.) Larry didn't make strangled noises when I showed him the patch, either :-) p4raw-id: //depot/perl@19242
* Reverse copyright update (#18801) for files not changed in 2003.Hugo van der Sanden2003-03-021-1/+1
| | | p4raw-id: //depot/perl@18807
* Update all copyrights to 2003, from JarkkoHugo van der Sanden2003-03-021-1/+1
| | | p4raw-id: //depot/perl@18801