No function parameters in debugger?
-
- CodeLite Enthusiast
- Posts: 23
- Joined: Thu Oct 30, 2008 1:40 am
- Contact:
No function parameters in debugger?
Hi,
Not sure if this is new to v6, but I'm having a problem where I can't see function parameter locals in the 'Locals' window - it's only showing locals declared within the function.
Is there something I need to enable perhaps?
Bye!
Mark
Not sure if this is new to v6, but I'm having a problem where I can't see function parameter locals in the 'Locals' window - it's only showing locals declared within the function.
Is there something I need to enable perhaps?
Bye!
Mark
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: No function parameters in debugger?
Can you please submit a screenshot?
Eran
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Enthusiast
- Posts: 23
- Joined: Thu Oct 30, 2008 1:40 am
- Contact:
Re: No function parameters in debugger?
I'll try!
I'm no gdb expert, but I kind of expected 'frames', 'tx', 'ty', and 'scale' (and 'this'!) to appear in the lower right hand debugger/locals panel, but they don't.
The same thing happens all the way down the call stack.
I've try clicking the 'refresh' button.
The only potentially weird thing I can think of is that the assert is my own inlined version - hence the mystery local 'cond' I guess.
Codelite version is 6.0.
I'm no gdb expert, but I kind of expected 'frames', 'tx', 'ty', and 'scale' (and 'this'!) to appear in the lower right hand debugger/locals panel, but they don't.
The same thing happens all the way down the call stack.
I've try clicking the 'refresh' button.
The only potentially weird thing I can think of is that the assert is my own inlined version - hence the mystery local 'cond' I guess.
Codelite version is 6.0.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: No function parameters in debugger?
I just tried a simple function and I got the function arguments. I think its something that has to do with gdb and your function
Here is a screenshot: Can you try a simpler example?
Do you get tooltip for those arguments? (hover them with the mouse OR (depend on your settings) Hover+CTRL click)
Eran
Here is a screenshot: Can you try a simpler example?
Do you get tooltip for those arguments? (hover them with the mouse OR (depend on your settings) Hover+CTRL click)
Eran
You do not have the required permissions to view the files attached to this post.
Make sure you have read the HOW TO POST thread
-
- CodeLite Enthusiast
- Posts: 23
- Joined: Thu Oct 30, 2008 1:40 am
- Contact:
Re: No function parameters in debugger?
Ok, the problem seems to be related to trying to view locals further down the callstack.
For example, with the below code, if I run/continue the code until it breakpoints inside test(), then double click on main() in the callstack window, I can't view the locals for 'main' in the locals window - only 'x' and 'y' from test(), and there's something weird about these too - I can't 'open' them the way I can usually open std::string objects in the locals window.
Here's the state of things with the code stopped inside test() (so test and main are both on the callstack) but main 'selected' by double click in the callstack window. I would have expected to see argc and argv in the locals window. Also, in this state I can get tooltips for argc and argv, but not x, y and z in test().
Maybe it's my version of gdb/mingw, or I'm just doing it wrong or something, but I don't remember having any of these problems with v5...?
For example, with the below code, if I run/continue the code until it breakpoints inside test(), then double click on main() in the callstack window, I can't view the locals for 'main' in the locals window - only 'x' and 'y' from test(), and there's something weird about these too - I can't 'open' them the way I can usually open std::string objects in the locals window.
Here's the state of things with the code stopped inside test() (so test and main are both on the callstack) but main 'selected' by double click in the callstack window. I would have expected to see argc and argv in the locals window. Also, in this state I can get tooltips for argc and argv, but not x, y and z in test().
Code: Select all
#include <string>
void blah( const std::string &q ){
puts( "BREAKPOINT!" ); //breakpoint here...
}
void test( const std::string &x,const std::string &y ){
std::string z=x+y;
blah( z ); //and here!
}
int main( int argc,char **argv){
test( "Hello","World" ); //and here!
return 0;
}
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: No function parameters in debugger?
Your sample works fine here.
Did you try updating your gdb version?
Eran
Did you try updating your gdb version?
Eran
You do not have the required permissions to view the files attached to this post.
Make sure you have read the HOW TO POST thread
-
- CodeLite Enthusiast
- Posts: 23
- Joined: Thu Oct 30, 2008 1:40 am
- Contact:
Re: No function parameters in debugger?
The problem is with viewing locals that are *not* at the top of the callstack.
I've just checked, and it's happening on Linux too - latest updated 32 bit Ubuntu 14.04. Doesn't this make it less likely to be a gdb issue?
I'm used to working without a debugger, so it's not that big a deal, but it would definitely be nice to get it going. So please try this:
1) Create g++ console project with code below.
2) Toggle breakpoint on the puts() line in 'test2'.
3) Debug program.
4) When program stops, go to Debugger/Call Stack pane. (Note that on Windows, I actually have to click on a different tab and then click back to Call Stack before anything actually appears there - on Linux, it works first time).
5) Double click on 'main' in the Debugger/Call Stack pane.
6) Go back to Debugger/Locals pane - on both Windows and Linux, I can only see 'p' here. I would have expected to see 'argc' and 'argv'.
7) Ditto, try going to 'test' on the call stack. I can see 'z' and 'p' here (after clicking the refresh button in the Debugger/Locals pane). I would have expected to see 'x', 'y' and 'z'.
If you still can't reproduce, I'll give up!
I've just checked, and it's happening on Linux too - latest updated 32 bit Ubuntu 14.04. Doesn't this make it less likely to be a gdb issue?
I'm used to working without a debugger, so it's not that big a deal, but it would definitely be nice to get it going. So please try this:
1) Create g++ console project with code below.
2) Toggle breakpoint on the puts() line in 'test2'.
3) Debug program.
4) When program stops, go to Debugger/Call Stack pane. (Note that on Windows, I actually have to click on a different tab and then click back to Call Stack before anything actually appears there - on Linux, it works first time).
5) Double click on 'main' in the Debugger/Call Stack pane.
6) Go back to Debugger/Locals pane - on both Windows and Linux, I can only see 'p' here. I would have expected to see 'argc' and 'argv'.
7) Ditto, try going to 'test' on the call stack. I can see 'z' and 'p' here (after clicking the refresh button in the Debugger/Locals pane). I would have expected to see 'x', 'y' and 'z'.
Code: Select all
#include <stdio.h>
void test2( int p ){
puts( "TEST2" ); //breakpoint here!
}
void test( int x,int y ){
int z=x+y;
test2( z );
}
int main( int argc,char **argv ){
test( 10,20 );
return 0;
}
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: No function parameters in debugger?
Lucky for you, I was able to see what you meanmarksibly wrote:If you still can't reproduce, I'll give up!
When switching between frames, codelite used 2 commands to print the arguments:
Code: Select all
-stack-list-locals
-stack-list-arguments
I switched to using the new command:
Code: Select all
-stack-list-arguments
Fixed and committed in git head
If you are interested in gdb's MI stack manipulation commands, see here: https://sourceware.org/gdb/onlinedocs/g ... nipulation
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Enthusiast
- Posts: 23
- Joined: Thu Oct 30, 2008 1:40 am
- Contact:
Re: No function parameters in debugger?
Sweet! All fixed, thanks!