Can't see variable values in breakpoints


dhoerl
 

Somehow in the past few months, the company project I work on refuses to show variable values when you "hover" the mouse over the variable. Nothing - nada. Its just the one project - all my other projects work just fine.

I know it worked at one point, then it didn't but unfortunately I ignored it at the time, and now don't even have any idea when.

The company hired another dev, he has the same issue, so it must have something to do with the project itself.

This project is build using Xcode 12.3, has both PODS and Swift Packages in it, is mostly Swift with a few Objective C files (several PODS are ObjC) too.

I poked around yesterday, changing settings, but nothing. I don't have the slightest idea of where to even start.

Any and all suggestions most welcom!

David


Peter Hudson
 

I have had similar problems with interface functionality and a certain Richard Charles suggested the following - and it has cured all sorts of interface malfunctions : - 

You can reset an existing project by opening the xcodeproj bundle and discarding the xcworkspace bundle and xcuserdata folder. Keep the pbxproj bundle.

Peter





On 28 Jan 2021, at 15:17, dhoerl via groups.io <dhoerl@...> wrote:

Somehow in the past few months, the company project I work on refuses to show variable values when you "hover" the mouse over the variable. Nothing - nada. Its just the one project - all my other projects work just fine.

I know it worked at one point, then it didn't but unfortunately I ignored it at the time, and now don't even have any idea when.

The company hired another dev, he has the same issue, so it must have something to do with the project itself.

This project is build using Xcode 12.3, has both PODS and Swift Packages in it, is mostly Swift with a few Objective C files (several PODS are ObjC) too.

I poked around yesterday, changing settings, but nothing. I don't have the slightest idea of where to even start.

Any and all suggestions most welcom!

David








Alex Zavatone
 

Never use the hover.   There is always a delay and it is a waste of time.  I always po or v the object.  

But most often we want to see the string data within the object.  In objective-C, I use an autoDescribe extension on NSObject to iterate through all the properties and display the property name and string value of the object, as well as the objects it contains. 

In  the console, you’d type this.

$ po [myObject autoDescribe]

To use the class, add an #import "NSObject+AutoDescribe.h"  to your class or imports it into your .pch. 

It’s a godsend.  



On Jan 28, 2021, at 9:17 AM, dhoerl via groups.io <dhoerl@...> wrote:

Somehow in the past few months, the company project I work on refuses to show variable values when you "hover" the mouse over the variable. Nothing - nada. Its just the one project - all my other projects work just fine.

I know it worked at one point, then it didn't but unfortunately I ignored it at the time, and now don't even have any idea when.

The company hired another dev, he has the same issue, so it must have something to do with the project itself.

This project is build using Xcode 12.3, has both PODS and Swift Packages in it, is mostly Swift with a few Objective C files (several PODS are ObjC) too.

I poked around yesterday, changing settings, but nothing. I don't have the slightest idea of where to even start.

Any and all suggestions most welcom!

David








Steve Mills
 

On Jan 28, 2021, at 09:55, Alex Zavatone via groups.io <zav=mac.com@groups.io> wrote:

Never use the hover. There is always a delay and it is a waste of time. I always po or v the object.
Never?! Waste of time?! That’s completely ridiculous. If you already have your hand on the mouse, it’s SO much quicker to hover over a variable than it is to move the mouse to the console pane (assuming you have it open), clicking in the free space, then typing “po variable”, especially when Xcode acts up and won’t autocomplete the long variable name, so you have to type the whole damn thing, hit return, then retype it when you spelled it wrong.

Plus, hovering reveals the eye icon in the little floater, which is incredibly useful for seeing a preview of images, views, colors, etc, which po doesn’t do.

Steve via iPad


Alex Zavatone
 



On Jan 28, 2021, at 10:11 AM, Steve Mills via groups.io <sjmills@...> wrote:

On Jan 28, 2021, at 09:55, Alex Zavatone via groups.io <zav@...> wrote:

Never use the hover.   There is always a delay and it is a waste of time.  I always po or v the object.

Never?! Waste of time?! That’s completely ridiculous.

It is.  When you use my little tool, you’ll see that it’s MUCH faster to simply type 
po [myObject autoDescribe] 

or 

po myObject.autoDescribe 

or add this to you code 

NSLog(@“%@“, [myObject autoDescribe]);  

than it is to wait for the hover preview to show anything except an image.  Trrrry it.  

If you already have your hand on the mouse, it’s SO much quicker to hover over a variable than it is to move the mouse to the console pane (assuming you have it open), clicking in the free space, then typing “po variable”, especially when Xcode acts up and won’t autocomplete the long variable name, so you have to type the whole damn thing, hit return, then retype it when you spelled it wrong.

