Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
ka7ehk
PostPosted: Jul 08, 2012 - 06:46 AM
10k+ Postman


Joined: Nov 22, 2002
Posts: 12193
Location: Tangent, OR, USA

You know, it is really disconcerting to do a swap on a uint8 which reads 35 in the Locals view window and have it become 50, only to realize that it is displaying in bloody decimal!

Now, I have looked and looked and looked for a way to change the display format to hex or binary. Just by accident, I discovered that command-click brings up a contextual menu with the option for hex display.

Well, bugger the fact that it changes everything, not just the line you clicked. But, on top of that, there is no option for binary!

So, how can you view binary? Any hope for some lines decimal, some hex, and some binary? Or, will I have more success with a pint of the best local brew?

Jim

_________________
Jim Wagner
Oregon Research Electronics, Consulting Div.
Tangent, OR, USA

"The only thing standing between us and victory is defeat" P.G.Wodhouse in Wooster & Jeeves series
 
 View user's profile Send private message  
Reply with quote Back to top
larryvc
PostPosted: Jul 08, 2012 - 06:53 AM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

The brew, and I will join you, just as soon as I am allowed to do that again. Wink

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
meolsen
PostPosted: Jul 08, 2012 - 10:13 AM
Resident


Joined: Jul 27, 2011
Posts: 582
Location: Atmel, Norway

Quote:

So, how can you view binary? Any hope for some lines decimal, some hex, and some binary? Or, will I have more success with a pint of the best local brew?


I've added an Improvement request into our internal bugtracker, AVRSV-3637 for further reference

_________________
:: Morten
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Jul 08, 2012 - 10:55 AM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62922
Location: (using avr-gcc in) Finchingfield, Essex, England

I thought you just right clicked and said "view as hex" on the context menu - certainly the case in the generic VS2010.

EDIT: yes it's there, see picture...

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
meolsen
PostPosted: Jul 08, 2012 - 11:32 AM
Resident


Joined: Jul 27, 2011
Posts: 582
Location: Atmel, Norway

Yes, but this is not on a per-line basis

_________________
:: Morten
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Jul 08, 2012 - 11:43 AM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62922
Location: (using avr-gcc in) Finchingfield, Essex, England

You sure about that? I just tried it and switching it (actually quite annoyingly) switches the display of everything. I'd actually like it be able to set different interpretations per item myself.

(oh and it appears to be "sticky" from one debug session to the next).

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
JohanEkdahl
PostPosted: Jul 08, 2012 - 12:41 PM
10k+ Postman


Joined: Mar 27, 2002
Posts: 18749
Location: Lund, Sweden

I would go look in the Visual Studio documentation (i.e. somewhere in MSDN from Microsoft). For items in the watch window you can (or at least you could) specify how the item should be displayed by adding a specifier to the item (e.g. the name of the variable was followed by a comma and a character specifying format and stuff). This works in the watch window, so you'd have to add to that window rather than looking in locals.

Not sure if it did binary, though...

I do not have the specific documentation on this handy right now, and I have other stuff in the pipe. Come back if you could not find it and I'll have a go at locating it tonight. (And, IIRC it has even been discussed here at 'freaks before).

And Jim, the hex to binary converter is right on the top of your shoulders.. Wink
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
meolsen
PostPosted: Jul 08, 2012 - 01:24 PM
Resident


Joined: Jul 27, 2011
Posts: 582
Location: Atmel, Norway

clawson wrote:
You sure about that? I just tried it and switching it (actually quite annoyingly) switches the display of everything. I'd actually like it be able to set different interpretations per item myself.

(oh and it appears to be "sticky" from one debug session to the next).


This is in the watch window i presume? Jim talked about the locals/autos window

_________________
:: Morten
 
 View user's profile Send private message  
Reply with quote Back to top
JohanEkdahl
PostPosted: Jul 08, 2012 - 01:29 PM
10k+ Postman


Joined: Mar 27, 2002
Posts: 18749
Location: Lund, Sweden

