Skip to content

Commit

Permalink
Resolve #1034
Browse files Browse the repository at this point in the history
  • Loading branch information
romainthomas committed Mar 17, 2024
1 parent ec17282 commit 6dbb551
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/python/lief/PE.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ class CodeView(Debug):

class CodeViewPDB(CodeView):
age: int
filename: str
filename: Union[str,bytes]
signature: list[int]
def __init__(self) -> None: ...
@property
Expand Down
6 changes: 5 additions & 1 deletion api/python/src/PE/objects/debug/pyCodeViewPDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <nanobind/stl/string.h>
#include <nanobind/stl/array.h>

#include "pySafeString.hpp"

namespace LIEF::PE::py {

template<>
Expand Down Expand Up @@ -55,7 +57,9 @@ void create<CodeViewPDB>(nb::module_& m) {
nb::overload_cast<uint32_t>(&CodeViewPDB::age))

.def_prop_rw("filename",
nb::overload_cast<>(&CodeViewPDB::filename, nb::const_),
[] (const CodeViewPDB& self) {
return LIEF::py::safe_string(self.filename());
},
nb::overload_cast<std::string>(&CodeViewPDB::filename),
"Original pdb path")

Expand Down

0 comments on commit 6dbb551

Please sign in to comment.