atos-tools / qemu

QEMU with instrumentation support, ref to tcg/plugins/README
https://guillon.github.io/qemu-plugins
Other
5 stars 8 forks source link

PLUGIN_CPP: ERROR - reporting memory access for unknown block #6

Closed LittleSec closed 5 years ago

LittleSec commented 5 years ago

I want to use cpp-plugin, and I build successfully since I add the option -Wno-unused-variable in Makefile.target(if not do that, it will occur build error:

In file included from /home/***/qemu/tcg/plugins/cpp/plugin_api.h:308:17: error: ‘register_plugin_null_’ defined but not used [-Werror=unused-variable]
     static bool register_##class_name##_ = register_##class_name()
                 ^

). When I use cpp-plugin as README: ./x86_64-linux-user/qemu-x86_64 -tcg-plugin cpp /bin/true, it will occur: PLUGIN_CPP: ERROR - reporting memory access for unknown block, and stop(no any other outputs). Even I use PLUGIN_CPP=null, the same result. Do my computer lose something? or I should not -Wno-unused-variable?

guillon commented 5 years ago

I'm able to reproduce the issue. The plugin-cpp feature is experimental and was not tested in the last update, sorry for this, I will check whether I can fix this.

guillon commented 5 years ago

Actually this seems to be an ancient work around that has to be reverted (revert commit f647ed966634c7e81da5ac6e2aee5239ea530768).

@LittleSec Can you please test the proposed patch in pr #7 and feeback.

guillon commented 5 years ago

@second-reality Can you reproduce the issue supposed to be fixed by commit f647ed9 which is reverted by this fix.

LittleSec commented 5 years ago

Thank you. It can work now. By the way, I want to code some plugins in qemu recently with cpp, but I have some questions and I want to ask you. I don't know if you are convenient. If yes, how can I contact you.

second-reality commented 5 years ago

Hi Guillon,

indeed, this issue has probably been fixed with newer version of QEMU. By reverting commit f647ed9, current issue is fixed (tested on my side). Well done!

guillon commented 5 years ago

@LittleSec Please prefer opening an issue there for any discussions, we do not have discussion forum unfortunately.

guillon commented 5 years ago

Issue closed by pr #7

guillon commented 5 years ago

For information, the issue with the warning in plugin_api.h has been fixed by pr #11.