Skip to content

Debugger aliases that start with '-' no longer work #17723

@jkahrman

Description

@jkahrman

Module: Perl Debugger

Description
We have the following debugger aliases:

  DB<13> =
-BF	= p 'STOP on fail='.(\$main::test->break_on_failure(0))
-BS	= p 'STOP on test='.(\$main::test->break_before_test(0))
BF	= p 'STOP on fail='.(\$main::test->break_on_failure(1))
BS	= p 'STOP on test='.(\$main::test->break_before_test(1))

As of Perl 5.30.1, the aliases that start with '-' no longer work. I believe I traced the change in behavior to 7fdd4f0 by @Smylers

Steps to Reproduce
Create a debugger alias that starts with a '-'

  DB<2> = -foo p bar
-foo	= p bar

Expected behavior
The alias can be executed successfully

  DB<3> -foo
bar

Perl configuration

 Summary of my perl5 (revision 5 version 30 subversion 1) configuration:
   
  Platform:
    osname=linux
    osvers=3.2.0-4-amd64
    archname=x86_64-linux-thread-multi
    uname='linux hostname 3.2.0-4-amd64 #1 smp debian 3.2.54-2 x86_64 gnulinux '
    config_args='-A define:cc=$root/gcc-4.7.2/bin/gcc -A define:ccflags=-O2 -pipe -pthread -fPIC  -A define:ld=$root/gcc-4.7.2/bin/gcc -shared  -A define:ldflags=-pthread -A define:lddlflags=-pthread -Dprefix=$root/perl/perl-5.30.1-mw-004 -Dusethreads -Duserelocatableinc -des -Udefault_inc_excludes_dot'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=define
    usemultiplicity=define
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=undef
    bincompat5005=undef
  Compiler:
    cc='$root/gcc-4.7.2/bin/gcc'
    ccflags ='-D_REENTRANT -D_GNU_SOURCE -O2 -pipe -pthread -fPIC -fwrapv -fno-strict-aliasing -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2'
    optimize='-O2'
    cppflags='-D_REENTRANT -D_GNU_SOURCE -O2 -pipe -pthread -fPIC -fwrapv -fno-strict-aliasing -fstack-protector -I/usr/local/include'
    ccversion=''
    gccversion='4.7.2'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='$root/gcc-4.7.2/bin/gcc -shared '
    ldflags ='-pthread -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib $root/gcc-4.7.2/lib $root/gcc-4.7.2/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib
    libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.13.so
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version='2.13'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E'
    cccdlflags='-fPIC'
    lddlflags='-pthread -L/usr/local/lib -fstack-protector'


Characteristics of this binary (from libperl): 
  Compile-time options:
    HAS_TIMES
    MULTIPLICITY
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_IMPLICIT_CONTEXT
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    USE_64_BIT_ALL
    USE_64_BIT_INT
    USE_ITHREADS
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
    USE_REENTRANT_API
    USE_THREAD_SAFE_LOCALE
  Built under linux
  Compiled at Mar  2 2020 17:25:18
  @INC:
    $root/perl/perl-5.30.1-mw-004/lib/site_perl/5.30.1/x86_64-linux-thread-multi
    $root/perl/perl-5.30.1-mw-004/lib/site_perl/5.30.1
    $root/perl/perl-5.30.1-mw-004/lib/5.30.1/x86_64-linux-thread-multi
    $root/perl/perl-5.30.1-mw-004/lib/5.30.1
    .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions