Re: New Working GCC for ESP8266
Posted: Tue Jun 09, 2015 5:18 pm
cal wrote:Should that probably be a break 1,x (coded) instead of break 0,x (planted) ?
Yeah, I think you're right. Pushed the update.
Thanks for checking!
-->
Open Community Forum for ESP8266, Come share Arduino and IoT (Internet of Things)
https://www.esp8266.com/
cal wrote:Should that probably be a break 1,x (coded) instead of break 0,x (planted) ?
jcmvbkbc wrote:cal wrote:Should that probably be a break 1,x (coded) instead of break 0,x (planted) ?
Yeah, I think you're right. Pushed the update.
Thanks for checking!
break 1,15
break 1,x
cal wrote:Generates aCode: Select allbreak 1,15
now after the code.
Can you explain to me the purpose of this?
Why would one execute a breakpoint AFTER the access?
Why does gcc believe to know that write and read access to address 0 should be treated as "kind of" fatal?
jcmvbkbc wrote:cal wrote:Generates aCode: Select allbreak 1,15
now after the code.
Can you explain to me the purpose of this?
Why would one execute a breakpoint AFTER the access?
Why does gcc believe to know that write and read access to address 0 should be treated as "kind of" fatal?
Because C (e.g. C99, 6.5.3.2:4) and C++ (e.g. C++98, 1.9:4) standards consider null-pointer dereference an undefined behaviour. The program that contains undefined behaviour is invalid, but GCC additionally tries to make sure that in case we reach that point we don't go any further. It's the "best effort" attempt, and in case there's a debugger connected, break 1, 15 fits perfectly. Without debugger it doesn't get any worse, since it's not guaranteed to work anyway.