Menu

problem stepping over sub-program

Help
peter
2008-09-03
2012-12-10
  • peter

    peter - 2008-09-03

    Imagine two bash programs: program1 and program2.  Program1 invokes program2, like the following

    program1:
    -------------------------------
    echo "calling program2"
    ./program2
    echo "back from program2"

    program2:
    -------------------------------------
    echo "hello from program2"
    echo "hello again from program2"

    Now if you run program1 under bashdb: bashdb program1, and try to step *over* the lines using the "next" command, you will actually step *into* program2.

    This problem disappears if you add #!/bin/bash to program2.    Is this a bug?

     
    • peter

      peter - 2008-09-03

      BTW I am running Bourne-Again Shell Debugger, release bash-3.1-0.09 on centos-5.2

       
    • Rocky Bernstein

      Rocky Bernstein - 2008-09-04

      If there is a bug, then it's a bash bug, in which case you would use bashbug to report it. However I'm not certain that is the case.

      What I do believe however is that (for reasons that are a mystery to me), when I run this bashdb-main.inc is getting called again, from what appears to be bash reinitializing itself for running program2.

       

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.