rizinorg / rz-ghidra

Deep ghidra decompiler and sleigh disassembler integration for rizin
GNU Lesser General Public License v3.0
818 stars 86 forks source link

src/RizinUtils.h:14:48: error: 'RzListIter' {aka 'struct rz_list_iter_t'} has no member named 'n' #337

Closed XVilka closed 9 months ago

XVilka commented 9 months ago
#47 111.2 [ 36%] Building CXX object CMakeFiles/core_ghidra.dir/src/RizinArchitecture.cpp.o
#47 112.1 In file included from /tmp/rz-ghidra/src/RizinArchitecture.cpp:9:
#47 112.1 /tmp/rz-ghidra/src/RizinUtils.h: In function 'void rz_list_foreach_cpp(RzList*, const F&)':
#47 112.1 /tmp/rz-ghidra/src/RizinUtils.h:14:48: error: 'RzListIter' {aka 'struct rz_list_iter_t'} has no member named 'n'
#47 112.1   for(RzListIter *it = list->head; it; it = it->n)
#47 112.1                                                 ^
#47 112.1 /tmp/rz-ghidra/src/RizinUtils.h:16:34: error: 'RzListIter' {aka 'struct rz_list_iter_t'} has no member named 'data'
#47 112.1    func(reinterpret_cast<T *>(it->data));
#47 112.1                                   ^~~~
#47 113.0 make[2]: *** [CMakeFiles/core_ghidra.dir/build.make:76: CMakeFiles/core_ghidra.dir/src/RizinArchitecture.cpp.o] Error 1
#47 113.0 make[1]: *** [CMakeFiles/Makefile2:119: CMakeFiles/core_ghidra.dir/all] Error 2
#47 113.0 make: *** [Makefile:130: all] Error 2
#47 ERROR: process "/bin/sh -c cmake -DCMAKE_PREFIX_PATH=/tmp/***-install/usr -DCMAKE_INSTALL_PREFIX=/usr -B build && cmake --build build && DESTDIR=/tmp/***-install cmake --build build --target install" did not complete successfully: exit code: 2
treseco commented 9 months ago

Was able to fix by changing rz-ghidra/src/RizinUtil.h

template<typename T, typename F> void rz_list_foreach_cpp(RzList *list, const F &func)
{
-   for(RzListIter *it = list->head; it; it = it->n)
+      for(RzListIter *it = list->head; it; it = rz_list_iter_get_next(it))
    {
-       func(reinterpret_cast<T *>(it->data));
+       func(reinterpret_cast<T *>(rz_list_iter_get_data(it)));
    }
}

Looks like it was caused by this commit to the rizin dev branch.

XVilka commented 9 months ago

@treseco do you want to send a PR?

treseco commented 9 months ago

@XVilka Yes I have just done so I believe. My apologies I am new to this process and not sure how to proceed with the workflows and such but I hope it helps.

XVilka commented 9 months ago

Fixed by https://github.com/rizinorg/rz-ghidra/commit/3741188321ca453bcfd7b32bd26014943682bc77