I got sick of waiting for the hover to work reliably and never looked back.  For long variable names, command c, command v does the trick.

If you have an object with multiple properties, this will display them and their values.  If there are arrays or dictionaries inside, it will display them.  If there are objects within, it wil recurse and display their contents.  

The hover window doesn’t do that.


Plus, hovering reveals the eye icon in the little floater, which is incredibly useful for seeing a preview of images, views, colors, etc, which po doesn’t do.


Hopefully, you’re using recursiveDescription with po to display your view hierarchy.  It doesn’t work in runtime though.  I know it works under iOS.

I’ve used a behaviour to make a window that’s the debugger and console.  But I’ll give you that.

I’ve run into enough problems in Xcode with trusting that the color shown is EXACTLY the color specified that I need to rely on the numbers.  Many times I’ve seen colors that are colors adjusted for the colorspace and not the exact RGB value specified.

Add the class I sent to your project’s .pch and try it out.

It’s another tool in the toolbox.  

Cheers,
Alex Zavatone


Steve Mills
 

On Jan 28, 2021, at 11:30, Alex Zavatone via groups.io <zav@...> wrote:

It is.  When you use my little tool, you’ll see that it’s MUCH faster to simply type 
po [myObject autoDescribe] 

or 

po myObject.autoDescribe

No, it is NOT much faster to activate the console pane and type a complicated command than it is to hover over a variable in the source pane. Yes, po can show you much different info, depending on whether or not you’ve added your autoDescribe thingy or if you’ve simply overridden the description method in your classes. But it is not faster.

Steve via iPad


Jeremy Hughes
 

I always have the console pane open when I’m debugging and I never use hover — but we all have different ways of working.

I’ve started using po a lot more recently, because the console variables list seems to have become less reliable. I also like the way that po can return computed variables.

Jeremy


Alex Zavatone
 

I’ve got the console set to appear automatically.  

The floating window never showed me what I needed and it was always a delay before it showed anything.  If if did what I needed, then I would have abandoned autoDescribe years ago.

How is the command complicated?  It’s po followed by the object and the method. It’s 3 words.  Once it’s set up in your .pch, it works as an extension to every NSObject.

No, I’m not overriding anything.  This is an extension to NSObject adding a new method.  That’s it.  

Use it or don’t.  I’m just letting people know it exists.




On Jan 28, 2021, at 12:55 PM, Steve Mills via groups.io <sjmills@...> wrote:

On Jan 28, 2021, at 11:30, Alex Zavatone via groups.io <zav@...> wrote:

It is.  When you use my little tool, you’ll see that it’s MUCH faster to simply type 
po [myObject autoDescribe] 

or 

po myObject.autoDescribe

No, it is NOT much faster to activate the console pane and type a complicated command than it is to hover over a variable in the source pane. Yes, po can show you much different info, depending on whether or not you’ve added your autoDescribe thingy or if you’ve simply overridden the description method in your classes. But it is not faster.

Steve via iPad



 



On Jan 28, 2021, at 9:20 AM, Alex Zavatone via groups.io <zav@...> wrote:

It is.  When you use my little tool, you’ll see that it’s MUCH faster to simply type 
po [myObject autoDescribe] 
...
than it is to wait for the hover preview to show anything except an image.  Trrrry it.  

I did. It isn't. The hover shows up in something like ¼ second. (If the value is a struct and I have to flip it open, that's maybe another ½ second.) I'm a fast typist, but it would take me a couple seconds to type that LLDB command.

(I'm testing this in C++ code, but Obj-C shouldn't be much different.)

I do use `p` if I'm already focused on the LLDB console with my hands on the keyboard. 

As original Mac UI guru Bruce Tognazzini discovered back in the 1980s, our brain overestimates the time taken to interact with a UI element with a mouse, and underestimates the time taken to remember-and-type a command. He hypothesized this is because typing requires information retrieval, which keeps the brain busier than the low-level motor task of moving the mouse. (Tognazzini was measuring how long it took to choose a Mac menu command with the mouse vs. typing a command-key. He found that in most cases the mouse was significantly faster, but the person doing the task insisted that the command-key was faster, despite what the clock said. The exceptions were, IIRC, the common commands like Cmd-C that we've all memorized and hardwired into our motor cortexes.)

—Jens


Alex Zavatone
 

I guess what I’m not making clear is that this recurses and displays all the string values for the properties in your object.  Maybe I’m not using the preview properly, but I’ve always felt like I’m waiting for the overlay to appear and show the contents or I have to expand the object, find the property, expand that and then mouseover it when simply doing a po on the containing object with autoDescribe is much faster.



On Jan 28, 2021, at 1:31 PM, Jens Alfke <jens@...> wrote:



On Jan 28, 2021, at 9:20 AM, Alex Zavatone via groups.io <zav@...> wrote:

It is.  When you use my little tool, you’ll see that it’s MUCH faster to simply type 
po [myObject autoDescribe] 
...
than it is to wait for the hover preview to show anything except an image.  Trrrry it.  

I did. It isn't. The hover shows up in something like ¼ second. (If the value is a struct and I have to flip it open, that's maybe another ½ second.) I'm a fast typist, but it would take me a couple seconds to type that LLDB command.

