Recent

Author Topic: has no component named Tag  (Read 21741 times)

lgrfbs

  • Jr. Member
  • **
  • Posts: 68
    • My CV page (On Swedish only)
Re: has no component named Tag
« Reply #15 on: February 10, 2017, 11:40:16 am »
I'm using UbuntuMate. Perhaps you can consider to use Linux.  :D
I have LinuxMint as testplattform, how do I debug Windows program bugs on that box :P ?
I will make some test on LinuxMint and see if it works better.

But relly what is needed to fix so GDB on Windows in combination with Lazarus will work better? Money, time, more programmers?
OS : Win 10 64bit Home * Win 7 64bit Professional
Lazarus 1.8.4 r57972 FPC 3.0.4 i386-win32-win32/win64
Delphi 7.0 (Build 4.453)

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: has no component named Tag
« Reply #16 on: February 10, 2017, 02:27:54 pm »
I'm using UbuntuMate. Perhaps you can consider to use Linux.  :D
I have LinuxMint as testplattform, how do I debug Windows program bugs on that box :P ?

Maybe not the best. But if I were you, I will learn and convert all the old codes to support cross-platform. This is what I currently do. To make win-only codes to become cross-platform is not easy, but actually it's also not too hard.

Alternatively, which is also what I currently do. I write my own debug module to help me to test and debug my algorithms. It's similar to ShowMessage, but with more better features. It overloaded to support different input: string, integer, byte, qword, extended, pointer. It can display the messages (or the values I want to watch) on the mainform's caption, a popup form or a system popup notifier balloon. I'm planning to make it to able to log the messages to a text file. It sounds cool, isn't it?  8-)

lgrfbs

  • Jr. Member
  • **
  • Posts: 68
    • My CV page (On Swedish only)
Re: has no component named Tag
« Reply #17 on: February 20, 2017, 12:38:46 am »
The Project I have on my desk just now is no old code at all it is writed for Window and Linux.
I want have a better support for .tag and
Quote from: rvk
I also always have trouble with Ctrl+F7 to see the value of a property. Even hovering over a property when debugging doesn't work. Hovering over the object itself does work but gives you the complete object-source (which is too much sometimes).
So what can I do for help to fix this problems?
OS : Win 10 64bit Home * Win 7 64bit Professional
Lazarus 1.8.4 r57972 FPC 3.0.4 i386-win32-win32/win64
Delphi 7.0 (Build 4.453)

rvk

  • Hero Member
  • *****
  • Posts: 6111
Re: has no component named Tag
« Reply #18 on: February 20, 2017, 10:05:54 am »
The Project I have on my desk just now is no old code at all it is writed for Window and Linux.
I want have a better support for .tag
By now you should have realized that there is absolutely nothing wrong with .tag itself. The tag property works perfectly. It's just that during debugging on Windows you can't view that property in the watch-views. So although the watch-view gives you the error, .tag has a perfectly correct value.

Quote
and
Quote from: rvk
I also always have trouble with Ctrl+F7 to see the value of a property. Even hovering over a property when debugging doesn't work. Hovering over the object itself does work but gives you the complete object-source (which is too much sometimes).
So what can I do for help to fix this problems?
If you have code for Windows AND Linux, you could switch to developing on Linux, where I understand the watch-window works correctly for properties.

Otherwise you could add debug-lines to output to a debug-window (or use plain Showmessages).

Another thing you could do is try to find the relevant bugtrack entry for the lacking watch-window and see if there is still something done about it. If there is nog bug-entry you could add one.

I think it is this one from 2008: http://bugs.freepascal.org/view.php?id=12111.
Why the Linux version can extract that information from GDB and Windows can't, is a mystery to me.

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: has no component named Tag
« Reply #19 on: February 20, 2017, 10:31:25 am »
I want have a better support for .tag
How can you ask for better support for a nativeint (I always spell it as naiveint in the context of tag for some reason  O:-)) that happens to be mis-used as a pointer to object?
« Last Edit: February 20, 2017, 10:35:54 am by Thaddy »
Specialize a type, not a var.

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: has no component named Tag
« Reply #20 on: February 20, 2017, 10:31:58 am »
The direct properties (for which the getter just returns an internal variable and is not a function) you can type the name of the internal variable to see the property value in the debugger. So, to see the Tag of Button1, enter "Button1.FTag" in the watch window.

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: has no component named Tag
« Reply #21 on: February 20, 2017, 10:38:36 am »
Correct.
Point I was trying to make is that if you mis-use tag for object storage, you'd better extend your class with an extra property.
Tags are volatile: somebody else in your team might use it too, and your intended functionality is gone to room 101.

As an aside I can confirm I know of a hotel where 101 isn't a toilet and actually pretty decent and recommended: The Hotel Central in Istanbul)
« Last Edit: February 20, 2017, 10:41:24 am by Thaddy »
Specialize a type, not a var.

rvk

  • Hero Member
  • *****
  • Posts: 6111
Re: has no component named Tag
« Reply #22 on: February 20, 2017, 10:51:11 am »
I want have a better support for .tag
How can you ask for better support for a nativeint (I always spell it as naiveint in the context of tag for some reason  O:-)) that happens to be mis-used as a pointer to object?
If you read the topic again from the beginning you'll see the question isn't about using .tag but about viewing the value of .tag in the watch-list (which doesn't work under GDB/Windows). (It's about support in the watch-list for ANY property of an object)

