Recent

Author Topic: Problem Debug Linux Mint 64  (Read 20863 times)

elidorio

  • Sr. Member
  • ****
  • Posts: 295
Problem Debug Linux Mint 64
« on: March 18, 2014, 02:07:33 am »
Hello,

I'm trying to use the Debug in Lazarus 1.2 64Bit Linux Mint 16. This generating errors as Annex. Have to configure something to work, could someone help me?
Thank you,

Edson
Lazarus 1.4.4 | FPC 2.6.4 | Windows / Linux Debian

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12399
  • Debugger - SynEdit - and more
    • wiki
Re: Problem Debug Linux Mint 64
« Reply #1 on: March 18, 2014, 02:30:08 am »
This error can have many reasons...


1) Check setup:
http://wiki.lazarus.freepascal.org/Debugger_Setup

I can see you have debug info, because there are blue dots. So check optimization level.

2) Even though your gdb is fine, please try :
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#gdb.exe_has_stopped_working
Quote
go to the debugger options and in the field "debugger_startup_options" enter:
        --eval-command="set auto-solib-add off"

3) If that does not help:

When does the error happen?
a) When you compile and start debugging (using F9 ?)
b) After hitting a breakpoint, when pressing F9, F8 or F7? Which?
c) After an exception? when pressing F9, F8 or F7? Which?
d) other ...?

4) Provide a log:
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debug_session

--------------
The name in the asm window "atk_object_get_type" Is that in your code?
It looks to me that may be in a system library, so somehow the debugger stopped in a system library. Maybe there are threads involved?


------------
You can try to set a breakpoint on the next line, and run with F9. That should work. But if the error keeps happening, that is not a solution.



exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: Problem Debug Linux Mint 64
« Reply #2 on: March 18, 2014, 07:00:14 am »
Try:
sudo apt-get install gdbserver

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: Problem Debug Linux Mint 64
« Reply #3 on: March 18, 2014, 07:04:01 am »
Ubuntu based distro, like XUbuntu, have a similar problem. After installing gdbserver everything works ok.

elidorio

  • Sr. Member
  • ****
  • Posts: 295
Re: Problem Debug Linux Mint 64
« Reply #4 on: March 19, 2014, 02:11:05 am »
GDB installed and still the same error keeps appearing.
Lazarus 1.4.4 | FPC 2.6.4 | Windows / Linux Debian

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12399
  • Debugger - SynEdit - and more
    • wiki
Re: Problem Debug Linux Mint 64
« Reply #5 on: March 19, 2014, 02:48:16 am »
I am sure this is not related to gdb server at all.

It may (if very very lucky) be solved by a different gdb version, but I would not bet on this.

try the
--eval-command="set auto-solib-add off"

and answer my other questions, please.

elidorio

  • Sr. Member
  • ****
  • Posts: 295
Re: Problem Debug Linux Mint 64
« Reply #6 on: March 19, 2014, 11:12:09 am »
Sorry not to have answered other questions:
When the error happens?
a) When you build and start debugging (using F9?)
No, when I enter already in debug mode by pressing F8
b) After hitting a breakpoint by pressing F9, F8 or F7? What?
Only use F8
c) After an exception? by pressing F9, F8 or F7? What?
I just use the F *
d) other ...?
no other
Lazarus 1.4.4 | FPC 2.6.4 | Windows / Linux Debian

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12399
  • Debugger - SynEdit - and more
    • wiki
Re: Problem Debug Linux Mint 64
« Reply #7 on: March 19, 2014, 03:40:08 pm »
Ok, so if you did not name any of your functions "atk....", then this is (as I suspected) part of the linux system. And gdb can not debug it.
Well it also should not try to debug it....

Again, please try
--eval-command="set auto-solib-add off"

Follow the link I posted, for detailed instructions.

elidorio

  • Sr. Member
  • ****
  • Posts: 295
Re: Problem Debug Linux Mint 64
« Reply #8 on: March 19, 2014, 05:05:53 pm »
The debug of my screen setup this way: Viewed as sitado address above is different because it is Windows.

Ps: I also ran the command above and neither worked.
Lazarus 1.4.4 | FPC 2.6.4 | Windows / Linux Debian

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12399
  • Debugger - SynEdit - and more
    • wiki
Re: Problem Debug Linux Mint 64
« Reply #9 on: March 19, 2014, 05:58:36 pm »
Strange. gdb does not normally step into libraries, when this is specified.