(I'm testing this in C++ code, but Obj-C shouldn't be much different.)

I do use `p` if I'm already focused on the LLDB console with my hands on the keyboard. 

As original Mac UI guru Bruce Tognazzini discovered back in the 1980s, our brain overestimates the time taken to interact with a UI element with a mouse, and underestimates the time taken to remember-and-type a command. He hypothesized this is because typing requires information retrieval, which keeps the brain busier than the low-level motor task of moving the mouse. (Tognazzini was measuring how long it took to choose a Mac menu command with the mouse vs. typing a command-key. He found that in most cases the mouse was significantly faster, but the person doing the task insisted that the command-key was faster, despite what the clock said. The exceptions were, IIRC, the common commands like Cmd-C that we've all memorized and hardwired into our motor cortexes.)

—Jens


Steve Mills
 

On Jan 28, 2021, at 13:16, Alex Zavatone via groups.io <zav=mac.com@groups.io> wrote:

I’ve got the console set to appear automatically.
Me too.

The floating window never showed me what I needed and it was always a delay before it showed anything. If if did what I needed, then I would have abandoned autoDescribe years ago.

How is the command complicated? It’s po followed by the object and the method. It’s 3 words. Once it’s set up in your .pch, it works as an extension to every NSObject.
It’s complicated compared to pointing the mouse. Typing “po [a_Very_Long_Variable_Name_Craeted_By_Some_Nerd autoDescribe]” takes a helluva lot longer than pointing the mouse, especially when you realize the typo I made and have to type it all over again or at least hit up-arrow and correct the mistake. Nobody said your autoDescribe doesn’t show more info. You keep saying it’s faster to use, which it’s not.

No, I’m not overriding anything. This is an extension to NSObject adding a new method. That’s it.
I know. I only mentioned overriding description because it’s something anybody can easily do. It’s still not faster than hovering the mouse.

Use it or don’t. I’m just letting people know it exists.
Fine. Great. Just don’t say it’s faster to use.

Steve via iPad


Alex Zavatone
 

On Jan 28, 2021, at 2:06 PM, Steve Mills via groups.io <sjmills=mac.com@groups.io> wrote:

On Jan 28, 2021, at 13:16, Alex Zavatone via groups.io <zav=mac.com@groups.io> wrote:

I’ve got the console set to appear automatically.
Me too.

The floating window never showed me what I needed and it was always a delay before it showed anything. If if did what I needed, then I would have abandoned autoDescribe years ago.

How is the command complicated? It’s po followed by the object and the method. It’s 3 words. Once it’s set up in your .pch, it works as an extension to every NSObject.
It’s complicated compared to pointing the mouse. Typing “po [a_Very_Long_Variable_Name_Craeted_By_Some_Nerd autoDescribe]” takes a helluva lot longer than pointing the mouse, especially when you realize the typo I made and have to type it all over again or at least hit up-arrow and correct the mistake. Nobody said your autoDescribe doesn’t show more info. You keep saying it’s faster to use, which it’s not.
It’s less complicated than pointing the mouse, expanding the object, finding your property, expanding that, waiting for it to display and then realizing that you need some other value too.

The whole idea is to dump the contents of an object that have a string representation so that you have all the object’s data - and that of its children - as well. Then you can browse that data as needed.

No, I’m not overriding anything. This is an extension to NSObject adding a new method. That’s it.
I know. I only mentioned overriding description because it’s something anybody can easily do. It’s still not faster than hovering the mouse.

Use it or don’t. I’m just letting people know it exists.
Fine. Great. Just don’t say it’s faster to use.
It is faster to use. I wasted so much time picking through the preview window and having to go back and forth between finding values that I can say with 7 years of experience using this that it’s a shitload faster.

For that one string in the property that you know is right at the top level of your object, you’re right, the preview window is faster. When you need to check on multiple properties within an object, isn’t it faster to simply dump the properties and values of the object to the console - without having to write a describe method? In my experience it is.