-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add a "How To Debug" chapter to Extension Developer FAQ #1862
Comments
Marcel, one thing that I keep asking myself is: why we don't implement the standard Lua debug library? It is really quit useful in bug hunting end-user Lua apps. As to the gdb stub, I personally feel that we should assume that C developers will already be familiar with gdb (and if they aren't, then there are already a lot of useful tutorials out there). What we could do with is a more focused explanation of how to do host / target debugging using the gddbstub and its strengths and limitations. This will be a lot shorter and easier to resource from the collaborators. |
Nice feedback Terry, thanks.
I'm sure we wouldn't reject a PR if someone provided an implementation, would we?
I couldn't tell. What I do know though is that in 17+ years of Java development I never interacted with the Java debugger directly - the complexity is all nicely tucked away in the IDEs.
That must be true but nothing stops us from adding a reference to your favourite tutorial.
That's essentially what I had in mind. Philip's documentation contains aspects of that already. I created this isssue here because I personally would profit from such an FAQ chapter. Reading and debugging someone else's code in a language that you are not/no longer/not yet familiar with is the first step into understanding. That's my status with this firmware code. |
@marcelstoer @jmattsson @pjsg after my experiences on debugging this #2068, I have decided that we definitely need this. We also need a more developer friendly way of debugging and testing C library code. I've got the GDB stub working well -- albeit with nasty quirks -- but to do this I've had to patch the Espressif library, the UART driver, and various Lua modules. The main catch-22 is that if you want to debug at a C statement level then you've got to allow the GDB stub to take control of UART0. And this means that you must lose access to the interactive Lua prompt -- which is a total pain. So I have two approaches for doing adhoc Lua testing to exercise a C library that I am debugging:
I've also had to tweak the debug and error routines so that you can redirect error messages / stderr to UART1. So now my "on holiday" mobile rig consists of my laptop, a Wemos D1 chip with UART1 connected through a USB serial UART chip so I have 2 USB serial connections: one at 115,200 baud for the GDB session and one at 460,800 baud for logging debug and other diagnostics. It's a total pain doing all of this on a single laptop screen and for the first time I am seriously considering using two decent auxiliary monitors in my office for doing this work. The other thing is that you can use the remote GDB usefully and step through the code -- so long as you can work with a single breakpoint pending, and so lots of So I am quite a seasoned crusty old hacker and with a couple of days perseverance got a development model that works for me. My issue is how we share this know-how. It ain't easy and there's a big learnng curve for beginners. |
Sorry about the close and open -- finger trouble. If I am honest, then I would never have got this flash stuff working without a usable remote debugger. Goodness knows how @zeroday got the first version of the Lua system bootstrapped. I am just in awe. I did the LCD patch by getting it working under a standard Linux environment using the patch on std Lua then moving onto NodeMCU, but for stuff like this Flash mod, Lua 5.3 or any complex H/W related libraary, then IMO you really need decent |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
We currently have module documentation for
gdbstub
. It's quite a bit more than a simple API documentation but not enough to qualify as a real "How to". IMO it would be helpful to have recipe-style instructions in the extension developer FAQs for people who have never worked with GDB. Such a chapter would also prove to be useful in bug processing. We could send people there with a clear conscience and ask them to do some of the debugging themselves.The text was updated successfully, but these errors were encountered: