看起来,Simics可以设置一个条件断点,但我没有找到任何带有condition命令的break-*参数。是否可以使用simics命令设置中断条件?
另一个问题是如何使用simics命令设置动态printf?
有了gdb,我可以用它记录断点的命中情况,如何用simics来做同样的事情呢?
(gdb) b malloc
(gdb) commands
> silent
> printf "malloc hit"
> cont
> end
(gdb)发布于 2022-01-20 07:37:45
Simics在内置断点命令中没有条件断点.如果要这样做,请编写一个脚本分支,等待断点,然后检查状态。这些命令有意地相当基本。
在这种情况下,什么是“动态打印”?
使用Simics gdb-remote将gdb调试器连接到Simics并使用它调试目标软件可能更简单。
要查看所有断点命中,Simics将倾向于在每次断点命中时编写一条消息:
simics> bp.memory.break -x 0xffff0000 0x100000
Breakpoint 2: break on 'x' access to 0xffff_0000 len=1_048_576 in board.cell_context
simics> r
[board.cell_context] Breakpoint 2: board.cell_context 'x' access to v:0xfffffff0
simics> r
[board.cell_context] Breakpoint 2: board.cell_context 'x' access to v:0xfffffff1
simics> r
[board.cell_context] Breakpoint 2: board.cell_context 'x' access to v:0xfffffff2 len=2如果您想对断点命中执行操作,请使用脚本进行反应并打印任何您想要的内容。例如,就像这样。如果脚本分支获取断点,Simics将不会停止它的执行。
simics> script-branch {
....... while(TRUE) {
....... bp.wait-for-breakpoint 2
....... echo (ptime)
....... }
....... }
2
simics> r
"board.mb.cpu0.core[0][0]"
[["board.mb.cpu0.core[0][0]", 8, 8, 4e-09]]
"board.mb.cpu0.core[0][0]"
[["board.mb.cpu0.core[0][0]", 9, 9, 4.5e-09]]
"board.mb.cpu0.core[0][0]"https://stackoverflow.com/questions/70501989
复制相似问题