902 questions
0
votes
0
answers
41
views
How to keep an add on Python debugger function to stay in scope
After trying Lavi Kumar's example it seems the package import pdbext.debug in ~/.pdbrc goes out of scope when another source file is called.
~/.pdbrc:
!import pdbext.debug
alias pl !pdbext.debug....
0
votes
2
answers
108
views
More parsing-friendly Python debugger locals() output [closed]
I need the locals() text output to be easier to parse then what the default output is. I am using a IDE that I wrote in C that starts a tty() to run pdb and it captures the output from locals() and ...
0
votes
0
answers
87
views
How do I print to application output window when debugging python in Qt Creator IDE?
I'm debugging a python project (pyproject) in Qt Creator using built-in debugger.
Python print() outputs only to Debugger Log window, where it's mixed with a lot of actual debugger output making it ...
0
votes
0
answers
80
views
Autocomplete pdb and .venv
I have the following file 'test.py'
#!/usr/bin/env python3
if __name__ == '__main__':
test: str = "This is a test"
breakpoint()
print(test)
When executing this (no venv) auto-...
2
votes
1
answer
126
views
Limit number of stack levels shown
In Python pdb, can I limit number of stack levels shown by "where", around my current position in the stack?
In my specific use case, I want to investigate an maximum recursion problem, ...
0
votes
1
answer
53
views
How to automatically print a variable in pdb?
I am debugging a code in Python using Pdb:
a = [12, 3, 4, 10, 23, 1]
def compute(x):
return 2 * x
for i in a:
b = compute(i)
To trace the value of a variable inside the loop, I set a ...
0
votes
0
answers
92
views
Getting RVA address without PDB
I am building C++ project using msvc, with /Debug option to enable pdb generation.
What I want to do, is being able to recover the full callstack, without providing the pdbs in production environment.
...
3
votes
2
answers
575
views
Running pdb on python uv single file scripts?
So the new hotness for scripts on your path in python is to use uv to create single file scripts.
These look like this:
#!/usr/bin/env -S uv run --script
# -*- mode: python -*-
# /// script
# ...
0
votes
1
answer
66
views
Is it possible to trace a line after it's executed in Python?
sys.settrace and Bdb.trace_dispatch can trace events. But the "line" event is triggered before the execution of the line.
I'm trying to get information exactly after the line being executed, ...
0
votes
1
answer
50
views
updating python code in the middle of debugging
I often have to debug the python code by pdb debugger. It happens that it fails due to program errors that should be corrected. The problem is that I have to update the python code and restart the ...
0
votes
0
answers
63
views
How do I enter into a function in Python Breakpoint in the terminal?
How do I enter into a function in Python Breakpoint in the terminal? I am trying to enter into a function that I called with my code but in the terminal, PDB just goes through it, like this:
-> def ...
0
votes
0
answers
40
views
Obtain line number from IL offset using pdb with obfuscated binary
I have a .NET 4.8 WPF application that is obfuscated using Confuser. Confuser generates a new pdb that correctly maps the IL offsets in the obfuscated code to the corresponding original line numbers ...
0
votes
0
answers
71
views
Detecting if Python code is run under Visual Studio Code (or other) Python debugger
I have Python and Pandas code which does complex Pandas series calculations for thousands of series and runs these calculations parallel for speedup using multiprocessing.
It seems Visual Studio Code ...
0
votes
0
answers
53
views
py3.13 pdb argparse fails
> rpm -qi python3 Name
python3 Version : 3.13.1
Release : 2.fc41
Architecture: x86_64
Source RPM : python3.13-3.13.1-2.fc41.src.rpm
Build Date : Tue 10 Dec 2024 10:31:11 GMT
In here ...
0
votes
0
answers
4k
views
NameError: name 'xxx' is not defined nor importable as module ** PDB_DEBUGGER
When I'm trying to use pdb debugger for robot framework script Im trying to print the variables however it is impossible for me. I constantly get
NameError: name 'l' is not defined nor importable as ...
1
vote
0
answers
135
views
'n' vs 's' command for Python debugger (pdb)
I'm new to pdb and trying to learn. There is one thing that's bugging me a lot. Lot of examples that I read on blogs mention a code like this below:
import pdb
def buggy_function(x):
result = 0
...
1
vote
0
answers
42
views
Why won't the Python debugger invoked as a module automaticaly enter into post-mortem debugging?
Accordig to Python's official documentation at pdb:
You can also invoke pdb from the command line to debug other scripts. For example:
python -m pdb myscript.py
When invoked as a module, pdb will ...
0
votes
0
answers
33
views
Why is Pdb going into interactive shell code?
I want to jump to download_url function to see its implementation and skip seeing all the stuff in between, how to achieve that? I tried using s and n commands, but it doesn't take you to download_url ...
0
votes
1
answer
21
views
Inside pdb just before executing a Python script, can you set up your own sys.audit() hook?
Just before running a Python script inside pdb (using python -m pdb), I tried to add a handler for sys.audit() calls:
interact ← puts pdb into interactive Python mode
import sys
def myaudit(event, ...
0
votes
0
answers
333
views
Setting breakpoint() in pytest breaks within called functions rather than test function itself
When I set a breakpoint in my pytest test functions, it seems to be debugging within the functions called by test rather than the test itself:
def test_my_function():
test_value = np.random.choice(...
4
votes
3
answers
250
views
How can I ignore a specific breakpoint interactively?
Consider this script:
print("before loop")
for i in range(100):
breakpoint()
print("after loop")
breakpoint()
print("exit")
Short of pressing "c" one ...
1
vote
5
answers
489
views
Is it possible to change the return value of a function with pdb?
Let's say I have the following code :
def returns_false():
breakpoint()
return False
assert(returns_false())
print("Hello world")
Is there a sequence of pdb commands that will print &...
1
vote
0
answers
311
views
ORACLE OCI cloning PDB issues
Basically, I am performing a local clone (to the same CDB) of a very large PDB, approximately 12 terabytes, which is on OCI Oracle 19c, and I used the following command to perform the cloning:
CREATE ...
0
votes
1
answer
62
views
Python debugger convenience variable throws syntax error
I read in the Pdb documentation that
To set a temporary global variable, use a convenience variable. A convenience variable is a variable whose name starts with $. For example, $foo = 1 sets a global ...
0
votes
1
answer
52
views
A weird issue (to me) with converting the dict values to a list in python (debugger) [duplicate]
I am not sure I can explain the issue better than a screenshot. Either I am severely underslept or I have lost it (or, both)
chunks is a list of dict. I am able to run len(list(chunks[0].values())) ...
5
votes
1
answer
666
views
Can't use ipdb: WARNING: your terminal doesn't support cursor position requests (CPR)
I have ipdb.set_trace() in my python code. When running the python script, I get the ipdb shell, but it throws the warning:
WARNING: your terminal doesn't support cursor position requests (CPR)
...
1
vote
0
answers
110
views
Why does breakpoint() not work in jupyter lab?
Title says it all, I'm running jupyterlab with what should be default settings & the python builtin breakpoint() does nothing... It works fine in ipython/python though. Am I missing something?
1
vote
0
answers
238
views
How to make VCPKG copies dependencies pdb files in output directory
I have multiple "internal" library which I'm trying to manage with vcpkg+cmake.
Generally speaking everything is working properly.
I have only one minor issue which I can't solve.
When ...
1
vote
1
answer
142
views
Adding breakpoint in pdb results with "End of file"?
I'm so tired of this ...
Well, pdb: set a breakpoint on file which isn't in sys.path says:
According to this answer you can also set a break point by writing the full path to filename
And I've ...
0
votes
0
answers
35
views
Why does PDB incorrectly report location of exceptions?
I've run into this problem countless times and I've tried to just overlook it but it's infuriating. About 25% of the time that I use the python debugger (usually on the command line, haven't tested ...
1
vote
1
answer
672
views
Debugging embedded Python code in .Net app using Pythonnet and Pdb
I have a worker service in which I need to debug Python code. To execute Python code I need to use Pythonnet. Pdb module is used for debugging.
I'm trying something like that:
python.txt:
import pdb
...
0
votes
1
answer
74
views
How to access upstream functions called by a function in Python
To debug a warning observed in my code, Im trying to find a way to programmatically identify the stack of functions being called by my code.
As an example
def func(x):
return func2(x+4)
def func2(...
0
votes
1
answer
118
views
How can I fix JupyterNotebook not printing my outputs when dealing with a large number of files?
I noticed that sometimes JupyterNotebook doesn't print any of my outputs when I have code that iterates over a large number of PDB files. The code runs fine and will output what I need in my directory,...
1
vote
1
answer
241
views
What's virtual operator new/delete?
Recently, I disassembled some DLL&PDB with llvm-pdbutil pretty --classes. But I don't have the source codes for this DLL.
In the output, I found some expressions in class body, mainly declarations ...
2
votes
1
answer
123
views
Why is pdb showing Blank line or comment, but there is a line?
I'm trying to interactively run pdb on a remote system I don't own (I'm not sure if that's relevant), and it's behaving a bit differently than I expect. Listing the source shows there is clearly a ...
0
votes
1
answer
286
views
Python Debugger (PDB): open currently active python file in editor
Is there some way to get during debugging with pdb:
currently opened python file
currently active line of code
indent on the current line of code
and open the file in default text editor?
Example. ...
0
votes
0
answers
24
views
Detect if a python pdb process is in break or waiting state
In Unix OS, is it possible to detect if a python program running in pdb, is in "break" or "waiting" state, given the process ID?
I would like to detect that from outside the python ...
0
votes
2
answers
1k
views
Remote OS authentication does not work with Oracle 21c PDB
I have a problem with Oracle 21c PDB connection. I have created an OS user which should be able to login to the Pluggable Database with...
sqlplus /
...command. However it does not work on the way ...
1
vote
1
answer
302
views
PDB won't stop inside pytest code, will stop in first function call
If I define a pytest test like so:
from my_app.main import some_function
def test_example():
breakpoint()
foo = 'bar'
some_function()
Then pdf will stop at the beginning of some_function ...
0
votes
0
answers
347
views
Find the function by offset in the DLL (and PDB)
An error occurred in the self-written DLL:
SE EXCEPTION_ACCESS_VIOLATION at address 0x54E258BB inside C:\Program Files (x86)\...\...\...\lib.dll loaded at base address 0x54D80000. Invalid operation: ...
1
vote
1
answer
5k
views
How to remove Oracle database PDB RESTRICTION
HI I am facing Database problems with PDB I checked the PDB ORC1PDB is RESTRICTED ...
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------...
0
votes
1
answer
101
views
How to make display in pdb to work like display in gdb?
I'm learning to program and I've just switched to problem sets using Python language. Previously, I learned to write some small C programs. So when I debugged C programs, I used gdb and the display ...
1
vote
0
answers
86
views
How can I repeatedly list code around the current line with pdb?
The l command for pdb is documented like so:
l: List source code for the current file. Without arguments, list 11 lines around the current line or continue the previous listing.
I often use this ...
1
vote
0
answers
83
views
How to determine a python process with pdb whether running or waiting for stdin?
I am trying to obtain the running state (such as variable dumps) of a Python program named A. Currently, I have created a debug script that spawns a Pdb subprocess to debug A and control it by sending ...
0
votes
1
answer
289
views
How to break in python when a warning is risen?
In python I'm getting difficult to debug warnings. I'd like to have the debugger break when one of these warnings happen, so I can poke arround the variables.
However I don't want to turn them into ...
0
votes
2
answers
649
views
How to compare two pdb files and validate if the source code matches?
I want to validate if there is source code difference occurred between two builds with help of .pdb files generated from Build1 and Build2.
Little Background :
I am using Visual Studio 2019 and My ...
3
votes
1
answer
817
views
Bond Type of ligands in PDB files all appear as SINGLE
I am learning rdkit. At the moment I want to extract info from the ligand docked in the protein. The problem I face is that the bonds from the ligand are always returned as SINGLE, no matter there ...
-3
votes
1
answer
200
views
awk - how to add one line "TER" in .pdb file
This is my fragment .pdb file:
ATOM 73 HG1 GLU 4 77.769 51.123 52.300 1.00 0.00 H
ATOM 74 HG2 GLU 4 78.465 52.119 52.349 1.00 0.00 H
ATOM 75 ...
1
vote
0
answers
39
views
pdb enter repeats last command of alias not the alias itself
I defined an alias in .pdbrc file as:
# Next and list, and step and list.
alias nl n;;l
alias sl s;;l
This works fine. But say when I press enter after nl it runs the last command of the alias which ...
0
votes
1
answer
138
views
Python breakpoint() automatically reads all STDIN -- how to disable it?
Here is a sample python script.
import sys
print("Hello, world!")
for i, line in enumerate(sys.stdin):
print(line)
print(f"Before breakpoint: {i}")
breakpoint()
...