Debugger - continue from address?

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

I'm using Studio 7.0.1931 to debug assembler. The only way I've found of skipping to a given address, then continuing execution from there, is this:

 

- start a debug session and stop at a breakpoint

- open Debug | Processor Status

- manually edit the PC's value

- from there use, say, Continue.

 

I thought it'd be as simple as, say, right-clicking a source instruction and choosing "Continue from". I can't help thinking I've missed something but I can't find it. Any tips welcome.

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

Go on. No rational human would want to crash a real application in this way.
You would normally set a breakpoint at the required address and run the application. It will stop when it gets there.
.
Yes, you can deliberately corrupt the stack or jump to a random PC. You have found this for yourself
I sugest that you live with it. Think very carefully before you do something like this.

.
David.

Last Edited: Sat. Nov 3, 2018 - 08:16 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for your quick reply David. The reason not to "set a breakpoint at the required address ..." is simple: there's behaviour leading up to the required address which I want to avoid, and certainly no risk of corrupting the stack or crashing the application.

 

As for living with it, the need was there decades ago; machine-code monitors supported it then and on-chip debug does now, so I don't see that the requirement's become irrational or support for it unwarranted. It just seems harder from Studio's GUI than it needs to be, which is why I thought I'd missed something.

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

I agree 100%.   The fundamental low-level functions of Monitor or Debugger is to read and set CPU registers and PC.

 

Nowadays,  most people will want to view the program from a High Level Language.    They might not even know what CPU is used or understand registers, PC, Flags, ...

 

It seems wise to design a GUI from the HLL point of view.   Yes,  the machine registers are accessible if you want them.    But they would not be the default window views.

 

If you specifically choose the register and disassembly views,   I would assume that you have some knowledge about CPU structure and behaviour.   I would also expect you to understand stack frames,  interrupt response, ...

 

This is not the knowledge of the first time Studio User.   Many do not know which way to put a hat on.

 

David.

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

Nowadays,  most people will want to view the program from a High Level Language.

 

An HLL debugger on assembler sourcefiles? Respect!

 

But they would not be the default window views.

 

Right-click access to a standard on-chip-debug function? Yeah, GUIs offer it. Not this one from the sound of things.

 

This is not the knowledge of the first time Studio User.

 

I'll repost in the forum for non-first-time Studio users.

 

I would assume that you have some knowledge about CPU structure and behaviour.

 

Aw shucks.

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

Surely you just pick the line where you want execution to continue from, right click and use "set PC to here"" or whatever it's called?

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

lloydb wrote:
> Nowadays, most people will want to view the program from a High Level Language. An HLL debugger on assembler sourcefiles? Respect!

 

Studio is expected to be used for HLL debugging.    And the default behaviour is to display source code.

 

You can rearrange your Window views to suit debugging an ASM program.

 

Oh,  and I just tried to alter the PC in the Simulator "Processor Status Window".    AS7.0 does not like it.

 

Yes,  in the days of "Machine Code Monitors",   I would occasionally set the PC manually.    It has never occurred to me to do  this in an AVR or ARM program.

I might change a variable's value to influence the program flow.    I have never tried to change the PC directly.

 

Of course I can always manipulate the return address on the Stack.    (and that is exactly what a MCM does anyway)

 

David.

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

So I haven't read all of the above......You can do things several ways

 

You can run the code up to wherever you want by right clicking on the desired line and select Run to cursor or you can put a breakpoint as above.