Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-12

GDB problems (--exec-run)

6 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Torsten Bonde Christiansen

Hi List.

For some time now I am having problems getting GDB to work correctly with Lazarus.

Sometime, but not always, i run into the following message after I terminate a program
that I have debugged from within Lazarus:

The GDB command:
"-exec-run"
returned the error:
",msg="During startup program exited normally.""

The program runs fine but all debugging seems not to function (breakpoints, etc.) when this
happens.

The most annoying thing is that this does not happen all the time but only periodically, and
i cannot seem to find a consistent way to repoduce this. But in order to get debugging working
again i most restart Lazarus...

Any help is appreciated.

My setup:
Lazarus 1.3 r43552 FPC 2.6.2 x86_64-linux-gtk 2
GNU gdb (GDB) 7.5.1

Kind regards,
Torsten.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131218/54a3a09e/attachment.html>

Reply by email

FreeMan
to Torsten Bonde Christiansen

Hello,
Martin was write (if I'm not wrong) problem system language non english. downgrade gdb version maybe correct this problem. I test on upgrade 7.6.2 trunc but nothing change.
I want test my idea before downgrade

/opt/lazarus/startlazarus --LANG=C --pcp=~/.lazarus %f

don't forget change "startlazarus" and profile "~/.lazarus" paths I'm still testing this my solution, as long as 4 days debugger work CORRECTLY now. I want to more test then after share my solution, but more tester is better :)

18-12-2013 12:41 tarihinde, Torsten Bonde Christiansen yazd?:

Show quoted text 39 lines
Hi List. For some time now I am having problems getting GDB to work correctly with Lazarus. Sometime, but not always, i run into the following message after I terminate a program that I have debugged from within Lazarus: The GDB command: "-exec-run" returned the error: ",msg="During startup program exited normally."" The program runs fine but all debugging seems not to function (breakpoints, etc.) when this happens. The most annoying thing is that this does not happen all the time but only periodically, and i cannot seem to find a consistent way to repoduce this. But in order to get debugging working again i most restart Lazarus... Any help is appreciated. My setup: Lazarus 1.3 r43552 FPC 2.6.2 x86_64-linux-gtk 2 GNU gdb (GDB) 7.5.1 Kind regards, Torsten. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131218/b934f2be/attachment.html>

Reply by email

Martin Frb
to FreeMan
FreeMan wrote 6 lines
don't forget change "startlazarus" and profile "~/.lazarus" paths I'm still testing this my solution, as long as 4 days debugger work CORRECTLY now. I want to more test then after share my solution, but more tester is better :)

Lazarus 1.3 (should) no longer need this, as it sets the environment itself. -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131218/703c04f9/attachment.html>

Reply by email

Martin Frb
to Torsten Bonde Christiansen: Hi List. For some time now I am having problems getting GDB to work correctly with…
Torsten Bonde Christiansen wrote 17 lines
Hi List. For some time now I am having problems getting GDB to work correctly with Lazarus. Sometime, but not always, i run into the following message after I terminate a program that I have debugged from within Lazarus: The GDB command: "-exec-run" returned the error: ",msg="During startup program exited normally."" The program runs fine but all debugging seems not to function (breakpoints, etc.) when this happens.

This error can happen for various reasons. I have in the past heart of it in 2 cases:
1- certain position independent exe (PIE) : GDB fails to relocate certain breakpoints that Lazarus uses to start the exe (this is before any user breakpoints are set)
2- certain dll/so libraries, that define the same symbols as the main exe.

There may be more. The 2nd only happens on repeated runs of the debugger.

The IDE tries to work around those, but it does not always succeed. It is likely that in cases where it currently fails, this must be worked around by user set config (see below).

But it would be good if you could still send a logfile: http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debug_session

Ways to work around: (all on the options / debugger page)

* In case 2 only:
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#gdb.exe_has_stopped_working

Show quoted text 6 lines
go to the debugger options <http://wiki.lazarus.freepascal.org/IDE_Window:_Debugger_Options> and in the field "debugger_startup_options" enter: --eval-command="set auto-solib-add off"