OK, I had a look. And Atmel seems to have screwed this up..

1) The documentation on how to do this in Visual Studio is e.g. here: http://msdn.microsoft.com/en-us/library/75w45ekt

2) Trying out a uint8_t variable b in Atmel Studio 6 (1863), and trying to display it as "b,x" in Atmel Studio you get this info about what is being watched: "unsigned long" and the value displayed (always zero?) does not reflect the value of the variable. Specifying ",o" for octal seems to work though (almost as good as hex - just as easy to convert to binary in your carbon-based converter).

HTH!
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
clawson
PostPosted: Jul 08, 2012 - 03:41 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62922
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

This is in the watch window i presume? Jim talked about the locals/autos window

You are telling me the different windows that dio the same operate differently?

EDIT: no you are wrong. The locals window operates exactly the same was the watch window and what's more the same "Hexadecimal display" option applies to both and is sticky.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
meolsen
PostPosted: Jul 08, 2012 - 04:04 PM
Resident


Joined: Jul 27, 2011
Posts: 582
Location: Atmel, Norway

clawson wrote:
Quote:

This is in the watch window i presume? Jim talked about the locals/autos window

You are telling me the different windows that dio the same operate differently?

EDIT: no you are wrong. The locals window operates exactly the same was the watch window and what's more the same "Hexadecimal display" option applies to both and is sticky.


No, they should do the same. When I change to hex display, all variables are shown in hex. As I read the question, Jim wanted to change this on a per-line basis

_________________
:: Morten
 
 View user's profile Send private message  
Reply with quote Back to top
larryvc
PostPosted: Jul 08, 2012 - 05:24 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

Hi Morten,

Have you seen this thread?

http://www.avrfreaks.net/index.php?name ... highlight=

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
larryvc
PostPosted: Jul 08, 2012 - 05:39 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

JohanEkdahl wrote:
OK, I had a look. And Atmel seems to have screwed this up..

Specifying ",o" for octal seems to work though (almost as good as hex - just as easy to convert to binary in your carbon-based converter).

HTH!

Specifying ,b displays in binary, at least it does on my Win7 machine. Wink

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
JohanEkdahl
PostPosted: Jul 08, 2012 - 06:04 PM
10k+ Postman


Joined: Mar 27, 2002
Posts: 18749
Location: Lund, Sweden

Windows version sould not have anything to do with this. I tried a few different format specifiers and you can see the result below. I also attached a screen shot of what it looks like when you use the context menu to shift to hexadecimal.

Results:
- The hex format specifier does not work
- The binary format specifier does not work
- The octal format specifier works
- The "Hexadecimal display" alternative in the context menu affects all items but those that have working format specifiers (i.e. octal).
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
larryvc
PostPosted: Jul 08, 2012 - 06:15 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

Hmm?

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc


Last edited by larryvc on Jul 08, 2012 - 06:20 PM; edited 2 times in total
 
 View user's profile Send private message  
Reply with quote Back to top
JohanEkdahl
PostPosted: Jul 08, 2012 - 06:17 PM
10k+ Postman


Joined: Mar 27, 2002
Posts: 18749
Location: Lund, Sweden

My Atmel Studio is build 1863. What's yours, Larry?
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
larryvc
PostPosted: Jul 08, 2012 - 06:22 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

The same, Johan. It's weird that we are not getting the same results.

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
JohanEkdahl
PostPosted: Jul 08, 2012 - 06:39 PM
10k+ Postman


Joined: Mar 27, 2002
Posts: 18749
Location: Lund, Sweden

If you have a small test project/solution, can you attach a ZIP of it here? I have attached mine below..
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
meolsen
PostPosted: Jul 08, 2012 - 07:05 PM
Resident


Joined: Jul 27, 2011
Posts: 582
Location: Atmel, Norway

larryvc wrote:
Hi Morten,

Have you seen this thread?

http://www.avrfreaks.net/index.php?name ... highlight=


I have read it. I'll look through the threads when I get into office on monday and make some bugzez

