Menu

bash --debugger not working?

Help
peter
2008-08-13
2012-12-10
  • peter

    peter - 2008-08-13

    I am running bashdb 3.1.0.8 and bash 3.2.  When I do
    bash --debugger -c 'echo hello; hello world'
    I see the command is run to completion without stopping.

    I tested "bash --debug script" on a bash script and the same thing happened (the script ran to the end without stopping), while running "bashdb myscript" I got the expected behavior: bashdb stops at the first line waiting for my input.  How do I get the same behavior using bash --debug?  My script uses $0 so that is why I prefer to use bash --debugger.  thanks.

     
    • Rocky Bernstein

      Rocky Bernstein - 2008-08-14

      The most likely cause of the problem is that
      bash can't find the debugger files. To see if this is what is happening.
      See where bash thinks the debugger file is located:

        $ strings /bin/bash | grep bashdb-main.inc
        /usr/local/share/bashdb/bashdb-main.inc

      Then make sure that file (usually a symbolic link) is pointing to the
      right place:

        $ head /usr/local/share/bashdb/bashdb-main.inc

      bashdb is a bit fragile. I tried the form
        bash --debugger -c ...

      in current CVS sources and that is broken. But giving a script
      shouldn't be. It will probably be fixed by the next release.

      The next release will also have a routine to set $0 via a built-in
      command. So that should give another way to deal with this.

       
      • peter

        peter - 2008-08-15

        Just tried the commands you suggested:
        $ strings /bin/bash | grep bashdb-main.inc
        /usr/local/share/bashdb/bashdb-main.inc

        $ ls -l /usr/local/share/bashdb
        ls: cannot access /usr/local/share/bashdb: No such file or directory

        So it seems like the that is the cause of the problem.  Then I found this page
        http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=403304

        I followed the suggestion but with minor modifications:

        mkdir /usr/loca/share/bashdb
        ln -s /usr/share/bashdb/dbg-main.inc /usr/local/share/bashdb/bashdb-main.inc

        and the problem was solved.

        Thanks for your help!

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.