Page 1 of 1

breakpoints being ignored(freebsd9)...HELP!!!

Posted: Thu Mar 29, 2012 10:14 pm
by jffrystn222
Just installed v3.5.5375 and trying to compile and debug a small 'hello world' application. Any breakpoints I set are being ignored. The code is below..

I have tried: Going into debug settings and having it load all breakpoints after main and also automatically stopping at main. Doesn't help.

My config is the following:

OS: FreeBSD-9.0-RELEASE-i386
Machine: MacBook Pro running paralell's
Gnome-2x

CodeLite was built from source from the ports tree.

Please advise.

Thanks,

Jeff

Code: Select all

#include <iostream>

int  main(int argc, char **argv)
{
	char c;
	
	printf("hello world\n");
	
	std::cout << "press any key to continue..." << std::endl;

	c = getchar();
	
	return 0;
}

Re: breakpoints being ignored(freebsd9)...HELP!!!

Posted: Fri Mar 30, 2012 11:50 am
by eranif
Can you please post the complete debug log?
See here for how to obtain it:
viewtopic.php?f=3&t=804

Eran

Re: breakpoints being ignored(freebsd9)...HELP!!!

Posted: Fri Mar 30, 2012 5:49 pm
by jffrystn222
Hi Eran...looks like there is an options that is being set ( 'f' ) that gdb is not recognizing...maybe version issue with gdb? or settings in codelite?

Code: Select all

freebsd9-mac# gdb --version
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd".

As you suggested: debug output follows:

Code: Select all

Using gdbinit file: /root/.gdbinit
Current working dir: /usr/home/documents/develop/scratchpad/test/test_console_1
Launching gdb from : ./Debug
Starting debugger  : gdb --tty=/dev/pts/5 --interpreter=mi "./test_console_1"
DEBUG>>set unwindonsignal on
DEBUG>>catch throw
DEBUG>>set width 0
DEBUG>>set height 0
DEBUG>>set print elements 200
DEBUG>>00000005-break-insert -f -t main
DEBUG>>00000006-break-insert -f -t main
Debug session started successfully!
DEBUG>>00000007-exec-arguments 
DEBUG>>00000008-exec-run 
DEBUG>>~"GNU gdb 6.1.1 [FreeBSD]\n"
GNU gdb 6.1.1 [FreeBSD]
DEBUG>>~"Copyright 2004 Free Software Foundation, Inc.\n"
Copyright 2004 Free Software Foundation, Inc.
DEBUG>>~"GDB is free software, covered by the GNU General Public License, and you are\n"
GDB is free software, covered by the GNU General Public License, and you are
DEBUG>>~"welcome to change it and/or distribute copies of it under certain conditions.\n"
welcome to change it and/or distribute copies of it under certain conditions.
DEBUG>>~"Type \"show copying\" to see the conditions.\n"
Type "show copying" to see the conditions.
DEBUG>>~"There is absolutely no warranty for GDB.  Type \"show warranty\" for details.\n"
There is absolutely no warranty for GDB.  Type "show warranty" for details.
DEBUG>>~"This GDB was configured as \"i386-marcel-freebsd\"..."
This GDB was configured as "i386-marcel-freebsd"...
DEBUG>>~"\n"

DEBUG>>&"set unwindonsignal on\n"
DEBUG>>^done
DEBUG>>&"catch throw\n"
DEBUG>>&"Function \"__cxa_throw\" not defined.\n"
DEBUG>>^error,msg="Function \"__cxa_throw\" not defined."
^error,msg="Function \"__cxa_throw\" not defined."
DEBUG>>&"set width 0\n"
DEBUG>>^done
DEBUG>>&"set height 0\n"
DEBUG>>^done
DEBUG>>&"set print elements 200\n"
DEBUG>>^done
DEBUG>>&"mi_cmd_break_insert: Unknown option ``f''\n"
DEBUG>>00000005^error,msg="mi_cmd_break_insert: Unknown option ``f''"
mi_cmd_break_insert: Unknown option ``f''
DEBUG>>&"mi_cmd_break_insert: Unknown option ``f''\n"
DEBUG>>00000006^error,msg="mi_cmd_break_insert: Unknown option ``f''"
mi_cmd_break_insert: Unknown option ``f''
DEBUG>>00000007^done
DEBUG>>00000008^running
Continuing...

Re: breakpoints being ignored(freebsd9)...HELP!!!

Posted: Sat Mar 31, 2012 1:54 pm
by DavidGH
Hi Jeff,
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004
Wow! There've been a few gdb releases since then...
DEBUG>>&"mi_cmd_break_insert: Unknown option ``f''\n"
-f is the gdb MI-interface way of saying: "if necessary, create a pending breakpoint". Presumably it wasn't available 8 years ago.

The good news is, you can turn off pending breakpoints in the Debugger Settings dialog. The bad news: though unchecking that option stops CodeLite doing 'set breakpoint pending on' during initialisation, the -f is hard-wired into the break-insert command. That's a bug that, though normally harmless, clearly isn't to you. I'll fix it.

Meanwhile, is it possible on FreeBSD to upgrade your gdb? (On Linux at least, it's not difficult to build your own.) If it is, that will be a slightly good idea for other reasons too. If not, you can fix your CodeLite by removing the '-f' from the several instances of 'break-insert -f' in Debugger/debuggergdb.cpp, then rebuilding.

Regards,

David

Re: breakpoints being ignored(freebsd9)...HELP!!!

Posted: Sat Mar 31, 2012 3:09 pm
by DavidGH
If not, you can fix your CodeLite by removing the '-f' from the several instances of 'break-insert -f' in Debugger/debuggergdb.cpp, then rebuilding.
Fixed in trunk, r5439, so another alternative would be to build from svn.

Re: breakpoints being ignored(freebsd9)...HELP!!!

Posted: Sat Mar 31, 2012 5:22 pm
by jffrystn222
Thank you David! - Everything is working now.

I upgraded to gdb7.4 and also seems to be working well!

-Jeff