_________________
:: Morten
 
 View user's profile Send private message  
Reply with quote Back to top
ka7ehk
PostPosted: Jul 08, 2012 - 08:23 PM
10k+ Postman


Joined: Nov 22, 2002
Posts: 12193
Location: Tangent, OR, USA

Never having used "Visual Studio" (my visual desktop programming environment is RealBasic), this is totally new to me. So, thanks for the hints. I'll give it a try.

Jim

_________________
Jim Wagner
Oregon Research Electronics, Consulting Div.
Tangent, OR, USA

"The only thing standing between us and victory is defeat" P.G.Wodhouse in Wooster & Jeeves series
 
 View user's profile Send private message  
Reply with quote Back to top
larryvc
PostPosted: Jul 08, 2012 - 09:05 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

JohanEkdahl wrote:
If you have a small test project/solution, can you attach a ZIP of it here? I have attached mine below..

No need. I did get the same result as you with the code you provided. You are using "b" as a variable and it seems to be (pun intended) confusing the format specifier software. Try with a variable name that is not one of the format specifiers and you will see it works. Is this considered a BUG or a Feature?

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
JohanEkdahl
PostPosted: Jul 08, 2012 - 09:13 PM
10k+ Postman


Joined: Mar 27, 2002
Posts: 18749
Location: Lund, Sweden

Quote:

Is this considered a BUG or a Feature?

I don't have a Visual Studio (C/C++) installation handy ATM, so I can not check if the same problem occurs there. When I get to one I will check, and if this is specific for Atmel Studio then I will consider it an Atmel Studio bug or deficiency and report it in the tracker.

OT: On the fun side - I got tired of the spell checker marking "Atmel" so I decided to add it to the dictionary. On my way there I observed that the FF spell checker suggest changing "Atmel" to "Oatmeal". Very Happy
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
larryvc
PostPosted: Jul 08, 2012 - 09:27 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

JohanEkdahl wrote:
OT: On the fun side - I got tired of the spell checker marking "Atmel" so I decided to add it to the dictionary. On my way there I observed that the FF spell checker suggest changing "Atmel" to "Oatmeal". Very Happy

Smile My doctor has recommended that for breakfast every day, with a sprinkle of ground flax seed. Oatmeal of course, not Atmel. Wink

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
ka7ehk
PostPosted: Jul 08, 2012 - 09:33 PM
10k+ Postman


Joined: Nov 22, 2002
Posts: 12193
Location: Tangent, OR, USA

Can't figure out how to add the format specifier to the name. I click, I right-click and command-click. All over the %^^&%(&* Locals window (including the variable name). I can edit value but nowhere to add the specifier.

Enlightenment is desired.

Ugggh, OK, I can add a watch, with the variable name and format specifier. Ugly but works.

Jim

_________________
Jim Wagner
Oregon Research Electronics, Consulting Div.
Tangent, OR, USA

"The only thing standing between us and victory is defeat" P.G.Wodhouse in Wooster & Jeeves series
 
 View user's profile Send private message  
Reply with quote Back to top
larryvc
PostPosted: Jul 08, 2012 - 09:40 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

Use the watch window and enter the variable you want to watch, a comma, and the format specifier. The locals window is handled automatically by the debugger and cannot be changed as far as I know.

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
JohanEkdahl
PostPosted: Jul 08, 2012 - 09:50 PM
10k+ Postman


Joined: Mar 27, 2002
Posts: 18749
Location: Lund, Sweden

Yes - that is what I said initially. It works in the watch window. Not in the locals window, the content of which is auto-generated and not possible to edit in detail by the user.

Ugly? Not IMO. For quick debugging I can rely on e.g. the Locals window, but for any prolonged debugging work I like to set up my own watch's so that I have and see exactly what I need.

Please note that you can add a watch quickly by right-clicking the variable name anywhere in the editor and select "Add watch".

