[SOLVED] Debugger not working.

CodeLite installation/troubleshooting forum
Thelo
CodeLite Curious
Posts: 4
Joined: Mon Mar 17, 2014 6:38 pm
Genuine User: Yes
IDE Question: C++
Contact:

[SOLVED] Debugger not working.

Post by Thelo »

Hi there! This is my first post ever, and I frankly could use some help with a problem. Before posting I have been googling and searching through these forums, tried some possible solutions and ended in the same place. I have installed several CodeLite versions and I am still having the same problem. My problem is that I can't make the debugger work properly, as it ignores all my breakpoints but one and exits with no apparent error. The funniest thing is that, while trying a trick I saw on these forums for a debugger problem, it works. The trick consists in running 'strace codelite' from the terminal. That way, I can debug normally, but all the rest is quite slow as the terminal is tracing all the system calls between the program and the OS. Anyway, I should be able to work without having to do any workarounds...

A bit of my background: I'm not a professional or skilled programmer, just an amateur, and I was following some tutorials on how to create rogue like games. I happened to produce a not entirely working first piece of code, so I ended trying to debug it, learning about CodeLite on the way. In the end, I have spent more time trying to solve this problem than actually coding!

Your codelite version: 6.0
Is it a self compiled version of codelite: YES.
Your OS: Xubuntu Linux 13.10 64bits
Compiler version: gcc 4.8
Your GDB version: 7.6.1

My code:

Code: Select all

#include "ncurses.h"

int main ()
{
**	initscr();
	clear();
	noecho();
	cbreak();
	curs_set(0);
	keypad(stdscr, true);

	printw("Press any key to continue or 'q', 'Q' to quit");
	char pressedKey = getch();
	clear();

	char mainChar = '@';
	int row, col;
	row = 10;
	col = 10;

	while (pressedKey != 'q' || pressedKey != 'Q') {
		mvwaddch(stdscr, row, col, mainChar);
		refresh();

		pressedKey = getch();

		switch (pressedKey) {
		case ('8'):
			row--;
			break;

		case ('2'):
			row++;
			break;

		case ('4'):
			col--;
			break;

		case ('6'):
			col++;
			break;

		case ('7'):
			row--;
			col--;
			break;

		case ('9'):
			row--;
			col++;
			break;

		case ('1'):
			row++;
			col--;
			break;

		case ('3'):
			row++;
			col++;
			break;
		}
	}
	endwin();
}

Debugger output:

Code: Select all

