au-ts / libgdb

Experimental library and infrastructure for using GDB with the seL4 microkernel
BSD 2-Clause "Simplified" License
2 stars 1 forks source link

Watchpoint sizes #7

Open alwin-joshy opened 3 months ago

alwin-joshy commented 3 months ago

Watchpoints seem to only work for the sizes 4 and 8, not 1 and 2. This means that watchpoints for chars and shorts will not be triggered. The cause of this seems to be in the hardware debug API, as setting a size 1 or 2 watchpoint does not generate a debug exception at all, but it is unclear why. The way we are setting the BAS field of the DBG_WCR register looks valid, as for a size 1 watch point we set the BAS field to '0b00000001' and for a size 2 to '0b00000011', which should select the first and first two bytes of the word pointed to by the watchpoint respectively as per the ARMv8 TRM.

alwin-joshy commented 3 months ago

Fixed by https://github.com/alwin-joshy/seL4/commit/72c794536aa678288e7e9334ead49a0aaf5d1449. Will close when PR is made and merged.