(CommandList
  children: [
    (C {(_Dbg_help_add)} {(debug)} 
      {
        (DQ ("debug [SCRIPT]\n") ("\n") ("Set up SCRIPT for debugging. \n") ("\n") 
          ("If SCRIPT is not given, take the script name from the command that is\n") ("about to be executed.")
        )
      }
    )
    (FuncDef
      name: _Dbg_do_debug
      body: 
        (BraceGroup
          children: [
            (C {(_Dbg_shell_new_shell_profile)})
            (C {(typeset)} 
              {(Lit_VarLike "script_cmd=") 
                (BracedVarSub
                  token: <VSub_At "@">
                  suffix_op: 
                    (StringUnary
                      op_id: VTest_ColonHyphen
                      arg_word: {($ VSub_Name "$_Dbg_bash_command")}
                    )
                  spids: [100 104]
                )
              }
            )
            (Sentence
              child: 
                (C {(typeset)} 
                  {(Lit_VarLike "set_Dbg_debug_cmd=") 
                    (DQ ("typeset _Dbg_debug_cmd=") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) 
                      ($ VSub_Name "$script_cmd") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">)
                    )
                  }
                )
              terminator: <Op_Semi ";">
            )
            (AndOr
              children: [
                (DBracket
                  expr: (BoolUnary op_id:BoolUnary_z child:{($ VSub_Name "$BASH")})
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:BASH)
                      op: Equal
                      rhs: {(SQ <bash>)}
                      spids: [141]
                    )
                  ]
                  spids: [141]
                )
              ]
              op_id: Op_DAmp
            )
            (C {(eval)} {(DQ ($ VSub_Name "$_seteglob"))})
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DParen
                          child: (ArithUnary op_id:Arith_Bang child:(ArithVarRef name:_Dbg_script))
                        )
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (Sentence
                      child: 
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:set_Dbg_debug_cmd)
                              op: Equal
                              rhs: 
                                {
                                  (DQ ("typeset _Dbg_debug_cmd=") 
                                    (EscapedLiteralPart
                                      token: <Lit_EscapedChar "\\\"">
                                    ) ($ VSub_Name "$BASH") (" --init-file ") (${ VSub_Name _Dbg_shell_temp_profile) (" --debugger ") 
                                    ($ VSub_Name "$script_cmd") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">)
                                  )
                                }
                              spids: [180]
                            )
                          ]
                          spids: [180]
                        )
                      terminator: <Op_Semi ";">
                    )
                  ]
                  spids: [-1 173]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {($ VSub_Name "$_Dbg_orig_0") (///)}
                              right: {(Lit_Other "*") (bashdb///)}
                            )
                        )
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (Sentence
                      child: 
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:set_Dbg_debug_cmd)
                              op: Equal
                              rhs: 
                                {
                                  (DQ ("typeset _Dbg_debug_cmd=") 
                                    (EscapedLiteralPart
                                      token: <Lit_EscapedChar "\\\"">
                                    ) ($ VSub_Name "$BASH") (" ") ($ VSub_Name "$_Dbg_orig_0") (" -q -L ") ($ VSub_Name "$_Dbg_libdir") (" ") 
                                    ($ VSub_Name "$script_cmd") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">)
                                  )
                                }
                              spids: [219]
                            )
                          ]
                          spids: [219]
                        )
                      terminator: <Op_Semi ";">
                    )
                  ]
                  spids: [196 212]
                )
              ]
              spids: [-1 235]
            )
            (C {(eval)} {(DQ ($ VSub_Name "$_resteglob"))})
            (C {(eval)} {($ VSub_Name "$set_Dbg_debug_cmd")})
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: (DParen child:(ArithVarRef name:_Dbg_set_basename))
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (C {(_Dbg_msg)} {(DQ ("Debugging new script with ") ($ VSub_Name "$script_cmd"))})
                  ]
                  spids: [-1 263]
                )
              ]
              else_action: [
                (C {(_Dbg_msg)} {(DQ ("Debugging new script with ") ($ VSub_Name "$_Dbg_debug_cmd"))})
              ]
              spids: [275 286]
            )
            (C {(typeset)} {(-r)} {(Lit_VarLike "old_quit_on_quit=") ($ VSub_Name "$_Dbg_QUIT_ON_QUIT")})
            (C {(export)} {(Lit_VarLike "_Dbg_QUIT_ON_QUIT=") (1)})
            (C {(export)} 
              {(Lit_VarLike "BASHDB_BASENAME_ONLY=") (DQ ($ VSub_Name "$_Dbg_set_basename"))}
            )
            (DParen
              child: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:_Dbg_DEBUGGER_LEVEL))
            )
            (C {($ VSub_Name "$_Dbg_debug_cmd")})
            (DParen
              child: (UnaryAssign op_id:Node_PostDMinus child:(LhsName name:_Dbg_DEBUGGER_LEVEL))
            )
            (C {(_Dbg_restore_from_nested_shell)})
            (C {(export)} {(Lit_VarLike "_Dbg_QUIT_ON_QUIT=") ($ VSub_Name "$old_quit_on_quit")})
          ]
          spids: [89]
        )
      spids: [85 88]
    )
  ]
)