User forums > Using Code::Blocks

debugging

(1/2) > >>

kateausten:
Hello,

I'm new to codeblocks and I'm learning how to debug.
I am facing some problems :
- how can I watch the fields of a structure that is an element of an array ?
I managed to show the elements of the array, but there are just memory addresses and I'd like to access these addresses to show its fields.
- is it possible to debug a gui application, and if it is then how ?

Thanks

oBFusCATed:

--- Quote from: kateausten on April 25, 2010, 09:14:03 am ---Hello,

I'm new to codeblocks and I'm learning how to debug.
I am facing some problems :
- how can I watch the fields of a structure that is an element of an array ?

--- End quote ---

Have you tried to add: my_array[0] in the watches window?
If the variable is int**my_array[5], you can use *my_array[3]...


--- Quote from: kateausten on April 25, 2010, 09:14:03 am ---I managed to show the elements of the array, but there are just memory addresses and I'd like to access these addresses to show its fields.
- is it possible to debug a gui application, and if it is then how ?

--- End quote ---

A GUI app is the same (on win32 it's almost the same) as console app, so there is no difference in the way one debugs it.

kateausten:
I'm sorry I don't understand how it is the same.
Would you mind explaining to me how to debug a GUI then ?
I'm trying to debug a SDL application. The process terminates with status 3 when I click on a specific item.
Hence I added a breakpoint to the line saying "case SDL_MOUSEBUTTONUP:" (= if a mouse click has been detected).
When I click on debug/continue (to start the debugger), the application opens and I see it in the task bar but I can't see its contents (it is reduced and I can't restore it).

I'm using svn 6088.

oBFusCATed:
Hm, a GUI app is the same thing as a non GUI app, both are C/C++ applications.
The difference is only in the used frameworks.

If your app crashes, the debugger should catch it and break on the line of the crash.
If this is not happening there is something wrong in your setup.

kateausten:
okay, I believe you... can you help me to figure out what's wrong in my setup then?
I must say that I have no problem debugging console applications though.

Navigation

[0] Message Index

[#] Next page

Go to full version