Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

watch if

Victor_M_1
Beginner
657 Views

Hello,

I'm using idb in gdb mode to debug a code. I have a REAL*8 variable which is an array of length 50 that is changed a lot through the code. I would like to watch this variable and make the debugger stop only if some position in that array receives a negative value.

I know that I have to use watch if for doing this, but I don't know what syntax I have to use exactly. Can someone help me?

Thank you,

Victor

0 Kudos
1 Reply
Rob_Mueller-Albrecht
657 Views
Hi Victor, the condiktional watchpoint syntax is actually the same as for breakpoints in GDB*. Thus in genral something like (gdb) watch my_arr[3] if my_arr[3] > 10 should work. In addition the whole syntax as described for setting breakpoint conditions in the GDB* manual http://sourceware.org/gdb/current/onlinedocs/gdb/Conditions.html#Conditions also applies - especially if you are looking at more complex conditions. Where it gets a bit tricky is if you are changing scope during the run. Then you may need to use hardware watchpoints: (gdb) set can-use-hw-watchpoints (gdb) watch *(int *)0x41523c0 Hardware watchpoint 1: *(int *)0x41523c0 Thanks, Rob
0 Kudos
Reply