tags:

views:

20

answers:

1

I just fired up totalview on my "hello world" application (c++) and i only get to view the assembly code.

Is there any settings/flags i need to set to view the source code? Menubar->View->Source As->Source does not work for me.

the application im trying to debug is just a cout << "Hello World" application, just to get the debugger up and running.

+1  A: 

Lets start with the simple stuff.

Did you compile your application with the '-g' debugging flag? The debugger relies on the compiler to provide it with a symbol table and line number table to map what happens in the executable back to your source code. Without that -g flag (or if you subsequently strip your application) that info won't be present and assembly debugging is the best you can hope for.

If you did compile with -g are the source and the executable all together in the same directory, or if not have they been moved since you compiled them? The compiler only knows the locations of the source and executable at the time they are created, if you move them around then sometimes the debugger won't be able to locate the source code file. In that case you might need to give it some help by defining a source code search path.

Write back here and let me know if -g fixed your problem. If not we can look into the search path and such.

Cheers, Chris

Chris Gottbrath
-g fixes it almost. when i start my application (not hello world, another more complex one) i start out with 2 breakpoints. one in the constructor of my class and one in some function in the same class that i use.first breakpoint is okey. it stops and i see where is stopped in sourecode. but when i make it run to the next breakpoint that im certain is reached, it shows me assembly... why is that?
Jason94