{
    "content": [
        {
            "type": "text",
            "text": "# bdb (pydoc)\n\n**Summary:** bdb - Debugger basics\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **MODULE REFERENCE** (8 lines)\n- **CLASSES** (6 lines) — 3 subsections\n  - class Bdb (231 lines)\n  - class BdbQuit (69 lines)\n  - class Breakpoint (74 lines)\n- **DATA** (2 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\nbdb - Debugger basics\n\n### MODULE REFERENCE\n\nhttps://docs.python.org/3.10/library/bdb.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n\n### CLASSES\n\nbuiltins.Exception(builtins.BaseException)\nBdbQuit\nbuiltins.object\nBdb\nBreakpoint\n\n#### class Bdb\n\n|  Bdb(skip=None)\n|\n|  Generic Python debugger base class.\n|\n|  This class takes care of details of the trace facility;\n|  a derived class should implement user interaction.\n|  The standard debugger class (pdb.Pdb) is an example.\n|\n|  The optional skip argument must be an iterable of glob-style\n|  module name patterns.  The debugger will not step into frames\n|  that originate in a module that matches one of these patterns.\n|  Whether a frame is considered to originate in a certain module\n|  is determined by the name in the frame globals.\n|\n|  Methods defined here:\n|\n|  init(self, skip=None)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  breakanywhere(self, frame)\n|      Return True if there is any breakpoint for frame's filename.\n|\n|  breakhere(self, frame)\n|      Return True if there is an effective breakpoint for this line.\n|\n|      Check for line or function breakpoint and if in effect.\n|      Delete temporary breakpoints if effective() says to.\n|\n|  canonic(self, filename)\n|      Return canonical form of filename.\n|\n|      For real filenames, the canonical form is a case-normalized (on\n|      case insensitive filesystems) absolute path.  'Filenames' with\n|      angle brackets, such as \"<stdin>\", generated in interactive\n|      mode, are returned unchanged.\n|\n|  clearallbreaks(self)\n|      Delete all existing breakpoints.\n|\n|      If none were set, return an error message.\n|\n|  clearallfilebreaks(self, filename)\n|      Delete all breakpoints in filename.\n|\n|      If none were set, return an error message.\n|\n|  clearbpbynumber(self, arg)\n|      Delete a breakpoint by its index in Breakpoint.bpbynumber.\n|\n|      If arg is invalid, return an error message.\n|\n|  clearbreak(self, filename, lineno)\n|      Delete breakpoints for filename:lineno.\n|\n|      If no breakpoints were set, return an error message.\n|\n|  dispatchcall(self, frame, arg)\n|      Invoke user function and return trace function for call event.\n|\n|      If the debugger stops on this function call, invoke\n|      self.usercall(). Raise BdbQuit if self.quitting is set.\n|      Return self.tracedispatch to continue tracing in this scope.\n|\n|  dispatchexception(self, frame, arg)\n|      Invoke user function and return trace function for exception event.\n|\n|      If the debugger stops on this exception, invoke\n|      self.userexception(). Raise BdbQuit if self.quitting is set.\n|      Return self.tracedispatch to continue tracing in this scope.\n|\n|  dispatchline(self, frame)\n|      Invoke user function and return trace function for line event.\n|\n|      If the debugger stops on the current line, invoke\n|      self.userline(). Raise BdbQuit if self.quitting is set.\n|      Return self.tracedispatch to continue tracing in this scope.\n|\n|  dispatchreturn(self, frame, arg)\n|      Invoke user function and return trace function for return event.\n|\n|      If the debugger stops on this function return, invoke\n|      self.userreturn(). Raise BdbQuit if self.quitting is set.\n|      Return self.tracedispatch to continue tracing in this scope.\n|\n|  doclear(self, arg)\n|      Remove temporary breakpoint.\n|\n|      Must implement in derived classes or get NotImplementedError.\n|\n|  formatstackentry(self, framelineno, lprefix=': ')\n|      Return a string with information about a stack entry.\n|\n|      The stack entry framelineno is a (frame, lineno) tuple.  The\n|      return string contains the canonical filename, the function name\n|      or '<lambda>', the input arguments, the return value, and the\n|      line of code (if it exists).\n|\n|  getallbreaks(self)\n|      Return all breakpoints that are set.\n|\n|  getbpbynumber(self, arg)\n|      Return a breakpoint by its index in Breakpoint.bybpnumber.\n|\n|      For invalid arg values or if the breakpoint doesn't exist,\n|      raise a ValueError.\n|\n|  getbreak(self, filename, lineno)\n|      Return True if there is a breakpoint for filename:lineno.\n|\n|  getbreaks(self, filename, lineno)\n|      Return all breakpoints for filename:lineno.\n|\n|      If no breakpoints are set, return an empty list.\n|\n|  getfilebreaks(self, filename)\n|      Return all lines with breakpoints for filename.\n|\n|      If no breakpoints are set, return an empty list.\n|\n|  getstack(self, f, t)\n|      Return a list of (frame, lineno) in a stack trace and a size.\n|\n|      List starts with original calling frame, if there is one.\n|      Size may be number of frames above or below f.\n|\n|  isskippedmodule(self, modulename)\n|      Return True if modulename matches any skip pattern.\n|\n|  reset(self)\n|      Set values of attributes as ready to start debugging.\n|\n|  run(self, cmd, globals=None, locals=None)\n|      Debug a statement executed via the exec() function.\n|\n|      globals defaults to main.dict; locals defaults to globals.\n|\n|  runcall(self, func, /, *args, kwds)\n|      Debug a single function call.\n|\n|      Return the result of the function call.\n|\n|  runctx(self, cmd, globals, locals)\n|      For backwards-compatibility.  Defers to run().\n|\n|  runeval(self, expr, globals=None, locals=None)\n|      Debug an expression executed via the eval() function.\n|\n|      globals defaults to main.dict; locals defaults to globals.\n|\n|  setbreak(self, filename, lineno, temporary=False, cond=None, funcname=None)\n|      Set a new breakpoint for filename:lineno.\n|\n|      If lineno doesn't exist for the filename, return an error message.\n|      The filename should be in canonical form.\n|\n|  setcontinue(self)\n|      Stop only at breakpoints or when finished.\n|\n|      If there are no breakpoints, set the system trace function to None.\n|\n|  setnext(self, frame)\n|      Stop on the next line in or below the given frame.\n|\n|  setquit(self)\n|      Set quitting attribute to True.\n|\n|      Raises BdbQuit exception in the next call to a dispatch*() method.\n|\n|  setreturn(self, frame)\n|      Stop when returning from the given frame.\n|\n|  setstep(self)\n|      Stop after one line of code.\n|\n|  settrace(self, frame=None)\n|      Start debugging from frame.\n|\n|      If frame is not specified, debugging starts from caller's frame.\n|\n|  setuntil(self, frame, lineno=None)\n|      Stop when the line with the lineno greater than the current one is\n|      reached or when returning from current frame.\n|\n|  stophere(self, frame)\n|      Return True if frame is below the starting frame in the stack.\n|\n|  tracedispatch(self, frame, event, arg)\n|      Dispatch a trace function for debugged frames based on the event.\n|\n|      This function is installed as the trace function for debugged\n|      frames. Its return value is the new trace function, which is\n|      usually itself. The default implementation decides how to\n|      dispatch a frame, depending on the type of event (passed in as a\n|      string) that is about to be executed.\n|\n|      The event can be one of the following:\n|          line: A new line of code is going to be executed.\n|          call: A function is about to be called or another code block\n|                is entered.\n|          return: A function or other code block is about to return.\n|          exception: An exception has occurred.\n|          ccall: A C function is about to be called.\n|          creturn: A C function has returned.\n|          cexception: A C function has raised an exception.\n|\n|      For the Python events, specialized functions (see the dispatch*()\n|      methods) are called.  For the C events, no action is taken.\n|\n|      The arg parameter depends on the previous event.\n|\n|  usercall(self, frame, argumentlist)\n|      Called if we might stop in a function.\n|\n|  userexception(self, frame, excinfo)\n|      Called when we stop on an exception.\n|\n|  userline(self, frame)\n|      Called when we stop or break at a line.\n|\n|  userreturn(self, frame, returnvalue)\n|      Called when a return trap is set here.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n\n#### class BdbQuit\n\n|  Exception to give up completely.\n|\n|  Method resolution order:\n|      BdbQuit\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class Breakpoint\n\n|  Breakpoint(file, line, temporary=False, cond=None, funcname=None)\n|\n|  Breakpoint class.\n|\n|  Implements temporary breakpoints, ignore counts, disabling and\n|  (re)-enabling, and conditionals.\n|\n|  Breakpoints are indexed by number through bpbynumber and by\n|  the (file, line) tuple using bplist.  The former points to a\n|  single instance of class Breakpoint.  The latter points to a\n|  list of such instances since there may be more than one\n|  breakpoint per line.\n|\n|  When creating a breakpoint, its associated filename should be\n|  in canonical form.  If funcname is defined, a breakpoint hit will be\n|  counted when the first line of that function is executed.  A\n|  conditional breakpoint always counts a hit.\n|\n|  Methods defined here:\n|\n|  init(self, file, line, temporary=False, cond=None, funcname=None)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  str(self)\n|      Return a condensed description of the breakpoint.\n|\n|  bpformat(self)\n|      Return a string with information about the breakpoint.\n|\n|      The information includes the breakpoint number, temporary\n|      status, file:line position, break condition, number of times to\n|      ignore, and number of times hit.\n|\n|  bpprint(self, out=None)\n|      Print the output of bpformat().\n|\n|      The optional out argument directs where the output is sent\n|      and defaults to standard output.\n|\n|  deleteMe(self)\n|      Delete the breakpoint from the list associated to a file:line.\n|\n|      If it is the last breakpoint in that position, it also deletes\n|      the entry for the file:line.\n|\n|  disable(self)\n|      Mark the breakpoint as disabled.\n|\n|  enable(self)\n|      Mark the breakpoint as enabled.\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  clearBreakpoints()\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  bpbynumber = [None]\n|\n|  bplist = {}\n|\n|  next = 1\n\n### DATA\n\nall = ['BdbQuit', 'Bdb', 'Breakpoint']\n\n### FILE\n\n/usr/lib/python3.10/bdb.py\n\n"
        }
    ],
    "structuredContent": {
        "command": "bdb",
        "section": "",
        "mode": "pydoc",
        "summary": "bdb - Debugger basics",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "MODULE REFERENCE",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 6,
                "subsections": [
                    {
                        "name": "class Bdb",
                        "lines": 231
                    },
                    {
                        "name": "class BdbQuit",
                        "lines": 69
                    },
                    {
                        "name": "class Breakpoint",
                        "lines": 74
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}