(What really sucks is that you can not re-order what you have in a watch window. That's Microsoft...).
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
meolsen
PostPosted: Jul 09, 2012 - 07:40 AM
Resident


Joined: Jul 27, 2011
Posts: 582
Location: Atmel, Norway

I've added another bug on the errors in the format specifiers

_________________
:: Morten
 
 View user's profile Send private message  
Reply with quote Back to top
larryvc
PostPosted: Jul 09, 2012 - 04:59 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

meolsen wrote:
I've added another bug on the errors in the format specifiers

Thank you. Smile

Is there an external tracking number for that?

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
meolsen
PostPosted: Jul 09, 2012 - 05:21 PM
Resident


Joined: Jul 27, 2011
Posts: 582
Location: Atmel, Norway

larryvc wrote:
meolsen wrote:
I've added another bug on the errors in the format specifiers

Thank you. Smile

Is there an external tracking number for that?


No, but I can carve out the internal one if someone wants it. I've commented that it may be wise to give a hint in this thread with the resolution, but this at best a "should" (not all devs have the balls to talk to you freaks Smile )

EDIT: If you want to make a bug in the external system, then to that by all means, and just PM me with the link and I'll link it up with our internal one

_________________
:: Morten
 
 View user's profile Send private message  
Reply with quote Back to top
larryvc
PostPosted: Jul 09, 2012 - 06:05 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

I would, but I am not sure what specific bugs you covered in your internal report. Can you PM me with that.

Quote:
not all devs have the...

Call them chicken, it got Marty McFly all fired up. Laughing

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
meolsen
PostPosted: Jul 09, 2012 - 06:33 PM
Resident


Joined: Jul 27, 2011
Posts: 582
Location: Atmel, Norway

Quote:

I would, but I am not sure what specific bugs you covered in your internal report. Can you PM me with that.



Done


Quote:

Quote:
not all devs have the...

Call them chicken, it got Marty McFly all fired up.

Very Happy

_________________
:: Morten
 
 View user's profile Send private message  
Reply with quote Back to top
JohanEkdahl
PostPosted: Jul 09, 2012 - 07:22 PM
10k+ Postman


Joined: Mar 27, 2002
Posts: 18749
Location: Lund, Sweden

Quote:

Quote:

I would, but I am not sure what specific bugs you covered in your internal report. Can you PM me with that.



Done

I'll take the error report off my to-do list then?
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
larryvc
PostPosted: Jul 09, 2012 - 07:39 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

Yes Johan, I am following up on that now. I will post the trace numbers as soon as I finish.

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
larryvc
PostPosted: Jul 09, 2012 - 08:10 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

Bugs 2562 and 2563 are now reported. Morten if you want to add tags to match your inside reports please do.

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
ka7ehk
PostPosted: Jul 09, 2012 - 09:11 PM
10k+ Postman


Joined: Nov 22, 2002
Posts: 12193
Location: Tangent, OR, USA

As a matter of sane user interface, I would like to suggest that a click (right click or command click) in the heading of the value column produce a contextual menu that applies to the whole column. But, a click in any individual value produce a menu that includes a value change and format selection for that particular value.

Jim

_________________
Jim Wagner
Oregon Research Electronics, Consulting Div.
Tangent, OR, USA

"The only thing standing between us and victory is defeat" P.G.Wodhouse in Wooster & Jeeves series
 
 View user's profile Send private message  
Reply with quote Back to top
lagger
PostPosted: Jul 10, 2012 - 10:47 AM
Hangaround


Joined: Sep 04, 2005
Posts: 193


Johan, have you tried using h instead of x to specify hexadecimal?
 
 View user's profile Send private message  
Reply with quote Back to top
JohanEkdahl
PostPosted: Jul 10, 2012 - 12:01 PM
10k+ Postman


Joined: Mar 27, 2002
Posts: 18749
Location: Lund, Sweden

Quote:

Johan, have you tried using h instead of x to specify hexadecimal?

No, because looking at Microsofts documentation that does not make sense. There it says that 'h' is a
Quote:
long or short prefix for: d, i, u, o, x, X

(my emphasis)
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
larryvc
PostPosted: Jul 10, 2012 - 05:02 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

JohanEkdahl wrote:
Quote:

Johan, have you tried using h instead of x to specify hexadecimal?

No, because looking at Microsofts documentation that does not make sense. There it says that 'h' is a
Quote:
long or short prefix for: d, i, u, o, x, X

(my emphasis)

Yes, but, then there is this: Wink

http://msdn.microsoft.com/en-us/library/e514eeby

It seems to be left up to who writes the visualizer.

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
danv
PostPosted: Jul 11, 2012 - 09:24 AM
Hangaround


Joined: Mar 01, 2011
Posts: 157
Location: Atmel, Norway

Here's an excerpt from the "official" Atmel help available on the help menu. Look it up in the help to get the nice formatting Smile

Help Viewer Home
* Atmel Studio User Guide
* * Debugging
* * * QuickWatch,Watch, Locals...
* * * * Expression formatting


Last edited by danv on Jul 11, 2012 - 09:46 AM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
danv
PostPosted: Jul 11, 2012 - 09:38 AM
Hangaround


Joined: Mar 01, 2011
Posts: 157
Location: Atmel, Norway

I gave it a quick try in AS6 and this is what I get on a UC3 simulator project:
Code:
int main(void)
{
  volatile int a=0;
  volatile unsigned char b=0;
  while(1)
  {
    a++;
    b++;
  }
}


Here's my watch view:
Code:
      a   3   int{registers}@R08
      a,x   0x00000003   int{registers}@R08
      b   2   unsigned char@0x3ffb ([R13]+3)
      b,x   0x02   unsigned char@0x3ffb ([R13]+3)
      b,b   2   unsigned long
      b,b1   0b00000010   unsigned char@0x3ffb ([R13]+3)
      a,b   2   unsigned long
      a,b1   0b00000011   int{registers}@R08
      a,o   000000000003   int{registers}@R08


So the modifiers seem to work with the exception of "comma b", where I had to force a size (b1) to get it to work. Will check why now...

Dan
 
 View user's profile Send private message  
Reply with quote Back to top
meolsen
PostPosted: Jul 11, 2012 - 09:43 AM
Resident


Joined: Jul 27, 2011
Posts: 582
Location: Atmel, Norway

Quote:

Here's an excerpt from the "official" Atmel help available on the help menu. Look it up in the help to get the nice formatting

Help Viewer Home
* Atmel Studio User Guide
* * Debugging
* * * QuickWatch,Watch, Locals...
* * * * Expression formatting


http://www.atmel.no/webdoc/atmelstudio/ ... xpressions

_________________
:: Morten
 
 View user's profile Send private message  
Reply with quote Back to top
danv
PostPosted: Jul 11, 2012 - 09:57 AM
Hangaround


Joined: Mar 01, 2011
Posts: 157
Location: Atmel, Norway

Mistery solved:

If the expression after comma is a symbol, it will be treated as a formatting string only if it doesn't evaluate as a variable. In the latter case, comma behaves as the regular C comma operator.

We should probably change this to avoid the current confusion when people have local variables named "o", "x" or "b".

dan
 
 View user's profile Send private message  
Reply with quote Back to top
larryvc
PostPosted: Jul 11, 2012 - 05:23 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

danv wrote:
Mistery solved:

If the expression after comma is a symbol, it will be treated as a formatting string only if it doesn't evaluate as a variable. In the latter case, comma behaves as the regular C comma operator.

We should probably change this to avoid the current confusion when people have local variables named "o", "x" or "b".

dan

Yes dan, I solved that in this post above. Wink

http://www.avrfreaks.net/index.php?name ... 894#972894

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
danv
PostPosted: Jul 12, 2012 - 08:42 AM
Hangaround


Joined: Mar 01, 2011
Posts: 157
Location: Atmel, Norway

Hehe, I guess this was a feature that turned out to be a bug. For reference, I've removed the feature (or bug) from the future release of Studio Smile
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits