Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7629223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:46:54+00:00 2026-05-31T05:46:54+00:00

i follow this manual to lean to use the bashdb: http://archive09.linux.com/articles/153383.html#commentthis And when i

  • 0

i follow this manual to lean to use the bashdb:
http://archive09.linux.com/articles/153383.html#commentthis
And when i use the bashdb to bt the script:

#!/bin/bash

version="0.01";

fibonacci() {
    n=${1:?If you want the nth fibonacci number, you must supply n as the first parameter.}
    if [ $n -le 1 ]; then 
    echo $n
    else
    l=`fibonacci $((n-1))`
    r=`fibonacci $((n-2))`
    echo $((l + r))
    fi
}

for i in `seq 1 10`
do
  result=$(fibonacci $i)
  echo "i=$i result=$result"
done

And here is the detail of the debugging:
kaiwii@ubuntu:~/shell_test$ bash –debugger ./fibonacci.sh
bashdb debugger, release 4.2-0.6

Copyright 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010 Rocky Bernstein
This is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.

(/home/kaiwii/shell_test/fibonacci.sh:3):
3:  version="0.01";
bashdb<0> bt
->0 in file `./fibonacci.sh' at line 3
##1 main() called from file `./fibonacci.sh' at line 0
bashdb<1> next
(/home/kaiwii/shell_test/fibonacci.sh:16):
16: for i in `seq 1 10`
bashdb<2> list
 11:        r=`fibonacci $((n-2))`
 12:        echo $((l + r))
 13:        fi
 14:    }
 15:    
 16: => for i in `seq 1 10`
 17:    do
 18:      result=$(fibonacci $i)
 19:      echo "i=$i result=$result"
 20:    done
bashdb<3> next
(/home/kaiwii/shell_test/fibonacci.sh:18):
18:   result=$(fibonacci $i)
bashdb<4> break fibonacci
Breakpoint 1 set in file /home/kaiwii/shell_test/fibonacci.sh, line 5.
bashdb<5> continue
i=1 result=1
i=2 result=1
i=3 result=2
i=4 result=3
i=5 result=5
i=6 result=8
i=7 result=13
i=8 result=21
i=9 result=34
i=10 result=55

And my question is when i use the command,continue after using the command,break fibonacci
,it does stop at the beginning of the method,fibonacci but instead quit the script.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:46:55+00:00Added an answer on May 31, 2026 at 5:46 am

    This is a bug in bashdb (version 4.2-0.8 and below) in the handling of the “break” command.

    The “next” command sets a flag that tells bash to skip over functions and the “break” command isn’t clearing that.

    git sources have the fix, so if you can use that, this is one way to get the fix.

    Another way is to find where bashdb/lib/break.sh is installed (let’s say it is in /usr/share/lib/bashdb/lib/break.sh) and with the patch below saved in /tmp/bashdb.patch

    --- bashdb/lib/break.sh
    +++ bashdb/lib/break.sh
    @@ -218,6 +218,11 @@ _Dbg_set_brkpt() {
         typeset dq_source_file
         dq_source_file=$(_Dbg_esc_dq "$source_file")
         typeset dq_condition=$(_Dbg_esc_dq "$condition")
    +
    +    # Make sure we are not skipping over functions.
    +    _Dbg_old_set_opts="$_Dbg_old_set_opts -o functrace"
    +    _Dbg_write_journal_eval "_Dbg_old_set_opts='$_Dbg_old_set_opts'"
    +
         _Dbg_write_journal_eval "_Dbg_brkpt_line[$_Dbg_brkpt_max]=$lineno"
         _Dbg_write_journal_eval "_Dbg_brkpt_file[$_Dbg_brkpt_max]=\"$dq_source_file\""
         _Dbg_write_journal "_Dbg_brkpt_cond[$_Dbg_brkpt_max]=\"$dq_condition\""
    

    And then run as root:

     # cd /usr/share/lib
     # patch -p0 < /tmp/bashdb.patch
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to include Core Location and I'm trying to follow this tutorial: http://www.mobileorchard.com/hello-there-a-corelocation-tutorial/
I'm trying to follow the instructions here: http://www.php.net/manual/en/features.commandline.usage.php I created a file named vardump
I follow this rule but some of my colleagues disagree with it and argue
I am trying to follow this tutorial on how to connect to a database
I am trying to follow this example (from p137 of Rob Pickering's Foundations of
I tried to follow this but the default modelbinder let my array null on
Trying to follow this example. (Section String sorting...) Is there anything obvious that would
I have a bunch of python methods that follow this pattern: def delete_session(guid): conn
There are a few windows service projects in our codebase that follow this model,
I checked out the three20 source and was trying to follow this guide to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.