Studio with GCC - Line Numbers?

Go To Last Post
17 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What am I missing? I want Line Numbers shown in edit?
Usually it can be turned on as an option?

Also in debug, sometimes (?) it does not jump to the line with the error. It does state the line numbers.
but they are not show in the editor?

Stupid problem, but could save a lot of time using the simulator?

Using latest Studio 4 Version

Thanks for any Help!
Mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

By line numbers, do you mean memory addresses? That is what the debugger shows.

Sometimes, the code jumps to places you do not expect. That is because of the way C is constructed. If you view as "disassembled", it will show you where it is actually executing.

As I recall, the simulator does not show you the memory address of the currently executed instruction. Yes, it would be nice, but I don't think you can get it, there. But, you should be able to read it in the PC register.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I want Line Numbers shown in edit?
It doesn't exist in AS4, maybe AS5 has it, don't know.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Guys!

I was looking for the C edit window to show line numbers and having debug jump there!

I have used MPLAB mostly for Pics, I just could not find the option in Studio 4. I have been afraid to switch to Studio 5?

Great, I need to Know!!

Mike
A Tinkerer!
High in the Mountains, Crestline, Ca.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

By the way the line and column number is shown at the bottom of the screen for the line you click on.

Not what you want but of some help.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

and having debug jump there!

Can you explain what you mean by that?

If you are talking about placing breakpoints you just right-click a line and select "toggle breakpoint"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In AS5/5.1, check "Display Line Numbers" box in the Tools->Options screen, Text Editor->All Languages node in the list.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, I wanted to see line numbers on screen in my source.
Sounds like it is and option in Studio 5.

Thanks, I have been reluctant to go to Studio 5!

How is the experience! Are my projects going to find all the right stuff?

Mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I wanted to see line numbers on screen in my source.

I see this request from time to time. I've never understood it. If you want to go to a specific line almost every editor on earth supports ctrl-g and if this is for mapping line numbers reported in build errors to the right line in the edited text is there an IDE that does not simply support double-click on the error to get you there (surely this is one of the fundamental features of an IDE?) so what does it really matter to you whether the error is on line 37 or line 4825 ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's handy for mental bookmarks - makes it easier to note that "ok, I'm on line 123, gotta check something else and come back to it" and a few other reasons, so I like it on. Yes, I know some IDEs (AS5!) has bookmarks for thus purpose.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Yes, I know some IDEs (AS5!) has bookmarks for thus purpose.

I'm a luddite. I type @@@ as a marker to myself then Ctr-F,@@@ to get back ;-)

Editors that allow you to have split windows so you can have two views of the same document generally do away with the need for this.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Some explanation why I was wanting line numbers.

In the Studio 4 Editor it does NOT have an option to have line numbers, but on build shows where the errors are by line. Sometimes it will not jump to the error by clicking the error? I may be wrong, but that started me looking for the simple option to turn them on.

I have just loaded Studio 5. It takes an hour or more.
As mentioned above from a reply, if you look hard, you can turn the line numbers on.

Every editor I have ever used had this function, Except Studio 4?

Thanks for the help, now I am a Studio 5 beginner.
Mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Sometimes it will not jump to the error by clicking the error?

Then that is a SERIOUS bug in the IDE and the test case should be reported.

(AS4 did show line/column in the statusbar)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

AS4 did show line/column in the statusbar

So does AS5. And AS5 also has ctrl-G to go to a specific line.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am now trying Studio 5. Yes it has Line # Option.
BUT, I is huge! Took 20 minutes to download. Slow loading. And look at all the clutter at the top.
Way too many options, on a 22" screen, I can hardly make out the icons. Who wants all these features?
They changed the Run and other symbols just to confuse you? I don't think I could see the Icons on a laptop?

Also, in a simple program brought from Studio4, it clobbers a variable. In an timer0 interrupt I increment a count (defined at top of program as volatile unsigned int). I just want the timer0 to increment the count every interrupt, but Studio5 Simulator shows count rolls over at 8 bits? I never use timer0 count, but somehow it resets my bigger count? I can never test the count over 255. It is to control a model servo motor (variable pulse every 20 mS). It works fine in Studio 4. Could be some kind of optimization mode? I never found the options for that in Studio 5. Nor do I know enough about optimization to do anything with it!

So, I guess I am going back to Studio 4.
I ordered an Atmel Dragon from Mouser that will be my next adventure.

Studio 5 is NOT for me. I will go without line #!

This might should have been posted in Studio 5, but I am using WinAVR GCC

Thanks for all the help guys!

Mike, with all the snow melting in Crestline, Ca.
.,

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Who wants all these features?

You are perfectly free to customize the toolbars as you wish (show, hide, add or remove buttons).

Quote:

Could be some kind of optimization mode? I never found the options for that in Studio 5.

Project, Properties.
Toolchain tab.
Optimization in the tree view.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, I fixed my problem with the roll over. I used a wrong mask item for my interrupt when adding Timer1 along with timer0. So Timer1 must have causing a roll over interrupt, when I meant it to be on a hardware signal edge. All working now in SIM!

Found the Optimization was same setting as Studio4.

I am getting along better with Studio 5. Been using the stopwatch in the processor view for timing checks. Would like a better way, like a logic analyzer function similar to MPLAB for Pic?

So now awaiting to see the Dragon coming later this week!

Happy Camper Now, thanks for the time you guys took!
Mike