Trying to improve x49gp
08-29-2018, 10:09 PM
Post: #43
 Claudio L. Senior Member Posts: 1,702 Joined: Dec 2013
RE: Trying to improve x49gp
(08-29-2018 11:12 AM)3298 Wrote:  Ouch, that's not supposed to happen. I somehow doubt it's the interrupt fix skipping too far, because the fix works by preventing interrupts from starting in the first place (instead of letting them run and stopping afterwards), but the only other place for an actual bug I can think of is the gdb client, which is obviously not part of x49gp.
The knowledge about where code lines start and end is only on the client side, which automatically translates a line step into a stream of alternating instruction-step commands and register queries (to check the instruction pointer). If there are too many of these, x49gp's gdbstub cannot even tell there's something wrong
There is another possibility, which is the compiler's optimization making a mess of your to-be-debugged code. That's happened to me more than a few times, but I know of only two ways to deal with it: turn it off by compiling your program / firmware with -O0, or accept it and try to make sense of the machine code it spat out.
You are right! The project file on newRPL was removing the 'debug' configuration, so it was always -O2. I fixed the project files now it works perfectly. Debugging in ARM seems to be a lot jumpier than debugging directly on x86 for some reason. I guess the compiler still messes up the code a lot more, even with -Og selected, but it's not the insanity that was before.
Now it's a very nice debugger!

Anyway, I got your requested features (automatic firmware installation via GUI, forced automatic firmware installation via command-line option, forced reboot) done. It's split into three patches (firmware installation code with GUI-based selection; all command-line additions; manual update). The fourth one is the strncpy->memcpy workaround above.

