[Lazarus] Issuing debug commands from the ide.
Benito van der Zander
benito at benibela.de
Fri Jun 1 19:30:23 CEST 2012
Hi,
>
> Have you tried to compile the IDE with DBG_WITH_DEBUGGER_DEBUG
> defined?
>
> It does exactly the above. It has been there a very long time.
>
> It has also been decided, that this feature will only be available via
> this define.
>
I think it would be much better, if it were a regular feature like in
Ludo's patch:
* the define is difficult to find
* if you recompile Lazarus frequently, it often disappears.
* if you have a Lazarus without define, you can't enable it without
recompiling and stopping the debugged application
* Lazarus will never have direct support for all possible gdb commands.
If you have added them all, there will be new ones in gdb
* The output in the debug window is difficult to read
* Most commands people use won't break the debugging session, like info,
x, ...
(and I just debugged an application that crashes if debugged and "set
scheduler-locking on" is not set, with such a patch this
option could be set, without restarting gdb)
* If debug commands were that dangerous, Lazarus could show a warning,
when the feature is used the first time.
* You can write your own gdb python plugins and call them
* People using a programming language are not stupid and can figure out
how to use gdb
Benito
On 06/01/12 15:08, Martin wrote:
> I was wondering, when I saw the log that you posted on mantis.... I
> saw breakpoints in the debugger code ....
>
> On 01/06/2012 13:45, Ludo Brands wrote:
>> Hi,
>>
>> I made a small patch for lazarus that allows to issue debugger
>> commands in
>> the Evaluate/Modify window. Commands are entered as an expression
>> starting
>> with a '>' character. For example evaluating'>x/20x $sp' will show
>> you the
>> 20 first values on the stack. When entering debug commands the result
>> area
>> is not cleared but the commands issued and their results are appended
>> to the
>> existing result, just as in a console gdb session.
> Have you tried to compile the IDE with DBG_WITH_DEBUGGER_DEBUG
> defined?
>
> It does exactly the above. It has been there a very long time.
>
> It has also been decided, that this feature will only be available via
> this define.
> Reason: This is mainly for people who wish to debug/experiment with
> the debugger. And it also requires knowledge of both: gdb and how the
> IDE deals with gdb.
>
> If in this command window you execute statements, that run the exe
> ("-exec-continue" / "c") then the IDE looses sync, and your debug
> session is gone. Even if you change the stackframe or thread, you can
> get wrong results....
> Fixing all this will only make the ide code more complex and harder to
> maintain.
>
>
>> The same syntax can also be used in a watch expression when using the
>> default style. The command will then be executed at every step or
>> breakpoint
>> hit and the result shown in the watch window. The one line output in the
>> watch window limits of course what you can display.
>>
>> If anybody is interested in this, I'll submit it to mantis.
>>
> Not sure of the use of that?
> What data do you want to display?
>
>
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
More information about the Lazarus
mailing list