Recent

Author Topic: value of "self" in gdb becomes nil  (Read 2689 times)

tparry_venture

  • New member
  • *
  • Posts: 9
value of "self" in gdb becomes nil
« on: April 15, 2016, 08:46:38 pm »
Here is the error message I get:
Code: Pascal  [Select][+][-]
  1. The GDB command:
  2. "whatis SELF"
  3. did not return any result.
  4.  

Now this may or may not be a debugger error.
Not sure if something else is clobbering the self pointer.
I call a method of a class and when it returns the self pointer is nil.

Where would I look for the cause?
This was running fine until recently (is that my code?)It was also running fine under Laz 1.4.4.

Project is a console app.
Using Dwarf2 in project options


Using Laz 1.6 (ie FPC 3.0.0) 2016-02-14  on WIN 10 64 bit but Laz is for 32 bit

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12302
  • Debugger - SynEdit - and more
    • wiki
Re: value of "self" in gdb becomes nil
« Reply #1 on: April 15, 2016, 10:06:03 pm »
IIRC that message means that gdb neither gave an error, nor a result. Something that shouldnt happen, but does....

So far, in my tests all versions of gdb fail at some point. So I dont know if this can be worked around or not.

1) You can try the older gdb from our source forge download page (in the win32 section)
But first make sure which one you use.

2) Supply more info.
a) sample code / a few lines of context, and what line you are on
b) all the basics from  http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Create_a_new_Report

You may also alter your settings. Optimization level 0 / no opt. Try stabs vs dwarf. (but not dwarf 3). Dwarf (2) is preferred.

While stepping is on a begin or end, things may not work.

 

TinyPortal © 2005-2018