add some cpython debugging methods (#138030)
Summary:
This PR enables you to inspect PyObjects in C using `INSPECT(...)` without requiring https://docs.python.org/3/howto/gdb_helpers.html. `torch._dynamo.eval_frame.raise_sigtrap` can also be used to set gdb breakpoints while running Python code, e.g.
```python
x = x + 1
torch._dynamo.eval_frame.raise_sigtrap();
# can breakpoint on ceval.c:CALL to breakpoint the `sin` call in C.
x = torch.sin(x)
```
X-link: https://github.com/pytorch/pytorch/pull/138030
Approved by: https://github.com/jansel
Reviewed By: huydhn
Differential Revision: D65104659
Pulled By: williamwen42
fbshipit-source-id: aa2f3f9c34a1ee15160ccc82bf61c740b3ac6d20