GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add argument checking on pdb commands · Issue #103464 · python/cpython

Add argument checking on pdb commands #103464

New issue
Copy link
New issue
Copy link
Closed
Closed
Add argument checking on pdb commands#103464
Copy link
Labels
type-featureA feature request or enhancementA feature request or enhancement

Description

@gaogaotiantian
gaogaotiantian
opened on Apr 12, 2023
Issue body actions

Feature or enhancement

Add some argument checking on pdb commands so it is not ignored silently

Pitch

Currently for some pdb commands, we simply throw out provided arguments and proceed. This could confuse users. A super common case that I had (more than a few times) was this:

(Pdb) a = 1
(Pdb) 

Guess what it does? It lists all the arguments to the function(which was empty). The command succeeded (in a way the user would never expect) without any kind of warning.

Similar thing for step or next, which does not take any argument. gdb and some other debuggers provide a count for such commands, so people might do

(Pdb) step 3

And pdb just does a step. Normally the user would expect it does something different than step, but that's not the case. Of course it has the similar issue when the user does s = "abc" - surprise! the code goes forward!

We should catch these cases (and it's pretty cheap) and let the users know it's not the correct way to use the command (or for most cases, let them know that this IS actually a command).

So we could have something like:

(Pdb) a = 1
*** Invalid argument: = 1
      Usage: a(rgs)
(Pdb) step 3
*** Invalid argument: 3
      Usage: s(tep)
(Pdb) 

Linked PRs

  • gh-103464: Add checks for arguments of pdb commands #103465

Activity

  1. gaogaotiantian
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Apr 12, 2023
  2. brandtbucher
    added a commit that references this issue on May 31, 2023

    gh-103464: Add checks for arguments of pdb commands (GH-103465)

    d944d87
  3. brandtbucher
    closed this as completedon May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.