On 15/08/2011 16:04, Ludo Brands wrote:
On 15/08/2011 15:14, Ludo Brands wrote:
The debugger in lazarus didn't allow me to inspect the
refcount of the
string though and crashed on me.
Afaik:

(^longint(str)-2)^


I tried to do something similar but that is where gdb crashed on me...

In the mean time I found where the refcount increases:
DoOpenUnknownFile
->CodeToolBoss.GetSourceType
->FCurCodeTool.GetSourceName
->TPascalReaderTool.BuildTree<- this where the refcount increases to 2

BuildTree is a complex piece of code and I'll need a good night of rest
before attacking this. BeginParsing(Range); increments the refcount but that
is as far as I got. Perhaps the author of the code could shed some light?



I think I managed to trap that one.

for the FIRST codebuffer opened, I got the following inc-ref. I have not checked dec ref.


check the attached file, unrar, and import in debug history.

unfortunately clicking stack frames will not jump. due to absolute path used. ( on my todo)

requires laz trunk)


the 2nd watch shows the ref count value. not sure if that is before or after change....


Attachment: fsource_ref.rar
Description: Binary data

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to