I am trying to debug code using gdb, but when I try to watch my variable color it say this
No symbol "color" in current context.
The variable is a int and is clearly in the scope. the code is as follow
int color=0;
if(color==0)
color=1;
and my debugger is passed the declaration of the variable.
I am only doing, with a break poi...
I ssh into a remote linux sever from my Mac, and run gdbtui to debug a program. The source code displays, but the cursor line in the source code window frequently is not highlighted. I can enter commands such as 'next' and 'list' in the command line window, but the source code window doesn't redraw correctly. It sometimes shows lines in ...
When I build and test on the device, the Xcode console automatically goes into gdb mode, which makes it much easier to do stack traces. However, when I test on the simulator the console does not use gdb. I've looked everywhere for a preference setting but can't find anything.
How can you use gdb when using the simulator?
...
In the following code, I am able to check with the debugger the values of self and childView.
[self.navigationController pushViewController:childView animated:YES];
However, I am not able to see the value of self.navigationController. How can I check if it is nil?
...
I use a debugging script that runs several related processes in succession with the debugger. I'm currently using -x to execute several commands automatically (such as run). How can I make gdb quit automatically when the debugged process successfully terminates? Adding a quit command to the command file will cause that command to be hand...
Is there a way to test if a convenience variable has been set in gdb?
For example:
(gdb) if $_exitcode == 0
>quit
>end
Invalid type combination in equality test.
(gdb) p $_exitcode
$1 = void
$_exitcode is void because it is not set until the program terminates. The closest available construct is init-if-undefined, but this would r...
As I see, it's impossible to figure out what is in an STL map using NetBeans.
Is there any plugin/trick/solution that will allow me to print out all values from a map in debug mode?
As far as I know it's using GDB for debugging C++ applications. I've found some nice GDB macros for STL containers (here: http://sourceware.org/ml/gdb/2008...
While debugging a C program in gdb I have a breakpoint in a for loop. I cannot print the value of "i" ( I get : No symbol "i" in current context.). I can print the value of all the other variables. Is it normal?
Here is the loop:
for (i=0; i < datasize; i++){
if ( feature_mask[i] > 0 ){
k = feature_mask[i] - 1;
...
Hi All,
I'm a Visual Studio user and is used to breakpoints for debugging. Now I'm working in a linux environment and is using Eclipse as an IDE. I'm a newbie in linux and eclipse. I don't have any idea how to use gdb in eclipse. I tried using gdb in command line, but is not as easy as having a UI.
How do I use gdb in eclipse?
...
Suppose, in a debugging session I have an address which unfortunately points to some rubbish. And I want to examine memory around it to see what's located near. As expected, the following error occurs:
(gdb) x/64 $t5
0x842da7ac: Cannot access memory at address 0x842da7ac
So, the question is: is there any way to read a range of add...
Update: if you've added symbolic breakpoints and they're not working, uh, "wait awhile". After posting this and moving on and doing something else in the project, I then had an objc_exception_throw caught at some point.
I've been adding -[NSException raise] and objc_exception_throw as symbolic breakpoints to all my projects and it's wor...
How do I get the address of a certain variable in gdb, with the command line that is.
Edit :
It doesn't work in constructor.
...
I'm debugging a reference leak in a GObject-based application. GObject has a simple built-in mechanism to help with such matters: you can set the g_trap_object_ref variable in gobject.c to the object that you care about, and then every ref or unref of that object will hit a breakpoint instruction (via G_BREAKPOINT()).
So sure enough, th...
How is organized the debug information in a compiled C/C++ program ?
What does it contain ?
How the debug information is used by the debugger, e.g. gdb and how can I read the debug information better than nm or objdump?
...
I am developing a unix console application on OS X. I just updated three statically linked libraries (hdf5 and its dependents szip and z). After a rebuild all, the application exits code 1 immediately after launch. I'm unaware of how to explore the problem further in gdb because nothing is on the stack by the time the app exits. I di...
Is it possible to save/dump core file using gdb? Sometimes I want to save file to analyze it later.
...
I am trying to debug a core file generated by a C++ binary without debug symbols. In order to do effective debugging, I need the debug symbols, so I've recompiled the same code with -g option in order to generate debug symbols in the recompiled binary. Can I now debug the same core file generated by the first binary (without debug symb...
If I run the following PHP code on the command line I get the expected result:
php -r 'var_dump(ldap_connect("ldaps://ldaps.example.com", 636));'
resource(4) of type (ldap link)
However if I put this in a PHP script
<?php ldap_connect("ldaps://ldaps.example.com", 636); ?>
Apache drops the connection, for example this is what cURL r...
I am trying to use GDB's reverse debugging with a Django application. I get it running in GDB, but I can't make it run backwards.
I stopped my Django app with Ctrl-Z and then entered reverse-next at the gdb prompt, getting the error message "Target multi-thread does not support this command."
Am I doing it wrong? Isn't this possible?...
I'm debugging a Cocoa app, which calls the system libraries. I get debug symbols for my own code, but not the system libraries, which stops me debugging any further. How can I get debug symbols for the system library.
I'm using gdb, compiling against the 10.5 SDK on 10.6.4 (gcc 4.2).
Here is the stack-trace I'd like to get symbols for:...