Skip to content

Commit 7f15501

Browse files
committed
Remove an unused function
This function is exposed by our extension module, but never used by any of our Python modules. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
1 parent 5e2a46e commit 7f15501

2 files changed

Lines changed: 0 additions & 20 deletions

File tree

src/pystack/_pystack.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def get_process_threads_for_core(
8282
method: StackMethod = StackMethod.AUTO,
8383
) -> List[PyThread]: ...
8484
def get_bss_info(binary: Union[str, pathlib.Path]) -> Optional[Dict[str, Any]]: ...
85-
def copy_memory_from_address(pid: int, address: int, size: int) -> bytes: ...
8685
def _check_interpreter_shutdown(manager: ProcessManager) -> None: ...
8786
def is_eval_frame(symbol: str, python_version: Tuple[int, int]) -> bool: ...
8887
def _normalize_threads_for_testing(

src/pystack/_pystack/bindings.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -363,18 +363,6 @@ class ProcessManagerWrapper
363363
std::shared_ptr<pystack::AbstractProcessManager> d_manager;
364364
};
365365

366-
nb::bytes
367-
copy_memory_from_address(pid_t pid, uintptr_t address, size_t size)
368-
{
369-
auto manager = std::make_shared<pystack::ProcessMemoryManager>(pid);
370-
PyObject* py_bytes = PyBytes_FromStringAndSize(nullptr, static_cast<Py_ssize_t>(size));
371-
if (!py_bytes) {
372-
throw nb::python_error();
373-
}
374-
manager->copyMemoryFromProcess(address, size, PyBytes_AS_STRING(py_bytes));
375-
return nb::steal<nb::bytes>(py_bytes);
376-
}
377-
378366
nb::object
379367
get_bss_info(const std::filesystem::path& binary)
380368
{
@@ -972,13 +960,6 @@ NB_MODULE(_pystack, m)
972960
nb::rv_policy::reference)
973961
.def("__exit__", [](ProcessManagerWrapper& self, nb::args) { self.reset(); });
974962

975-
m.def("copy_memory_from_address",
976-
&copy_memory_from_address,
977-
"pid"_a,
978-
"address"_a,
979-
"size"_a,
980-
"Copy memory from a remote process");
981-
982963
m.def("get_bss_info", &get_bss_info, "binary"_a, "Get BSS section information from an ELF binary");
983964

984965
// Note: We use nb::arg().none() to allow None to be passed explicitly

0 commit comments

Comments
 (0)