Nowhere in this topic I see mentioned that .tag is being used as "pointer".
The fact it is used as pointer a lot doesn't mean it is in this case.

@wp, I didn't know you could use the direct FProperty in the watch-list. Thanks for the tip.

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: has no component named Tag
« Reply #23 on: February 20, 2017, 10:56:50 am »
I was fully aware of that.But you CAN actually see it and you CAN even also cast it in the debugger. So I don't see the problem.
Specialize a type, not a var.

rvk

  • Hero Member
  • *****
  • Posts: 6111
Re: has no component named Tag
« Reply #24 on: February 20, 2017, 11:01:18 am »
I was fully aware of that.But you CAN actually see it and you CAN even also cast it in the debugger. So I don't see the problem.
Not on Windows. On Windows you can't add Object.Tag in de watch-list and see the value (like already mentioned in this topic). And even if you use only Object you see a large list and you would need to scroll/search for the property. In the hoover-mouse-over you can't see the value.

On Linux it seems that you can add Object.Tag in the watch-list, but OP is on Windows.

You can, like wp mentioned, use Object.FTag (which I wasn't aware of).
« Last Edit: February 20, 2017, 11:02:52 am by rvk »

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: has no component named Tag
« Reply #25 on: February 20, 2017, 12:38:43 pm »
I was fully aware of that.But you CAN actually see it and you CAN even also cast it in the debugger. So I don't see the problem.
Not on Windows. On Windows you can't add Object.Tag in de watch-list and see the value (like already mentioned in this topic). And even if you use only Object you see a large list and you would need to scroll/search for the property. In the hoover-mouse-over you can't see the value.

On Linux it seems that you can add Object.Tag in the watch-list, but OP is on Windows.

You can, like wp mentioned, use Object.FTag (which I wasn't aware of).
Why does it work on windows too when you cast it? Is there a GDB issue? is it maybe GDBMI?
Specialize a type, not a var.

rvk

  • Hero Member
  • *****
  • Posts: 6111
Re: has no component named Tag
« Reply #26 on: February 20, 2017, 12:49:38 pm »
Why does it work on windows too when you cast it? Is there a GDB issue? is it maybe GDBMI?
How do you cast over a property in the watch-list?

Even if I do integer(Button1.tag) in the watch-list I get "A syntax error in expression, near `TAG)'".

Doing Integer(Button1.FTag) or just Button1.FTag it show the value of .tag.

If this works on Linux, then yes, it might be a combined GDB/Lazarus_for_Windows issue.

lgrfbs

  • Jr. Member
  • **
  • Posts: 68
    • My CV page (On Swedish only)
Re: has no component named Tag
« Reply #27 on: February 21, 2017, 06:30:59 pm »
If this works on Linux, then yes, it might be a combined GDB/Lazarus_for_Windows issue.
And how do we fix this so it works on Windows to?


If you have code for Windows AND Linux, you could switch to developing on Linux, where I understand the watch-window works correctly for properties.
Yes, I can  switch to Linux, but that will not fix the bug on Windows and than I get a bug in my code as only is in Windows code I is in the watch-list bug and must do low level debuging by dialogboxes or labels and that sucks then we have a tool as nearly works.
I hope on a debug tool as work in all OS as Lazarus can run.  :)

//Sorry for broken English.
OS : Win 10 64bit Home * Win 7 64bit Professional
Lazarus 1.8.4 r57972 FPC 3.0.4 i386-win32-win32/win64
Delphi 7.0 (Build 4.453)

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: has no component named Tag
« Reply #28 on: February 21, 2017, 06:58:39 pm »
I wish Borland never added that notorious tag that I mis-used myself so many times in  the nineties of the last century and noobs still try to use to store objects today.
DON'T. Mea Culpa, limited to High(QWORD) Culpa.
I am 59 today. >:( >:( >:( >:D >:D >:D
I have the right to a nice birthday dinner. (Which I will get, thank you).

Derive a new class.... I already told you that. Forget about "tag". <sigh>
Tags are for Dogs and Cats and even in Amsterdam they are abolished, late, but since last year,  for those too. O:-)

I know that there are quite a few more here that are of the same opinion.

Hence I can drink my proper Burgundy in peace.

If you want to give me a nice birthday present, simply don't use tag...... ever....Derive a new class... and keep your mouth shut.

Next year I am 60. Then I will ask the Laz developers to mark tag as deprecated... THAT would be a nice present!! :D
« Last Edit: February 21, 2017, 07:21:18 pm by Thaddy »
Specialize a type, not a var.

jacmoe

  • Full Member
  • ***
  • Posts: 249
    • Jacmoe's Cyber SoapBox
Re: has no component named Tag
« Reply #29 on: February 21, 2017, 07:11:19 pm »
Here's to you, mate Thaddy - I'm hitting 49 this may; the body gets older and the spirit gets younger. Enjoy your day, and burgundy! ;D ;D 8)
« Last Edit: February 21, 2017, 07:18:11 pm by jacmoe »
more signal - less noise

 

TinyPortal © 2005-2018