-
-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GDB build not working #1542
Comments
Same error on Ubuntu |
I observe that Makefile-rboot.mk has uses $(THIRD_PARTY_DIR)/gdbstub which does not exist. There is $SMING_HOME/third-party/esp-gdbstub and $SMING_HOME/gdb. Changing Makefile-rboot.mk to use $(THIRD_PARTY_DIR)/esp-gdbstub does not help on cygwin. |
That is probably a bug. When I have time I will take a look at it. |
Basic_Debug example fails to run because HardwareTimer fails (I will investigate and report as separate issue if required.) Changing the example to use Timer allows me to build and run the example successfully if I disable GDB.
Attempts to connect GDB via serial all fail. I am struggling to get anything more than the simplest of samples running reliably and hence want gdb working to allow me to figure out what is going wrong and help to improve the framework. Getting gdb working would be a very useful tool to assist with improving Sming. |
I have fixed the compilation, in PR #1544, but also hit the WDT reset issue that you have stumbled upon.
But why the WDT is happening will require time and investigation which I don't have at the moment, but others are free to analyze and fix.
The esp-gdbstub is very unrelyable software. A much better way to debug is to have the code compiled under Linux or Windows and use the debugger there. That is what I am having locally to debug the TCP stack and network related issues. |
Hm.. I was able to progress a bit (by accident).
After the last command GDB will try to connect to the device. On success you should see something like:
Just to be sure where the execution has stopped you can type (in GDB) On my device I get the following response
Which is good.
And try to run the bootloader AND the application
At that moment, at least for me, the debugging breaks.... Yeah... :( |
I am using PR #1544 and can now see what you are seeing using the ctrl+c trick.
I don't understand what you suggest. Are you using the host machine to run the code or are you still running it on the target ESP8266 module? What I need to do is figure out why the ESP8266 fails to run almost everything I write (well, anything that does anything useful) which is why I want to get debug working. |
Defining
allows the application to flow through to the first breakpoint (within gdbstub_init due to GDBSTUB_BREAK_ON_INIT 1). You can then set a breakpoint in app init, e.g.
then continue. GDB will then continue until the init breakpoint. Can then step forward with 'n'. This may be because GDBSTUB_CTRLC_BREAK adds a uart hook which upsets Sming. More investigation required but there is a way to get gdb (pretty much) working. :-) |
Wonderful! @riban-bw Thanks for finding this out. I can debug again Live from the device in Eclipse :). The fixes will arrive soon and the PR will be merged once the CI system approves it. |
This still isn't fully working. gdb will break before running user_init and then step through init but then fails after leaving init. It seems to get to the first blink timer callback then resets. I have only once been able to step through the timer callback but don't know how I managed to get there. Possibly related to gdbstub waiting for input or interrupt whilst interrupts are disabled and gdb not sending any data (because it is waiting for input). |
It seems that gdb debugging is unreliable if performed too quickly. I am now able to add setpoints to timer callback which mostly works but if I press 'c ' too quickly (like more than once per second) then gdb does not show then next breakpoint or the app crashes / restarts. Also, now that we have disabled ctrl+c there is no way to recover from a "continue" with no more breakpoints, i.e. the app just runs and gdb becomes unresponsive, requiring forced stop (kill -9). I guess we have two or three issues here which maybe should be reported as separate tickets???
|
Fixed with the merge of PR #1655. |
Using libsming complied with ENABLE_GDB is failing with wdt reset on Windows 7 using cygwin32.
The text was updated successfully, but these errors were encountered: