[issue41571] Implement thread-related commands in pdb

2022-03-28 Thread Cebtenzzre


Change by Cebtenzzre :


--
nosy: +cebtenzzre

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41571] Implement thread-related commands in pdb

2020-09-09 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +iritkatriel

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41571] Implement thread-related commands in pdb

2020-09-09 Thread Dong-hee Na


Dong-hee Na  added the comment:

I am +1 on this project :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41571] Implement thread-related commands in pdb

2020-09-09 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41571] Implement thread-related commands in pdb

2020-09-06 Thread Bar Harel


Change by Bar Harel :


--
nosy: +bar.harel

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41571] Implement thread-related commands in pdb

2020-08-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Another possibility would be accept the reality of the switching delay (so all 
the other commands work without extra changes) and working to minimize it by 
setting sys.setswitchinterval() to something ridiculously low and then 
switching it back to the previous value once we are in the thread that we want. 
If this is not enough we could sed modify the Gil-adquire code to do something 
similar to what the Python 2 implementation did when signals arrive that is 
basically switch constantly between threads until the one that we want runs.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41571] Implement thread-related commands in pdb

2020-08-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

We may need to think as well how some commands interest when you are in a 
different thread context. For instance, stepping into something when you are in 
a different thread is equivalent to setting a breakpoints in the next thread 
instruction, so this has the same considerations as the breakpoints. We may 
want to disallow this or to emit some warning in this case.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41571] Implement thread-related commands in pdb

2020-08-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

* Displaying all threads is trivial.

* Stopping all threads is trivial because of the GIL. When pdb runs in a thread 
all other threads cannot execute python code. They can execute native code bit 
there is not much we can do about it.

* Switching threads is the interesting one. The easiest way is to set the pdb 
trace function in the target thread and run until they thread executes python 
code. This has the following considerations:

  - All PSB commands will automatically work on that thread once the trace 
function is executed.
  - There will be a delay between the command and the thread being switched. 
This is due to the fact that we do not control what thread will run and we need 
to wait until the thread executes Python code.
  - Switching to a thread that is blocked on something (on a lock or on C code) 
will hang.

For this reason, this method can work only for setting breakpoints on threads, 
not for 'switching threads'. The breakpoint will work because that's the 
expected behaviour: the day and the possibility of not hitting it is justified 
on the nature of the breakpoint.

For switching threads, the best way would be to 'virtually switch threads'. 
This means that somehow we switch internally to the thread stack but we keep 
executing on the main thread, we merely switch our internal context.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41571] Implement thread-related commands in pdb

2020-08-17 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
Removed message: https://bugs.python.org/msg375580

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41571] Implement thread-related commands in pdb

2020-08-17 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
title: Allow pdb to switch to a different thread -> Implement thread-related 
commands in pdb

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41571] Implement thread-related commands in pdb

2020-08-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I will start preparing some pull requests unless someone has any concerns about 
this

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com