My commit messages:
Code:
Improve initial flash creation Instead of just loading the bootcode and letting it handle the rest (relying on the user to provide a firmware through the emulated SD card), ask the user for the firmware and load that into the flash directly. Also, the stock firmware needs some markers to be able to use the user flash banks. It seems to be unable to add these if they are missing, so if a firmware that does not include blank user banks is selected, the user banks would have been unusable. Adding the marks in x49gp is therefore desirable, and custom firmware needs to be robust enough to handle these anyway if it wants to survive in the wild. If the flash file was present but too short, there is most likely nothing worth preserving in it, so stop trying and fill the entire flash with 0xff instead of just the section after the present file's contents. Lastly, fix a double free on a rare (fatal) error and a use-after-free on another which appear to have snuck into the flash creation code in an earlier commit.
Code:
Add command-line options to rebuild the flash or reboot The firmware can be specified on the command line. This might be useful for debugging custom firmware by making the debugging process more automatable.
Code:
Update the manual to reflect recent changes
Code:
Fix a warning about strncpy that caused compilation failures via -Werror The previous workaround through -D_FORTIFY_SOURCE=1 caused redefinition errors on a user's system, and it working at all was probably an oversight in the development system's compiler or standard library headers. The code that actually caused it can be safely switched to memcpy in place of strncpy, which looks like a better fix.
[/quote]
 « Next Oldest | Next Newest »

 Messages In This Thread Trying to improve x49gp - 3298 - 10-28-2014, 10:08 PM RE: Trying to improve x49gp - Han - 10-28-2014, 10:53 PM RE: Trying to improve x49gp - Egan Ford - 10-29-2014, 02:54 AM RE: Trying to improve x49gp - Egan Ford - 10-29-2014, 02:57 AM RE: Trying to improve x49gp - Egan Ford - 10-29-2014, 03:10 AM RE: Trying to improve x49gp - 3298 - 10-29-2014, 08:43 AM RE: Trying to improve x49gp - Egan Ford - 10-31-2014, 12:36 AM RE: Trying to improve x49gp - debrouxl - 10-29-2014, 09:18 AM RE: Trying to improve x49gp - Claudio L. - 10-29-2014, 11:58 AM RE: Trying to improve x49gp - Claudio L. - 10-29-2014, 12:04 PM RE: Trying to improve x49gp - Anderson Costa - 11-03-2014, 07:17 PM RE: Trying to improve x49gp - 3298 - 11-04-2014, 09:50 PM RE: Trying to improve x49gp - Egan Ford - 11-08-2014, 09:50 PM RE: Trying to improve x49gp - 3298 - 05-05-2018, 10:43 PM RE: Trying to improve x49gp - 3298 - 05-05-2018, 10:45 PM RE: Trying to improve x49gp - Claudio L. - 05-07-2018, 06:33 PM RE: Trying to improve x49gp - 3298 - 05-07-2018, 08:55 PM RE: Trying to improve x49gp - Claudio L. - 05-07-2018, 11:09 PM RE: Trying to improve x49gp - dmmaster - 05-07-2018, 07:17 PM RE: Trying to improve x49gp - 3298 - 05-07-2018, 08:12 PM RE: Trying to improve x49gp - dmmaster - 05-07-2018, 08:36 PM RE: Trying to improve x49gp - Claudio L. - 05-08-2018, 02:57 AM RE: Trying to improve x49gp - 3298 - 05-08-2018, 11:19 AM RE: Trying to improve x49gp - Claudio L. - 05-08-2018, 03:02 PM RE: Trying to improve x49gp - 3298 - 05-08-2018, 06:17 PM RE: Trying to improve x49gp - 3298 - 05-13-2018, 10:27 PM RE: Trying to improve x49gp - Claudio L. - 05-14-2018, 01:24 AM RE: Trying to improve x49gp - 3298 - 05-15-2018, 10:22 AM RE: Trying to improve x49gp - 3298 - 08-23-2018, 05:44 PM RE: Trying to improve x49gp - ijabbott - 08-23-2018, 07:15 PM RE: Trying to improve x49gp - Claudio L. - 08-24-2018, 02:36 AM RE: Trying to improve x49gp - 3298 - 08-26-2018, 02:22 PM RE: Trying to improve x49gp - pier4r - 08-26-2018, 06:31 PM RE: Trying to improve x49gp - Claudio L. - 08-27-2018, 01:39 PM RE: Trying to improve x49gp - 3298 - 08-27-2018, 08:20 PM RE: Trying to improve x49gp - Claudio L. - 08-27-2018, 09:07 PM RE: Trying to improve x49gp - 3298 - 08-27-2018, 10:39 PM RE: Trying to improve x49gp - Claudio L. - 08-28-2018, 02:51 AM RE: Trying to improve x49gp - 3298 - 08-28-2018, 08:04 AM RE: Trying to improve x49gp - Claudio L. - 08-29-2018, 02:17 AM RE: Trying to improve x49gp - 3298 - 08-29-2018, 11:12 AM RE: Trying to improve x49gp - Claudio L. - 08-29-2018, 10:02 PM RE: Trying to improve x49gp - 3298 - 08-29-2018, 10:21 PM RE: Trying to improve x49gp - brickviking - 08-29-2018, 10:46 PM RE: Trying to improve x49gp - 3298 - 08-29-2018, 11:53 PM RE: Trying to improve x49gp - Claudio L. - 08-30-2018, 09:35 PM RE: Trying to improve x49gp - Claudio L. - 08-29-2018 10:09 PM RE: Trying to improve x49gp - brickviking - 08-31-2018, 12:10 AM RE: Trying to improve x49gp - Claudio L. - 08-31-2018, 12:47 AM RE: Trying to improve x49gp - 3298 - 08-31-2018, 08:15 AM RE: Trying to improve x49gp - Claudio L. - 08-31-2018, 06:11 PM RE: Trying to improve x49gp - pier4r - 08-31-2018, 07:43 PM RE: Trying to improve x49gp - brickviking - 08-31-2018, 10:52 PM RE: Trying to improve x49gp - Sylvain Cote - 08-31-2018, 11:12 PM RE: Trying to improve x49gp - Claudio L. - 08-31-2018, 11:45 PM RE: Trying to improve x49gp - Claudio L. - 10-04-2018, 09:21 PM RE: Trying to improve x49gp - brickviking - 10-05-2018, 08:55 AM RE: Trying to improve x49gp - 3298 - 10-05-2018, 11:26 AM RE: Trying to improve x49gp - 3298 - 10-09-2018, 03:13 PM RE: Trying to improve x49gp - Claudio L. - 10-10-2018, 02:25 PM RE: Trying to improve x49gp - 3298 - 10-10-2018, 09:50 PM RE: Trying to improve x49gp - Claudio L. - 10-11-2018, 02:43 AM RE: Trying to improve x49gp - Claudio L. - 10-05-2018, 06:33 PM RE: Trying to improve x49gp - brickviking - 10-05-2018, 09:43 PM RE: Trying to improve x49gp - brickviking - 10-10-2018, 09:21 PM

User(s) browsing this thread: 1 Guest(s)