Commit 9bf1644
committed
A few miscellaneous helpers.
PyObject_Dump(): New function that is useful when debugging Python's C
runtime. In something like gdb it can be a pain to get some useful
information out of PyObject*'s. This function prints the str() of the
object to stderr, along with the object's refcount and hex address.
PyGC_Dump(): Similar to PyObject_Dump() but knows how to cast from the
garbage collector prefix back to the PyObject* structure.
[See Misc/gdbinit for some useful gdb hooks]
none_dealloc(): Rather than SEGV if we accidentally decref None out of
existance, we assign None's and NotImplemented's destructor slot to
this function, which just calls abort().1 parent 9667ed2 commit 9bf1644
1 file changed
Lines changed: 26 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
223 | 236 | | |
224 | 237 | | |
225 | 238 | | |
| |||
1213 | 1226 | | |
1214 | 1227 | | |
1215 | 1228 | | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
1216 | 1240 | | |
1217 | 1241 | | |
1218 | 1242 | | |
1219 | 1243 | | |
1220 | 1244 | | |
1221 | 1245 | | |
1222 | | - | |
| 1246 | + | |
1223 | 1247 | | |
1224 | 1248 | | |
1225 | 1249 | | |
| |||
1250 | 1274 | | |
1251 | 1275 | | |
1252 | 1276 | | |
1253 | | - | |
| 1277 | + | |
1254 | 1278 | | |
1255 | 1279 | | |
1256 | 1280 | | |
| |||
0 commit comments