Skip to content

python3 support #37

@xman1979

Description

@xman1979

I made a small change to compile this with python 3.10, e.g:

diff --git a/python.tcc b/python.tcc
index 809f00c..d9064aa 100644
--- a/python.tcc
+++ b/python.tcc
@@ -10,10 +10,10 @@ namespace pstack {
 template<int PyV> int
 getLine(const Reader &proc, const PyCodeObject *code, const PyFrameObject *frame)
 {
-    auto lnotab = readPyObj<PyV, PyVarObject>(proc, Elf::Addr(code->co_lnotab));
+    auto lnotab = readPyObj<PyV, PyVarObject>(proc, Elf::Addr(code->co_linetable));
 
     unsigned char linedata[lnotab.ob_size];
-    proc.readObj(Elf::Addr(code->co_lnotab) + offsetof(PyBytesObject, ob_sval),
+    proc.readObj(Elf::Addr(code->co_linetable) + offsetof(PyBytesObject, ob_sval),
             &linedata[0], lnotab.ob_size);
     int line = code->co_firstlineno;
     int addr = 0;

however, I could not get -p working, I hit error with:

./pstack -pal 2528902
trace of 2528902 failed: Couldn't find a Python interpreter

may I know what is wrong here? up to which python version pstack supports?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions