Code::Blocks Forums
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
As usual while waiting for the next release - don't forget to check the
nightly builds
in the forum.
Home
Help
Search
Login
Register
Code::Blocks Forums
»
User forums
»
Help
»
How to access array elements during debugging C++?
« previous
next »
Send this topic
Print
Pages: [
1
]
Go Down
Author
Topic: How to access array elements during debugging C++? (Read 8073 times)
a6146319
Single posting newcomer
Posts: 5
How to access array elements during debugging C++?
«
on:
August 18, 2014, 12:38:52 pm »
Hello, I am new to Code::Blocks and have a question in debugging. How I can access array elements during debugging? Things get worse if I cannot access array or matrix elements while using a numerical library, such as eigen. If I create watch, it doesn't show contents or array or matrix. I read this
http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks#Script_support
link on debugging with Code::Blocks, but couldn't find what I needed. Any help or comments are very welcome.
BTW, I am using GNU GCC compiler, Code::Blocks 13.12 on Windows.
Logged
oBFusCATed
Developer
Lives here!
Posts: 13413
Re: How to access array elements during debugging C++?
«
Reply #1 on:
August 18, 2014, 08:03:06 pm »
1. Right click -> Properties
2. Enable Treat as array
3. Specify start and count
4. Press Ok and you should be able to see your array
Logged
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]
a6146319
Single posting newcomer
Posts: 5
Re: How to access array elements during debugging C++?
«
Reply #2 on:
August 19, 2014, 12:27:15 am »
Thanks for your reply. What about if I am using a numerical library such as eigen? Your method does not work there. Is there any different way by which I can extract elements of an array or matrix using eigen (or other) library?
Logged
oBFusCATed
Developer
Lives here!
Posts: 13413
Re: How to access array elements during debugging C++?
«
Reply #3 on:
August 19, 2014, 01:28:59 am »
It depends on the library. If you're using new enough GDB you can probably write a python pretty printers for the data structures of your library.
Logged
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]
Send this topic
Print
Pages: [
1
]
Go Up
« previous
next »
Code::Blocks Forums
»
User forums
»
Help
»
How to access array elements during debugging C++?