This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Kdevelop Debugging Problem

Tags: None
(comma "," separated)
mongrel
Registered Member
Posts
10
Karma
0

Kdevelop Debugging Problem

Mon Sep 23, 2013 4:08 am
When debugging, after stepping over a line with a variable, the button used to expand the variable disappears.

Here, before I step over lightNode, the expand button is showing and working.
Image

But after I step over it, the button disappers. It is the same to all variables.
Image

Last night, everything works perfectly. I then decided to use Kdevelop as my IDE and uninstalled other applications like CodeBlocks and Monodevelop.

I think there are packages that are also removed last night that affects Kdevelop's behavior because my Software Manager is also not functioning right (Installing Kdevelop takes 68mb but removing it only frees 5mb).

I already tried cleaning and updating. Also reinstalling Kdevelop a few times but it's still the same.
sudo apt-get autoremove && sudo apt-get autoclean
sudo apt-get update && sudo apt-get upgrade


I'm using Linux Mint 15 64bit. Kdevelop 4.4.1
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: Kdevelop Debugging Problem

Mon Sep 23, 2013 10:15 am
I doubt this is an installation problem.
Sizes calculated by package managers are often wrong in my experience, I'd ignore them.

As for the actual issue, the value of the pointer changes -- sure it's still valid after that line? Do you maybe even have a minimal example I could test?

Greetings,
Sven


I'm working on the KDevelop IDE.
mongrel
Registered Member
Posts
10
Karma
0

Re: Kdevelop Debugging Problem

Mon Sep 23, 2013 10:47 am
Hi, I'm sure its valid because its the same code I tested the night before which works fine. Plus, it is a template generated by the library I used.

Anyway, I reinstall my os and I will try Kdevelop again. I will let you know if it's fixed.
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: Kdevelop Debugging Problem

Mon Sep 23, 2013 10:52 am
As said I doubt it's a setup issue. It'd probably make more sense to post some example code which reproduces the issue. ;)


I'm working on the KDevelop IDE.
mongrel
Registered Member
Posts
10
Karma
0

Re: Kdevelop Debugging Problem

Tue Sep 24, 2013 6:12 am
I tested the code and the library I used in Eclipse CDT and this is what I got
Code: Select all
warning: can't find linker symbol for virtual table for `gameplay::Model' value
warning:   found `gameplay::Game::frame()' instead
warning: can't find linker symbol for virtual table for `gameplay::Model' value
warning:   found `gameplay::Game::frame()' instead
warning: can't find linker symbol for virtual table for `gameplay::Model' value
warning:   found `gameplay::Game::frame()' instead

The library I used is not mine, it is a game engine which can be found here- https://github.com/blackberry/GamePlay. The code I tried to debug is this https://github.com/blackberry/GamePlay/tree/master/template/src. The engine has a script to create a new project and it uses the template as a new project which is already a valid program that can be executed.

Here is the CmakeList.txt of the engine. I don't know if it matters but I only build the gameplay library and commented out the samples because it is too big to download.
Code: Select all
cmake_minimum_required(VERSION 2.6)

project(GamePlay)

set(GAMEPLAY_VERSION 1.7.0)
set(CMAKE_C_COMPILER_INIT g++)

# debug
message( "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}" )
if ( "${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG" )
    add_definitions(-D_DEBUG)
endif()

# architecture
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set(ARCH_DIR "x64")
else()
set(ARCH_DIR "x86")
endif()

# gameplay library
add_subdirectory(gameplay)

# gameplay samples
add_subdirectory(samples)

This is how I produce the library.
Code: Select all
cmake -DCMAKE_BUILD_TYPE=Debug ..
make -j4

This problem does not concern Kdevelop anymore, but any help is highly appreciated :<
mongrel
Registered Member
Posts
10
Karma
0

Re: Kdevelop Debugging Problem

Wed Sep 25, 2013 6:48 am
I tried it with this very simple code and its still the same. I already reformatted my computer and its the same with other IDE like Eclipse CDT. It's been days and I still have this problem. I already tried in different forums and stackoverflow.com but still no solution.

Here, I still cannot check the members of obj, the expand button disappears.
Code: Select all
//classa.h
#include <string>
class classA
{
public:
  std::string name;
  classA(std::string);
  std::string getName();
virtual ~classA();
};

//classa.cpp
#include "classa.h"
classA::classA(std::string x) : name(x)
{
}
std::string classA::getName()
{
  return name;
}
classA::~classA()
{
}

//main.cpp
#include <iostream>
#include <string>
#include "classa.h"
int main(int argc, char **argv) {
    std::cout << "Hello, world!" << std::endl;
   
    classA* obj = new classA("test");
    std::string x = obj->getName();
    std::cout << x;
   
    delete obj;
    return 0; 
}
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: Kdevelop Debugging Problem

Thu Sep 26, 2013 11:24 am
At which point does the button disappear, i.e. when you steop over which line?


I'm working on the KDevelop IDE.
mongrel
Registered Member
Posts
10
Karma
0

Re: Kdevelop Debugging Problem

Sat Sep 28, 2013 11:45 am
After I step over this line
Code: Select all
classA* obj = new classA("test");
Hovering the mouse pointer over the variable in the code editor shows it fine and with the expand button. if I click Watch this it will add it again in the Variables window under Auto. But it's better if the Variables window works correctly and I don't need to do more work hovering the mouse over the variables.

I don't know if this is related but I have this when I execute the code
Code: Select all
Problem: Include path resolver: Failed to extract new working directory    Source: Preprocessor    File:./main.cpp
Also, it uses /usr/bin/c++ when compiling and not g++.
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: Kdevelop Debugging Problem

Sat Sep 28, 2013 11:57 am
I didn't quite understand that... at which points does it work, and when does it stop working? ;)


I'm working on the KDevelop IDE.
mongrel
Registered Member
Posts
10
Karma
0

Re: Kdevelop Debugging Problem

Sat Sep 28, 2013 12:29 pm
I recreated the test code.

Here, when I begin debugging. In the Variables window, the expand button (+ button beside the variable) is showing.
Image
After I step over the line instantiating variable a, the button disappears.
Image
Hovering the mouse over object a.
Image
The problem I said in the previous reply
Image
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: Kdevelop Debugging Problem

Sat Sep 28, 2013 5:37 pm
That's indeed strange. Did you try if the problem also occurs in command-line gdb?

Greetings


I'm working on the KDevelop IDE.
mongrel
Registered Member
Posts
10
Karma
0

Re: Kdevelop Debugging Problem

Sun Sep 29, 2013 6:49 am
I do not know how to use gdb via command line. I always use an IDE when coding.
mongrel
Registered Member
Posts
10
Karma
0

Re: Kdevelop Debugging Problem

Sun Sep 29, 2013 7:48 am
Maybe the problem is in gdb version? I have this version - GNU gdb (GDB) 7.5.91.20130417-cvs-ubuntu

Don't you have any problems when debugging? What version of gdb are you using?
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: Kdevelop Debugging Problem

Sun Sep 29, 2013 11:11 am
I have 7.6.1...

Using it in CLI is quite easy, do this:

gdb <program name>
break main.cpp:linenumber
run
... then it will stop at the breakpoint you set, you can do "list" to see the surrounding code
print foo->bar will print property bar of pointer foo.
next will step to the next line.

If it works there, then it's an issue in kdevelop; if not, there's a different problem.
Possibly this is related to optimization gcc does...?

Greetings,
Sven


I'm working on the KDevelop IDE.


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]