changing register value or next execution statement. lazarus / 12-Debugger ---------------------------------------------------------------------- taazz · 2015-11-27 11:36 Is it possible to change register values from inside the IDE while debugging? I haven't found anything that will allow me to do so ---------------------------------------------------------------------- MathMan · 2015-11-27 12:47 Quote from: taazz on November 27, 2015, 12:36:40 pmIs it possible to change register values from inside the IDE while debugging? I haven't found anything that will allow me to do so Hm, good question though I never had the requirement to do so. I understand your "... haven't found anything ..." to mean that you tried to change reg values in the register pane of the debugger, correct? ---------------------------------------------------------------------- taazz · 2015-11-27 13:09 Quote from: MathMan on November 27, 2015, 01:47:18 pmHm, good question though I never had the requirement to do so.It helps cut down debugging time when the error is not reproducible on every run or when I have to wait until a loop reaches lets say 1024 or 1500 runs and yes generally its not something required all the time but can speed up extremely some things. Quote from: MathMan on November 27, 2015, 01:47:18 pm I understand your "... haven't found anything ..." to mean that you tried to change reg values in the register pane of the debugger, correct? I have tried a number of things so far, from execute mov assembly command in the evaluate modify dialog to change the value of eip in the registers window which allows you to edit the name of the register but not its value for some stupid reason, search both popup menus on the editor and the assembly dialog for "set next command" or similar delphi compatible description/name and of course I did a grep in the lazarus directory for the same description to see if anything is in the works. I think I have exhausted my options with out success hopefully the answer will not be along the lines of the sigsegv exception that can not be handled in the current implementation. ---------------------------------------------------------------------- mse · 2015-11-27 13:17 Quote from: taazz on November 27, 2015, 12:36:40 pmIs it possible to change register values from inside the IDE while debugging? I haven't found anything that will allow me to do so MSEide supports it. Simply edit the values in the CPU window. On Lazarus you could try to use $ in a watch expression. ---------------------------------------------------------------------- rvk · 2015-11-27 13:20 GDB itself should be able to change the registers. (http://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_60.html) But I'm not sure if you can manipulate or give commands to GDB during debugging. There is the "Debug Output" window but that just shows the GDB-output. Is there any way to push commands to GDB from Lazarus-IDE during debugging? (Otherwise the "Register"-windows should be adjusted to change the values after which Lazarus-IDE can push the correct commands to GDB.) ---------------------------------------------------------------------- taazz · 2015-11-27 13:51 Quote from: mse on November 27, 2015, 02:17:16 pmQuote from: taazz on November 27, 2015, 12:36:40 pmIs it possible to change register values from inside the IDE while debugging? I haven't found anything that will allow me to do so MSEide supports it. Simply edit the values in the CPU window. On Lazarus you could try to use $ in a watch expression. $ is used for hex numbers in pascal haven't found any way to show the contents of a register in a watch and tried all the known chars ($,#,!,% etc) although a bit hasty I admit.Quote from: rvk on November 27, 2015, 02:20:49 pmIs there any way to push commands to GDB from Lazarus-IDE during debugging? Well If I new any way to do that I wouldn't be here asking would I?  I think that your idea is excellent,  instead of a debug view window we can have a debug console window that one can also type in gdb commands along with the output. ---------------------------------------------------------------------- Martin_fr · 2015-11-27 14:08 its  a missing feature. $ does not work because the IDE translates it to 0x so gdb takes it as hex. You can compile the ide with DBG_WITH_DEBUGGER_DEBUG defined. That gives you a direct interface to gdb in the "debug output" window. This is not an official feature, it works as is, and thats all. Note, you must not (are not allowed to) issue run/step commands this way. doing so IDE and gdb will loose sync. But you can modify data. ---------------------------------------------------------------------- rvk · 2015-11-27 14:43 Quote from: rvk on November 27, 2015, 02:20:49 pmIs there any way to push commands to GDB from Lazarus-IDE during debugging? Quote from: Martin_fr on November 27, 2015, 03:08:09 pmYou can compile the ide with DBG_WITH_DEBUGGER_DEBUG defined. That gives you a direct interface to gdb in the "debug output" window. This is not an official feature, it works as is, and thats all. Yeah, that was what I was looking for and was suggesting. Tools > Configure "Build Lazarus" > Edit Defines and add "DBG_WITH_DEBUGGER_DEBUG" Click its checkmark and choose build. After the compile and restart you can choose View > Debug Windows > Debug Output and you get an extra line to enter a command and an execute button. With the correct commands you can change the registers. ---------------------------------------------------------------------- taazz · 2015-11-27 15:38 thank you martin that works for me, although I have an other problem now it seems that the break points are not working any more for dwarf or dwarf 2 debug info but hey that might be completely unrelated to the debug parameter. in any case thank you that will help a lot in the next couple of weeks. ---------------------------------------------------------------------- Martin_fr · 2015-11-27 16:43 breakpoints should not be affected by this. (So long as you do not issue run or step commands through the gdb input). Just check the gdb output and see if it shows any errors. ---------------------------------------------------------------------- taazz · 2015-11-27 21:11 Quote from: Martin_fr on November 27, 2015, 05:43:05 pmbreakpoints should not be affected by this. (So long as you do not issue run or step commands through the gdb input). Just check the gdb output and see if it shows any errors. I did not think that it is affected but it seems that for some reason setting the application to dwarf or dwarf 2 debug set the debugger is not able to recognize them, even the blue dots in the side of the editor are not shown, changing it back to automatic it shows the blue dots and the break points work again. It seems to me that for some reason the debug data are not recognized or something along those lines it does not matter much I can work but I will run any number of test you might need now that I have the problem in front of me. Edit: After a clean & build cycle on both the application and the packages it uses using dwarf debug info the problem is no longer present I'll try to run various tests and report back any interesting results.