Using gdbinit file: /tmp/codelite_gdbinit.txt
Current working dir: /home/thelo/C++/CodeLite/MyRogueLike
Launching gdb from : ./Debug
Starting debugger  : gdb --command="/tmp/codelite_gdbinit.txt" --tty=/dev/pts/0 --interpreter=mi "./MyRogueLike"
DEBUG>>set unwindonsignal on
DEBUG>>set breakpoint pending on
DEBUG>>set width 0
DEBUG>>set height 0
DEBUG>>set print elements 200
DEBUG>>python
DEBUG>>import sys
DEBUG>>sys.path.insert(0, '/home/thelo/.codelite/gdb_printers')
DEBUG>>from libstdcxx.v6.printers import register_libstdcxx_printers
DEBUG>>register_libstdcxx_printers (None)
DEBUG>>from qt4 import register_qt4_printers
DEBUG>>register_qt4_printers (None)
DEBUG>>from wx import register_wx_printers
DEBUG>>register_wx_printers (None)
DEBUG>>end
DEBUG>>00000034-break-insert -f "\"/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:13\""
DEBUG>>00000035-break-insert -f "\"/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:14\""
DEBUG>>00000036-break-insert -f "\"/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:16\""
DEBUG>>00000037-break-insert -f "\"/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:21\""
DEBUG>>00000038-break-insert -f "\"/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:22\""
DEBUG>>00000039-break-insert -f "\"/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:25\""
DEBUG>>00000040-break-insert -f "\"/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:26\""
DEBUG>>00000041-break-insert -f "\"/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:5\""
Debug session started successfully!
DEBUG>>00000042-exec-arguments 
DEBUG>>00000043-exec-run 
DEBUG>>=thread-group-added,id="i1"
=thread-group-added,id="i1"
DEBUG>>~"GNU gdb (GDB) 7.6.1-ubuntu\n"
GNU gdb (GDB) 7.6.1-ubuntu
DEBUG>>~"Copyright (C) 2013 Free Software Foundation, Inc.\n"
Copyright (C) 2013 Free Software Foundation, Inc.
DEBUG>>~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type "show copying"\nand "show warranty" for details.
DEBUG>>~"This GDB was configured as \"x86_64-linux-gnu\".\nFor bug reporting instructions, please see:\n"
This GDB was configured as "x86_64-linux-gnu".\nFor bug reporting instructions, please see:
DEBUG>>~"<http://www.gnu.org/software/gdb/bugs/>...\n"
<http://www.gnu.org/software/gdb/bugs/>...
DEBUG>>~"Reading symbols from /home/thelo/C++/CodeLite/MyRogueLike/Debug/MyRogueLike..."
Reading symbols from /home/thelo/C++/CodeLite/MyRogueLike/Debug/MyRogueLike...
DEBUG>>~"done.\n"
done.
DEBUG>>&"Traceback (most recent call last):\n"
DEBUG>>&"  File \"<string>\", line 4, in <module>\n"
DEBUG>>&"  File \"/home/thelo/.codelite/gdb_printers/libstdcxx/v6/printers.py\", line 54\n"
DEBUG>>&"    raise ValueError, \"Cannot find type %s::%s\" % (str(orig), name)\n"
DEBUG>>&"                    ^\n"
DEBUG>>&"SyntaxError: invalid syntax\n"
DEBUG>>&"/tmp/codelite_gdbinit.txt:14: Error in sourced command file:\n"
DEBUG>>&"Error while executing Python code.\n"
DEBUG>>&"set unwindonsignal on\n"
DEBUG>>=cmd-param-changed,param="unwindonsignal",value="on"
=cmd-param-changed,param="unwindonsignal",value="on"
DEBUG>>^done
DEBUG>>&"set breakpoint pending on\n"
DEBUG>>=cmd-param-changed,param="breakpoint pending",value="on"
=cmd-param-changed,param="breakpoint pending",value="on"
DEBUG>>^done
DEBUG>>&"set width 0\n"
DEBUG>>=cmd-param-changed,param="width",value="4294967295"
=cmd-param-changed,param="width",value="4294967295"
DEBUG>>^done
DEBUG>>&"set height 0\n"
DEBUG>>=cmd-param-changed,param="height",value="4294967295"
=cmd-param-changed,param="height",value="4294967295"
DEBUG>>^done
DEBUG>>&"set print elements 200\n"
DEBUG>>^done
DEBUG>>&"python\n"
DEBUG>>&"Traceback (most recent call last):\n"
DEBUG>>&"  File \"<string>\", line 3, in <module>\n"
DEBUG>>&"  File \"/home/thelo/.codelite/gdb_printers/libstdcxx/v6/printers.py\", line 54\n"
DEBUG>>&"    raise ValueError, \"Cannot find type %s::%s\" % (str(orig), name)\n"
DEBUG>>&"                    ^\n"
DEBUG>>&"SyntaxError: invalid syntax\n"
DEBUG>>&"Error while executing Python code.\n"
DEBUG>>^error,msg="Error while executing Python code."
^error,msg="Error while executing Python code."
DEBUG>>00000034^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400a56",func="main()",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="13",thread-groups=["i1"],times="0",original-location="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:13"}
Found the breakpoint ID!
Storing debugger breakpoint Id=1
Successfully set breakpoint 1 at: /home/thelo/C++/CodeLite/MyRogueLike/main.cpp:13
DEBUG>>00000035^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400a68",func="main()",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="14",thread-groups=["i1"],times="0",original-location="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:14"}
Found the breakpoint ID!
Storing debugger breakpoint Id=2
Successfully set breakpoint 2 at: /home/thelo/C++/CodeLite/MyRogueLike/main.cpp:14
DEBUG>>00000036^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400a6d",func="main()",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="16",thread-groups=["i1"],times="0",original-location="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:16"}
Found the breakpoint ID!
Storing debugger breakpoint Id=3
Successfully set breakpoint 3 at: /home/thelo/C++/CodeLite/MyRogueLike/main.cpp:16
DEBUG>>00000037^done,bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400a7f",func="main()",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="21",thread-groups=["i1"],times="0",original-location="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:21"}
Found the breakpoint ID!
Storing debugger breakpoint Id=4
Successfully set breakpoint 4 at: /home/thelo/C++/CodeLite/MyRogueLike/main.cpp:21
DEBUG>>00000038^done,bkpt={number="5",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400a84",func="main()",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="22",thread-groups=["i1"],times="0",original-location="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:22"}
Found the breakpoint ID!
Storing debugger breakpoint Id=5
Successfully set breakpoint 5 at: /home/thelo/C++/CodeLite/MyRogueLike/main.cpp:22
DEBUG>>00000039^done,bkpt={number="6",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400abc",func="main()",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="25",thread-groups=["i1"],times="0",original-location="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:25"}
Found the breakpoint ID!
Storing debugger breakpoint Id=6
Successfully set breakpoint 6 at: /home/thelo/C++/CodeLite/MyRogueLike/main.cpp:25
DEBUG>>00000040^done,bkpt={number="7",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400ace",func="main()",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="26",thread-groups=["i1"],times="0",original-location="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:26"}
Found the breakpoint ID!
Storing debugger breakpoint Id=7
Successfully set breakpoint 7 at: /home/thelo/C++/CodeLite/MyRogueLike/main.cpp:26
DEBUG>>00000041^done,bkpt={number="8",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400a15",func="main()",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="5",thread-groups=["i1"],times="0",original-location="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:5"}
Found the breakpoint ID!
Storing debugger breakpoint Id=8
Successfully set breakpoint 8 at: /home/thelo/C++/CodeLite/MyRogueLike/main.cpp:5
DEBUG>>=cmd-param-changed,param="args",value=""
=cmd-param-changed,param="args",value=""
DEBUG>>00000042^done
>> Debuggee process ID: 6791
DEBUG>>=thread-group-started,id="i1",pid="6791"
=thread-group-started,id="i1",pid="6791"
DEBUG>>=thread-created,id="1",group-id="i1"
=thread-created,id="1",group-id="i1"
DEBUG>>00000043^running
Continuing...
DEBUG>>*running,thread-id="all"
*running,thread-id="all"
DEBUG>>=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
DEBUG>>=library-loaded,id="/lib/x86_64-linux-gnu/libncurses.so.5",target-name="/lib/x86_64-linux-gnu/libncurses.so.5",host-name="/lib/x86_64-linux-gnu/libncurses.so.5",symbols-loaded="0",thread-group="i1"
=library-loaded,id="/lib/x86_64-linux-gnu/libncurses.so.5",target-name="/lib/x86_64-linux-gnu/libncurses.so.5",host-name="/lib/x86_64-linux-gnu/libncurses.so.5",symbols-loaded="0",thread-group="i1"
DEBUG>>=library-loaded,id="/lib/x86_64-linux-gnu/libtinfo.so.5",target-name="/lib/x86_64-linux-gnu/libtinfo.so.5",host-name="/lib/x86_64-linux-gnu/libtinfo.so.5",symbols-loaded="0",thread-group="i1"
=library-loaded,id="/lib/x86_64-linux-gnu/libtinfo.so.5",target-name="/lib/x86_64-linux-gnu/libtinfo.so.5",host-name="/lib/x86_64-linux-gnu/libtinfo.so.5",symbols-loaded="0",thread-group="i1"
DEBUG>>=library-loaded,id="/lib/x86_64-linux-gnu/libc.so.6",target-name="/lib/x86_64-linux-gnu/libc.so.6",host-name="/lib/x86_64-linux-gnu/libc.so.6",symbols-loaded="0",thread-group="i1"
=library-loaded,id="/lib/x86_64-linux-gnu/libc.so.6",target-name="/lib/x86_64-linux-gnu/libc.so.6",host-name="/lib/x86_64-linux-gnu/libc.so.6",symbols-loaded="0",thread-group="i1"
DEBUG>>=library-loaded,id="/lib/x86_64-linux-gnu/libdl.so.2",target-name="/lib/x86_64-linux-gnu/libdl.so.2",host-name="/lib/x86_64-linux-gnu/libdl.so.2",symbols-loaded="0",thread-group="i1"
=library-loaded,id="/lib/x86_64-linux-gnu/libdl.so.2",target-name="/lib/x86_64-linux-gnu/libdl.so.2",host-name="/lib/x86_64-linux-gnu/libdl.so.2",symbols-loaded="0",thread-group="i1"
DEBUG>>=breakpoint-modified,bkpt={number="8",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400a15",func="main()",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="5",thread-groups=["i1"],times="1",original-location="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:5"}
=breakpoint-modified,bkpt={number="8",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400a15",func="main()",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="5",thread-groups=["i1"],times="1",original-location="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:5"}
DEBUG>>*stopped,reason="breakpoint-hit",disp="keep",bkptno="8",frame={addr="0x0000000000400a15",func="main",args=[],file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="5"},thread-id="1",stopped-threads="all",core="7"
DEBUG>>00000044-stack-info-frame
DEBUG>>00000045-break-list
DEBUG>>00000044^done,frame={level="0",addr="0x0000000000400a15",func="main",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="5"}
DEBUG>>00000045^done,BreakpointTable={nr_rows="8",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="18",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400a56",func="main()",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="13",thread-groups=["i1"],times="0",original-location="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:13"},bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400a68",func="main()",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="14",thread-groups=["i1"],times="0",original-location="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:14"},bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400a6d",func="main()",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="16",thread-groups=["i1"],times="0",original-location="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:16"},bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400a7f",func="main()",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="21",thread-groups=["i1"],times="0",original-location="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:21"},bkpt={number="5",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400a84",func="main()",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="22",thread-groups=["i1"],times="0",original-location="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:22"},bkpt={number="6",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400abc",func="main()",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="25",thread-groups=["i1"],times="0",original-location="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:25"},bkpt={number="7",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400ace",func="main()",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="26",thread-groups=["i1"],times="0",original-location="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:26"},bkpt={number="8",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400a15",func="main()",file="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",fullname="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp",line="5",thread-groups=["i1"],times="1",original-location="/home/thelo/C++/CodeLite/MyRogueLike/main.cpp:5"}]}
DEBUG>>00000046-data-disassemble -s "$pc -100" -e "$pc + 100" -- 0
DEBUG>>00000047-data-disassemble -s "$pc" -e "$pc + 1" -- 0
DEBUG>>00000046^done,asm_insns=[{address="0x00000000004009b1",func-name="register_tm_clones",offset="49",inst="(bad)  "},{address="0x00000000004009b2",func-name="register_tm_clones",offset="50",inst="mov    $0x601098,%edi"},{address="0x00000000004009b7",func-name="register_tm_clones",offset="55",inst="jmpq   *%rdx"},{address="0x00000000004009b9",func-name="register_tm_clones",offset="57",inst="nopl   0x0(%rax)"},{address="0x00000000004009c0",func-name="__do_global_dtors_aux",offset="0",inst="cmpb   $0x0,0x2006e1(%rip)        # 0x6010a8 <completed.6992>"},{address="0x00000000004009c7",func-name="__do_global_dtors_aux",offset="7",inst="jne    0x4009da <__do_global_dtors_aux+26>"},{address="0x00000000004009c9",func-name="__do_global_dtors_aux",offset="9",inst="push   %rbp"},{address="0x00000000004009ca",func-name="__do_global_dtors_aux",offset="10",inst="mov    %rsp,%rbp"},{address="0x00000000004009cd",func-name="__do_global_dtors_aux",offset="13",inst="callq  0x400950 <deregister_tm_clones>"},{address="0x00000000004009d2",func-name="__do_global_dtors_aux",offset="18",inst="pop    %rbp"},{address="0x00000000004009d3",func-name="__do_global_dtors_aux",offset="19",inst="movb   $0x1,0x2006ce(%rip)        # 0x6010a8 <completed.6992>"},{address="0x00000000004009da",func-name="__do_global_dtors_aux",offset="26",inst="repz retq "},{address="0x00000000004009dc",func-name="__do_global_dtors_aux",offset="28",inst="nopl   0x0(%rax)"},{address="0x00000000004009e0",func-name="frame_dummy",offset="0",inst="cmpq   $0x0,0x200418(%rip)        # 0x600e00"},{address="0x00000000004009e8",func-name="frame_dummy",offset="8",inst="je     0x400a08 <frame_dummy+40>"},{address="0x00000000004009ea",func-name="frame_dummy",offset="10",inst="mov    $0x0,%eax"},{address="0x00000000004009ef",func-name="frame_dummy",offset="15",inst="test   %rax,%rax"},{address="0x00000000004009f2",func-name="frame_dummy",offset="18",inst="je     0x400a08 <frame_dummy+40>"},{address="0x00000000004009f4",func-name="frame_dummy",offset="20",inst="push   %rbp"},{address="0x00000000004009f5",func-name="frame_dummy",offset="21",inst="mov    $0x600e00,%edi"},{address="0x00000000004009fa",func-name="frame_dummy",offset="26",inst="mov    %rsp,%rbp"},{address="0x00000000004009fd",func-name="frame_dummy",offset="29",inst="callq  *%rax"},{address="0x00000000004009ff",func-name="frame_dummy",offset="31",inst="pop    %rbp"},{address="0x0000000000400a00",func-name="frame_dummy",offset="32",inst="jmpq   0x400980 <register_tm_clones>"},{address="0x0000000000400a05",func-name="frame_dummy",offset="37",inst="nopl   (%rax)"},{address="0x0000000000400a08",func-name="frame_dummy",offset="40",inst="jmpq   0x400980 <register_tm_clones>"},{address="0x0000000000400a0d",func-name="main()",offset="0",inst="push   %rbp"},{address="0x0000000000400a0e",func-name="main()",offset="1",inst="mov    %rsp,%rbp"},{address="0x0000000000400a11",func-name="main()",offset="4",inst="sub    $0x10,%rsp"},{address="0x0000000000400a15",func-name="main()",offset="8",inst="callq  0x400870 <initscr@plt>"},{address="0x0000000000400a1a",func-name="main()",offset="13",inst="callq  0x400900 <clear@plt>"},{address="0x0000000000400a1f",func-name="main()",offset="18",inst="callq  0x4008e0 <noecho@plt>"},{address="0x0000000000400a24",func-name="main()",offset="23",inst="callq  0x400850 <cbreak@plt>"},{address="0x0000000000400a29",func-name="main()",offset="28",inst="mov    $0x0,%edi"},{address="0x0000000000400a2e",func-name="main()",offset="33",inst="callq  0x400910 <curs_set@plt>"},{address="0x0000000000400a33",func-name="main()",offset="38",inst="mov    0x200666(%rip),%rax        # 0x6010a0 <stdscr>"},{address="0x0000000000400a3a",func-name="main()",offset="45",inst="mov    $0x1,%esi"},{address="0x0000000000400a3f",func-name="main()",offset="50",inst="mov    %rax,%rdi"},{address="0x0000000000400a42",func-name="main()",offset="53",inst="callq  0x400860 <keypad@plt>"},{address="0x0000000000400a47",func-name="main()",offset="58",inst="mov    $0x400bf8,%edi"},{address="0x0000000000400a4c",func-name="main()",offset="63",inst="mov    $0x0,%eax"},{address="0x0000000000400a51",func-name="main()",offset="68",inst="callq  0x4008a0 <printw@plt>"},{address="0x0000000000400a56",func-name="main()",offset="73",inst="mov    0x200643(%rip),%rax        # 0x6010a0 <stdscr>"},{address="0x0000000000400a5d",func-name="main()",offset="80",inst="mov    %rax,%rdi"},{address="0x0000000000400a60",func-name="main()",offset="83",inst="callq  0x4008d0 <wgetch@plt>"},{address="0x0000000000400a65",func-name="main()",offset="88",inst="mov    %al,-0xa(%rbp)"},{address="0x0000000000400a68",func-name="main()",offset="91",inst="callq  0x400900 <clear@plt>"},{address="0x0000000000400a6d",func-name="main()",offset="96",inst="movb   $0x40,-0x9(%rbp)"},{address="0x0000000000400a71",func-name="main()",offset="100",inst="movl   $0xa,-0x8(%rbp)"},{address="0x0000000000400a78",func-name="main()",offset="107",inst="movl   $0xa,-0x4(%rbp)"}]
DEBUG>>00000047^done,asm_insns=[{address="0x0000000000400a15",func-name="main()",offset="8",inst="callq  0x400870 <initscr@plt>"}]
DEBUG>>00000048-exec-step
DEBUG>>00000048^running
Continuing...
DEBUG>>*running,thread-id="1"
*running,thread-id="1"
DEBUG>>=thread-exited,id="1",group-id="i1"
=thread-exited,id="1",group-id="i1"
DEBUG>>=thread-group-exited,id="i1",exit-code="01"
=thread-group-exited,id="i1",exit-code="01"
DEBUG>>*stopped,reason="exited",exit-code="01"
Program exited normally.
Debug session ended
Last edited by Thelo on Wed Mar 19, 2014 10:47 am, edited 1 time in total.
solewalker
CodeLite Veteran
Posts: 75
Joined: Thu Mar 14, 2013 11:24 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: [HELP] Debugger not working.

Post by solewalker »

If you have posted your code correctly, then It's apparent what the problem is. The problem lies in line no. 4

Code: Select all

**   initscr();
Just remove those ** from your code like below, what are they doing there by the way.

Code: Select all

initscr();
EDIT: And for debugger to work properly, your program first need to compile properly. It's not compiling because of this error, hence no debugging.
Thelo
CodeLite Curious
Posts: 4
Joined: Mon Mar 17, 2014 6:38 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: [HELP] Debugger not working.

Post by Thelo »

Wow!! Sorry, my bad.

Those two asterisks are not part of the code. I just wanted to say where my first breakpoint was and forgot to mention it! The code compiles and runs, and I already found the little error that started all the debugging quest, but the debugging problem persists. :(
User avatar
Jarod42
CodeLite Expert
Posts: 240
Joined: Wed Sep 30, 2009 5:54 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: [HELP] Debugger not working.

Post by Jarod42 »

Have you compiled with `-g` (debug information) compiler option ?
Are you sure you don't have `-s` (strip symbol) linker option ?

Note: It seems that you have error because your gdb is not python (2.7) compatible. maybe upgrade the script may help.
Thelo
CodeLite Curious
Posts: 4
Joined: Mon Mar 17, 2014 6:38 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: [HELP] Debugger not working.

Post by Thelo »

I finally found the solution, after many tries and googling hours. Thanks to all for the help!

This was the page that led me to the solution: https://bugs.kde.org/show_bug.cgi?id=116700

The solution, for me, was to add TERM=xterm in Settings -> Environment Variables. Hope this will be helpful if someone is in my place in the future. ;)
Gibbon1
CodeLite Expert
Posts: 167
Joined: Fri Jul 22, 2011 5:32 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: [HELP] Debugger not working.

Post by Gibbon1 »

Thank you very very much for leaving bread crumbs for those that follow.
Thelo
CodeLite Curious
Posts: 4
Joined: Mon Mar 17, 2014 6:38 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: [SOLVED] Debugger not working.

Post by Thelo »

By the way, I just realized how baddly I placed this thread in the "Using CodeLite" section instead of in the "Help" one. If someone can please move it to the proper section I'd appreciate. :)
Last edited by Thelo on Wed Mar 19, 2014 1:46 pm, edited 1 time in total.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: [SOLVED] Debugger not working.

Post by eranif »

Thelo wrote:If someone can please move it to the proper section
Done

Eran
Make sure you have read the HOW TO POST thread
Post Reply