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

  • Home
  • SEARCH
  • 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 729531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:48:27+00:00 2026-05-14T06:48:27+00:00

I am implementing a breakpoint system for use in my Python development that will

  • 0

I am implementing a “breakpoint” system for use in my Python development that will allow me to call a function that, in essence, calls pdb.set_trace();

Some of the functionality that I would like to implement requires me to control pdb from code while I am within a set_trace context.

Example:

disableList = []
def breakpoint(name=None):
    def d():
        disableList.append(name)
        #****
        #issue 'run' command to pdb so user
        #does not have to type 'c'
        #****

    if name in disableList:
        return

    print "Use d() to disable breakpoint, 'c' to continue"
    pdb.set_trace();

In the above example, how do I implement the comments demarked by the #**** ?

In other parts of this system, I would like to issue an ‘up’ command, or two sequential ‘up’ commands without leaving the pdb session (so the user ends up at a pdb prompt but up two levels on the call stack).

  • 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-14T06:48:27+00:00Added an answer on May 14, 2026 at 6:48 am

    You could invoke lower-level methods to get more control over the debugger:

    def debug():
        import pdb
        import sys
    
        # set up the debugger
        debugger = pdb.Pdb()
        debugger.reset()
    
        # your custom stuff here
        debugger.do_where(None) # run the "where" command
    
        # invoke the interactive debugging prompt
        users_frame = sys._getframe().f_back # frame where the user invoked `debug()`
        debugger.interaction(users_frame, None)
    
    if __name__ == '__main__':
        print 1
        debug()
        print 2
    

    You can find documentation for the pdb module here: http://docs.python.org/library/pdb and for the bdb lower-level debugging interface here: http://docs.python.org/library/bdb. You may also want to look at their source code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 536k
  • Answers 536k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The standard flow is to generate an empty doctrine migrations,… May 17, 2026 at 1:20 am
  • Editorial Team
    Editorial Team added an answer CSS can't do this, the div gets its dimensions from… May 17, 2026 at 1:20 am
  • Editorial Team
    Editorial Team added an answer You want to use WebClient.OpenReadAsync() instead of WebClient.DownloadStringAsync() because you… May 17, 2026 at 1:20 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Im implementing my own proto in Java, it will use a heartbeat over a
I am implementing a MapKit based application. I need a clarification that, it is
I have a COM class CMyCOMServer implementing IMyInterface in one application, both with correct
I have ObservableCollection<Foo> that is bound to an ItemsControl (basically displaying a list). Foo
I'm implementing a program which gets text from various sites and checks which ones
Problem: I am having trouble implementing a recursive image lazy load in all relevant
HI, I have a HyperLink column in a gridview that when clicked should navigate
I am working on an opengl application and implementing a bezier surface in the
while implementing hhtps, is there a way not to show the message Do you
Currently implementing vectorial interface elements on iOS is very peculiar, UIImage advertises support only

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.