This can only be used, if you do not debug within libraries (if you have not written your own lib)

* In Case 2 only: Check "reset debugger after each run" It will add a very slight increase to the time it takes to start the debugger, as gdb must be reloaded each time.

* In all cases:
Try any of the values available for "InternalStartBreak" (in the property grid of the options)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131218/bf856b92/attachment.html>

Reply by email

FreeMan
to Martin Frb

Hello Martin,
On Kubuntu 13.10 x64,

/opt/lazarus/startlazarus --LANG=C --pcp=~/.lazarus %f --debug-log=~/.lazarus/0_Lazarus_LOG_FILE.log
--debug-enable=DBG_CMD_ECHO,DBG_STATE,DBG_DATA_MONITORS,DBGMI_QUEUE_DEBUG,DBGMI_TYPE_INFO

"--debug-log=~/.lazarus/0_Lazarus_LOG_FILE.log" log file not creating. '~' symbol not using,
"--debug-log=/home/yourname/.lazarus/0_Lazarus_LOG_FILE.log" this parameter is work

18-12-2013 15:34 tarihinde, Martin Frb yazd?:

Show quoted text 65 lines
On 18/12/2013 10:41, Torsten Bonde Christiansen wrote: > Hi List. > > For some time now I am having problems getting GDB to work correctly > with Lazarus. > > Sometime, but not always, i run into the following message after I > terminate a program > that I have debugged from within Lazarus: > > The GDB command: > "-exec-run" > returned the error: > ",msg="During startup program exited normally."" > > The program runs fine but all debugging seems not to function > (breakpoints, etc.) when this > happens. This error can happen for various reasons. I have in the past heart of it in 2 cases: 1- certain position independent exe (PIE) : GDB fails to relocate certain breakpoints that Lazarus uses to start the exe (this is before any user breakpoints are set) 2- certain dll/so libraries, that define the same symbols as the main exe. There may be more. The 2nd only happens on repeated runs of the debugger. The IDE tries to work around those, but it does not always succeed. It is likely that in cases where it currently fails, this must be worked around by user set config (see below). But it would be good if you could still send a logfile: http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debug_session Ways to work around: (all on the options / debugger page) * In case 2 only: http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#gdb.exe_has_stopped_working > go to the debugger options > <http://wiki.lazarus.freepascal.org/IDE_Window:_Debugger_Options> and > in the field "debugger_startup_options" enter: > > --eval-command="set auto-solib-add off" > This can only be used, if you do not debug within libraries (if you have not written your own lib) * In Case 2 only: Check "reset debugger after each run" It will add a very slight increase to the time it takes to start the debugger, as gdb must be reloaded each time. * In all cases: Try any of the values available for "InternalStartBreak" (in the property grid of the options) -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131218/663eb800/attachment-0001.html>

Reply by email

Martin Frb
to FreeMan
FreeMan wrote 12 lines
Hello Martin, On Kubuntu 13.10 x64, /opt/lazarus/startlazarus --LANG=C --pcp=~/.lazarus %f --debug-log=~/.lazarus/0_Lazarus_LOG_FILE.log --debug-enable=DBG_CMD_ECHO,DBG_STATE,DBG_DATA_MONITORS,DBGMI_QUEUE_DEBUG,DBGMI_TYPE_INFO "--debug-log=~/.lazarus/0_Lazarus_LOG_FILE.log" log file not creating. '~' symbol not using, "--debug-log=/home/yourname/.lazarus/0_Lazarus_LOG_FILE.log" this parameter is work

1) Top posting
2) Completely unrelated to the quoted message
3) Untrimmed full quote
just some advice: I know some of the people will add you to their filter, and stop reading your messages, if you continue doing the above....

--LANG is not an command-line option. LANG is an environment variable. The syntax for setting it depends on the shell you use.

afaik: "~" is a token used by most shells (e.g bash). Lazarus does nothing with it, and treats it as literal.
If working, then it is expanded by the shell, *before* lazarus is even run. So if that does not work, then it is something about your shell not replacing it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131218/3382f941/attachment.html>

Reply by email