What is the function in your code , that you try to step over with F8?


If it only happens on that one line of your code, then you can set a breakpoint on the next line, and use F9 instead.


Otherwise please send a logfile: (when doing the logfile, please keep the "--eval-command="set auto-solib-add off"" applied)
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debug_session

I will see, if I can find anything else suspicious in the gdb output.

elidorio

  • Sr. Member
  • ****
  • Posts: 295
Re: Problem Debug Linux Mint 64
« Reply #10 on: March 20, 2014, 01:32:41 am »
So unable to generate the log file.
Unable to initialize debug with F8 and F9 will proceguindo with debug.
The code I'm this error code that is not working with linux debugging occurs on line 347 "if StrToDate (UltimaData)> Date then".
The debug appears very strange and mistakes. Follow oas files attached.
Lazarus 1.4.4 | FPC 2.6.4 | Windows / Linux Debian

elidorio

  • Sr. Member
  • ****
  • Posts: 295
Re: Problem Debug Linux Mint 64
« Reply #11 on: March 20, 2014, 01:37:18 am »
Follows the Annex, which is generating the error in debug on line 347.
Lazarus 1.4.4 | FPC 2.6.4 | Windows / Linux Debian

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12399
  • Debugger - SynEdit - and more
    • wiki
Re: Problem Debug Linux Mint 64
« Reply #12 on: March 20, 2014, 02:04:12 am »
Quote
So unable to generate the log file.
What happens?

Can you run lazarus from a terminal? You may have to run startlazarus.
If so then try
Code: [Select]
startlazarus --debug-log=/tmp/lazlog.txt  --debug-enable=DBG_CMD_ECHO,DBG_STATE,DBG_DATA_MONITORS,DBGMI_QUEUE_DEBUG,DBGMI_TYPE_INFO

Then when Lazarus starts,
load your app,
run with F9,
and in line 347 step with F8, so you get the error.

----
If it does not work, can you copy the content of Menu > View > Debug Windows > Debug output? Please first open this window, then run with F9.

---
Just to be sure, your app in compiled with -O1 ? (Either optimization level 1 or 0)?

And you have switched OFF smart linking?

--------------------------
Does that line (347) work, if you set a breakpoint on 349/355, and use F9 ?

elidorio

  • Sr. Member
  • ****
  • Posts: 295
Re: Problem Debug Linux Mint 64
« Reply #13 on: March 20, 2014, 02:19:14 am »
Hello Martin_fr,

Thank you for your attention.
Follows the log in Annex
Lazarus 1.4.4 | FPC 2.6.4 | Windows / Linux Debian

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12399
  • Debugger - SynEdit - and more
    • wiki
Re: Problem Debug Linux Mint 64
« Reply #14 on: March 20, 2014, 03:04:46 am »
Ok, there is indeed something going wrong (and it is a bug in the IDE).

But first:
According to the logfile, you did not (no more) get the error, that was in your first post "Cannot find bounds of current function".


Instead you got the following:
You hit F8 to step over one line of code. but it never stopped at the next line.

Instead of stopping, your app either:
- terminated?
- Or did it continue running, and you terminated it yourself?


Is that observation correct?

--------------
What happens is that StrToDate caused an exception:
Code: [Select]
EConvertError
"16/03/2014" is not a valid date format

(Maybe with "/" it wants the American order? That would be month/day/year)

Anyway, this exception seems to be on the list of ignored exceptions. I guess you may have put it there?
See options / debugger / language exceptions

So the IDE tries to continue the step. But that fails, because the IDE expect the next line to be reached [1], but the exception does jump to an exception handler (or the exception terminated the app, if there is on exception handler).

[1] Actually it expects the assembler
  call StrToDate
to return, which it does not.

------------

Please let me know, if my observation is correct.


In any case, there is a bug in the IDE, that means that F7 and F8 will not stop at the next statement (or at the except or finally block), if an exception occurred.


If the exception is not ignored, you will be shown the exception, but even then you will not be able to step to the except/finally block, but must use run (F9) to continue.


There is currently no solution to that. (Well, you can set a breakpoint in the except block).
I need to look into this, and see how it can be fixed. This may take some time.

------------
------------
Should the original issue ("Cannot find bounds of current function".) occur again (with the "eval-command no solib") then please send a log containing this.

 

TinyPortal © 2005-2018