avatartwo / avatar2-examples Goto Github PK
View Code? Open in Web Editor NEWExamples demonstrating the usage of avatar²
Examples demonstrating the usage of avatar²
When I use pip to install avatar2, I got this error:
llvm/keystone/CMakeFiles/keystone.dir/build.make:1814: recipe for target 'llvm/keystone/CMakeFiles/keystone.dir/__/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp.o' failed make[2]: *** [llvm/keystone/CMakeFiles/keystone.dir/__/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp.o] Error 4 make[2]: *** 正在等待未完成的任务.... CMakeFiles/Makefile2:405: recipe for target 'llvm/keystone/CMakeFiles/keystone.dir/all' failed make[1]: *** [llvm/keystone/CMakeFiles/keystone.dir/all] Error 2 Makefile:151: recipe for target 'all' failed make: *** [all] Error 2 running install_lib running install_data error: can't copy 'src/build/llvm/lib/libkeystone.so': doesn't exist or not a regular file
Than , I try to build avatar2 manually, but when I use sudo python setup.py install
, I got this error:
Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions. llvm/keystone/CMakeFiles/keystone.dir/build.make:1814: recipe for target 'llvm/keystone/CMakeFiles/keystone.dir/__/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp.o' failed make[2]: *** [llvm/keystone/CMakeFiles/keystone.dir/__/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp.o] Error 4 make[2]: *** 正在等待未完成的任务.... CMakeFiles/Makefile2:405: recipe for target 'llvm/keystone/CMakeFiles/keystone.dir/all' failed make[1]: *** [llvm/keystone/CMakeFiles/keystone.dir/all] Error 2 Makefile:151: recipe for target 'all' failed make: *** [all] Error 2 error: Setup script exited with error: can't copy 'src/build/llvm/lib/libkeystone.so': doesn't exist or not a regular file
I believe I have installed all dependencies. So, how can I solve these problems. Thanks
Hi,
Running the nucleo_l152re example with avatar qemu @branches dev/qemu-6.2 or dev/qemu-5.1 we face a crash issue of qemu.
It’s like the registers and ram synchronizations are ok between the board and the qemu. The crash happens just after the synchronization, when doing continue in qemu.
Starting from the trace “terminal derived exception” and debugging a bit we see that there is a call to abort inside do_armv7m_nvic_set_pending resulting from an arm_v7m_cpu_do_interrupt.
Please find attach 2 call stacks obtained from a gdb instance attached to qemu.
It’s like the vector table is not correct (probably an issue with the configurable machine ?). Any clue to fix the issue ?
Has it been validated with the latest qemu versions ?
It ‘s like the latest qemu versions from /dev/qemu-6.2 branch has also some troubles with u-boot example.
When I try to run qemu_uboot, I run into the following problem:
2022-04-19 02:25:29,050 | avatar.INFO | Initialized Avatar. Output directory is /tmp/myavatar
TargetLauncher is starting process "qemu-system-arm" "-M" "versatilepb" "-m" "256M" "-gdb" "tcp:127.0.0.1:1234" "-serial" "tcp:127.0.0.1:2000,server,nowait" "-kernel" "u-boot" "-S" "-nographic" "-monitor" "telnet:127.0.0.1:2001,server,nowait"
pulseaudio: set_sink_input_volume() failed
pulseaudio: Reason: Invalid argument
pulseaudio: set_sink_input_mute() failed
pulseaudio: Reason: Invalid argument
2022-04-19 02:25:29,326 | avatar.targets.GDBTarget0.INFO | State changed to TargetStates.STOPPED
2022-04-19 02:25:29,327 | avatar.INFO | Received state update of target GDBTarget0 to TargetStates.STOPPED
2022-04-19 02:25:29,338 | avatar.targets.GDBTarget0.INFO | Connected to Target
2022-04-19 02:25:29,339 | avatar.targets.QemuTarget0.WARNING | No cpu_model specified - are you sure?
2022-04-19 02:25:29,341 | avatar.targets.QemuTarget0.INFO | QEMU process running
2022-04-19 02:25:29,419 | avatar.targets.QemuTarget0.INFO | State changed to TargetStates.STOPPED
2022-04-19 02:25:29,419 | avatar.INFO | Received state update of target QemuTarget0 to TargetStates.STOPPED
2022-04-19 02:25:29,432 | avatar.targets.QemuTarget0.QMPProtocol.INFO | b'{"return": {}, "id": 0}\r\n'
2022-04-19 02:25:29,432 | avatar.targets.QemuTarget0.INFO | Connected to remote target
2022-04-19 02:25:29,432 | avatar.targets.QemuTarget0.RemoteMemoryProtocol.INFO | Successfully connected rmp
2022-04-19 02:25:29,451 | avatar.targets.QemuTarget0.INFO | State changed to TargetStates.RUNNING
2022-04-19 02:25:29,452 | avatar.INFO | Received state update of target QemuTarget0 to TargetStates.RUNNING
2022-04-19 02:25:29,451 | avatar.targets.QemuTarget0.INFO | State changed to TargetStates.BREAKPOINT
2022-04-19 02:25:29,452 | avatar.INFO | Breakpoint hit for Target: QemuTarget0
2022-04-19 02:25:29,452 | avatar.INFO | Received state update of target QemuTarget0 to TargetStates.BREAKPOINT
2022-04-19 02:25:29,452 | avatar.targets.QemuTarget0.INFO | State changed to TargetStates.STOPPED
2022-04-19 02:25:29,452 | avatar.INFO | Received state update of target QemuTarget0 to TargetStates.STOPPED
================== Arrived at clear_bss =========================
2022-04-19 02:25:29,470 | avatar.ERROR | RemoteMemoryRead failed: Failed to read memory!
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/avatar2.py", line 453, in _handle_remote_memory_read_message
mem = range.forwarded_to.read_memory(
File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/watchmen.py", line 78, in watchtrigger
ret = func(self, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/targets/target.py", line 35, in check
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/targets/target.py", line 386, in read_memory
return self.protocols.memory.read_memory(address, size, num_words, raw)
File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/protocols/gdb.py", line 664, in read_memory
raise Exception("Failed to read memory!")
Exception: Failed to read memory!
2022-04-19 02:25:29,473 | avatar.targets.QemuTarget0.INFO | State changed to TargetStates.RUNNING
2022-04-19 02:25:29,474 | avatar.INFO | Received state update of target QemuTarget0 to TargetStates.RUNNING
2022-04-19 02:25:29,484 | avatar.targets.QemuTarget0.INFO | State changed to TargetStates.EXITED
2022-04-19 02:25:29,484 | avatar.INFO | Received state update of target QemuTarget0 to TargetStates.EXITED
Arrived at main loop, demo is over
2022-04-19 02:25:29,965 | avatar.targets.QemuTarget0.RemoteMemoryProtocol.WARNING | Tried to close/unlink non existent rx_queue
2022-04-19 02:25:29,965 | avatar.targets.QemuTarget0.RemoteMemoryProtocol.WARNING | Tried to close/unlink non existent tx_queue
None
when i python3 qemu_uboot_avatar2.py
[2022-04-01 11:04:28,252 | avatar.INFO | Initialized Avatar. Output directory is /tmp/myavatar
TargetLauncher is starting process "/usr/local/bin/qemu-system-arm" "-M" "versatilepb" "-m" "20M" "-gdb" "tcp:127.0.0.1:1234" "-serial" "tcp:127.0.0.1:2000,server,nowait" "-kernel" "u-boot" "-S" "-nographic" "-monitor" "telnet:127.0.0.1:2001,server,nowait"
qemu-system-arm: -monitor telnet:127.0.0.1:2001,server,nowait: Failed to find an available port: Address already in use
2022-04-01 11:04:28,429 | avatar.targets.GDBTarget0.INFO | State changed to TargetStates.STOPPED
2022-04-01 11:04:28,430 | avatar.INFO | Received state update of target GDBTarget0 to TargetStates.STOPPED
2022-04-01 11:04:28,440 | avatar.targets.GDBTarget0.INFO | Connected to Target
2022-04-01 11:04:28,441 | avatar.targets.QemuTarget0.WARNING | No cpu_model specified - are you sure?
2022-04-01 11:04:28,447 | avatar.targets.QemuTarget0.INFO | QEMU process running
2022-04-01 11:04:28,618 | avatar.targets.QemuTarget0.INFO | State changed to TargetStates.STOPPED
2022-04-01 11:04:28,619 | avatar.INFO | Received state update of target QemuTarget0 to TargetStates.STOPPED
2022-04-01 11:04:28,631 | avatar.targets.QemuTarget0.QMPProtocol.INFO | b'{"return": {}, "id": 0}\r\n'
2022-04-01 11:04:28,633 | avatar.targets.QemuTarget0.INFO | Connected to remote target
2022-04-01 11:04:28,634 | avatar.targets.QemuTarget0.RemoteMemoryProtocol.INFO | Successfully connected rmp
2022-04-01 11:04:28,651 | avatar.targets.QemuTarget0.INFO | State changed to TargetStates.RUNNING
2022-04-01 11:04:28,652 | avatar.targets.QemuTarget0.INFO | State changed to TargetStates.BREAKPOINT
2022-04-01 11:04:28,653 | avatar.INFO | Received state update of target QemuTarget0 to TargetStates.RUNNING
2022-04-01 11:04:28,654 | avatar.INFO | Breakpoint hit for Target: QemuTarget0
2022-04-01 11:04:28,655 | avatar.INFO | Received state update of target QemuTarget0 to TargetStates.BREAKPOINT
2022-04-01 11:04:28,656 | avatar.targets.QemuTarget0.INFO | State changed to TargetStates.STOPPED
2022-04-01 11:04:28,657 | avatar.INFO | Received state update of target QemuTarget0 to TargetStates.STOPPED
================== Arrived at clear_bss =========================
**2022-04-01 11:04:28,672 | avatar.ERROR | RemoteMemoryRead failed: Failed to read memory!
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/avatar2.py", line 453, in _handle_remote_memory_read_message
mem = range.forwarded_to.read_memory(
File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/watchmen.py", line 78, in watchtrigger
ret = func(self, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/targets/target.py", line 35, in check
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/targets/target.py", line 386, in read_memory
return self.protocols.memory.read_memory(address, size, num_words, raw)
File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/protocols/gdb.py", line 664, in read_memory
raise Exception("Failed to read memory!")
Exception: Failed to read memory!**
2022-04-01 11:04:28,682 | avatar.targets.QemuTarget0.INFO | State changed to TargetStates.RUNNING
2022-04-01 11:04:28,683 | avatar.INFO | Received state update of target QemuTarget0 to TargetStates.RUNNING
2022-04-01 11:04:28,693 | avatar.targets.QemuTarget0.INFO | State changed to TargetStates.EXITED
2022-04-01 11:04:28,694 | avatar.INFO | Received state update of target QemuTarget0 to TargetStates.EXITED
Arrived at main loop, demo is over
2022-04-01 11:04:29,164 | avatar.targets.QemuTarget0.RemoteMemoryProtocol.WARNING | Tried to close/unlink non existent rx_queue
2022-04-01 11:04:29,165 | avatar.targets.QemuTarget0.RemoteMemoryProtocol.WARNING | Tried to close/unlink non existent tx_queue
None]
Thanks!
Hey!
I have been trying to tinker with the above mentioned example. However, I got the following error message when I try to run the python file using the installer method of avatar2:
(avatar2-local) parallels@parallels-Parallels-Virtual-Platform:~/avatar2-compose/files$ python test2.py
2022-05-17 17:15:45,936 | avatar.INFO | Initialized Avatar. Output directory is /tmp/myavatar
Traceback (most recent call last):
File "test2.py", line 111, in <module>
main()
File "test2.py", line 34, in main
target_runner = TargetLauncher([avatar.arch.get_qemu_executable(),
File "/home/parallels/.virtualenvs/avatar2-local/lib/python3.8/site-packages/avatar2/archs/architecture.py", line 38, in <lambda>
return staticmethod(lambda : Architecture._resolve_executable(exec_name))
File "/home/parallels/.virtualenvs/avatar2-local/lib/python3.8/site-packages/avatar2/archs/architecture.py", line 25, in _resolve_executable
raise Exception(("Couldn't find executable for %s\n"
Exception: Couldn't find executable for avatar-qemu
Have you tried running the avatar2-installer (python -m avatar2.installer) or setting the AVATAR2_QEMU_EXECUTABLE environment variable?
When I try to run with docker, I get the following output:
docker command: docker-compose run --rm -e AVATAR2_QEMU_EXECUTABLE=qemu-system-arm avatar2 python3 /tmp/test2.py
2022-05-17 15:17:10,668 | avatar.INFO | Initialized Avatar. Output directory is /tmp/myavatar
TargetLauncher is starting process "/usr/local/bin/qemu-system-arm" "-M" "versatilepb" "-m" "20M" "-gdb" "tcp:127.0.0.1:1234" "-serial" "tcp:127.0.0.1:2000,server,nowait" "-kernel" "u-boot" "-S" "-nographic" "-monitor" "telnet:127.0.0.1:2001,server,nowait"
qemu-system-arm: could not load kernel 'u-boot'
2022-05-17 15:17:15,780 | avatar.targets.GDBTarget0.GDBProtocol.CRITICAL | GDBProtocol was unable to connect to remote target
Traceback (most recent call last):
File "/tmp/test2.py", line 111, in <module>
main()
File "/tmp/test2.py", line 85, in main
avatar.init_targets()
File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/avatar2.py", line 233, in init_targets
t[1].init()
File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/targets/gdb_target.py", line 60, in init
if gdb.remote_connect(ip=self.gdb_ip, port=self.gdb_port):
File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/protocols/gdb.py", line 399, in remote_connect
return self._remote_connect_common('%s:%d' % (ip, int(port)))
File "/usr/local/lib/python3.8/dist-packages/avatar2-1.4.7-py3.8.egg/avatar2/protocols/gdb.py", line 384, in _remote_connect_common
raise Exception("GDBProtocol was unable to connect")
Exception: GDBProtocol was unable to connect
Any help is appreciated!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.