'is it possible to dump pyc with gdb on a cython binary

I have a script compiled using cython,with command :

from Cython.Build.BuildExecutable import build
build('file.py')

The file type is.

file: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /system/bin/linker64, with debug_info, not stripped

I found this tutorial and tried with the my file ,but it doesn't work.. https://gist.github.com/stecman/3751ac494795164efa82a683130cabe5

When I try it's like this

❯ gdb ./tes
GNU gdb (GDB) 10.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-linux-android".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./tes...
(gdb) catch load
Catchpoint 1 (load)
(gdb) run
Starting program: /data/data/com.termux/files/home/tes
warning: Unable to determine the number of hardware watchpoints available.
warning: Unable to determine the number of hardware breakpoints available.
warning: .dynamic section for "/data/data/com.termux/files/home/tes" is not at the expected address (wrong library or version mismatch?)

Catchpoint 1
  Inferior loaded /data/data/com.termux/files/home/tes
0x0000007fb7ed3524 in __dl_rtld_db_dlactivity () from /system/bin/linker64
(gdb) continue
Continuing.

Catchpoint 1
  Inferior loaded /data/data/com.termux/files/usr/lib/libtermux-exec.so
0x0000007fb7ed3524 in __dl_rtld_db_dlactivity () from /system/bin/linker64
(gdb) break PyEval_EvalCode
Function "PyEval_EvalCode" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n

Why? is it really possible to get pyc from python application or not? I need an explanation on this and a lesson To use gdb properly and fully.

Thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source