You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Tim Hardisty <ti...@hardisty.co.uk> on 2023/03/06 19:01:02 UTC

CONFIG_DEBUG_ASSERTIONS

Am I being dumb again? With CONFIG_DEBUG_ASSERTIONS set, the system doesn't halt with a DEBUGASSERT (in a driver), and ends up in a while(true) type loop and I have to pause the debug session and hope that the call stack helps (a 50:50 chance for reasons I am yet to understand).

The assert is in an HP worker task if relevant.

I would really like it to stop the debug session at the point of the assert - is that possible?



RE: CONFIG_DEBUG_ASSERTIONS

Posted by Tim Hardisty <ti...@hardisty.co.uk>.
>Sent: 06 March 2023 21:35
>To: dev@nuttx.apache.org
>
>Put a breakpoint on up_assert.
>
>You can also then set the PC and SP to the saved value to see the context
>of the assertion.
>
>On 3/6/2023 1:01 PM, Tim Hardisty wrote:
>>
>> I would really like it to stop the debug session at the point of the
>assert - is that possible?
>>
>>
Thanks Gregory - I get so buried in complexity that I very often miss the blindingly obvious solution - or workaround, at least! I'm not used to an assert not halting the debugger in all my previous projects (non-NuttX; all "true" embedded) and can't recall if it used to with my NuttX/VS Code setup before - and with so many things appearing broken, or changed, these days I tend to assume it's probably not me!

It is now stopping (close to) where I want so I can hopefully work out what's nibbling away and "adjusting" a supposedly mutex-protected struct!

Re: CONFIG_DEBUG_ASSERTIONS

Posted by Gregory Nutt <sp...@gmail.com>.
Put a breakpoint on up_assert.

You can also then set the PC and SP to the saved value to see the 
context of the assertion.

On 3/6/2023 1:01 PM, Tim Hardisty wrote:
> Am I being dumb again? With CONFIG_DEBUG_ASSERTIONS set, the system doesn't halt with a DEBUGASSERT (in a driver), and ends up in a while(true) type loop and I have to pause the debug session and hope that the call stack helps (a 50:50 chance for reasons I am yet to understand).
>
> The assert is in an HP worker task if relevant.
>
> I would really like it to stop the debug session at the point of the assert - is that possible?
>
>