Netbeans 8.2 C++ debugging on Mac OSX - c++

I have been trying to enable debugging on NetBeans 8.2 C++ (OS X - Sierra - 10.12.5) without success. I have tried the following:
Using Mac Ports version of gdb with code-signing: result: gdb gives a standard error:
Unable to find Mach task port for process-id 3016: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
Using Mac's /usr/bin/llvm: result:
GDB has unexpectedly stopped with return 0
Anyone have any success getting this to work?

Related

Why GDB is crashing my program when break point is hit when using it from VSCode?

I'm using VSCode version 1.71.0 784b0177c56c607789f9638da7b6bf3230d47a8c x64 on Ubuntu Linux version 22.04.1 LTS. I'm compiling with GCC version 11.2.0 but the same problem occurs when the application is compiled with Clang 14.0.0 and Clang 16.0.0. My version of GDB is 12.0.90. I'm using C/C++ v.1.12.4 and CMake Tools v1.12.26 plugins for VSCode. I start debugging session with the CMake: Debug command by default assigned to the F5 shortcut. For some time the application I'm debugging started to crash when a breakpoint is hit. The exact message is the following:
Aborted (core dumped)
[1] + Aborted (core dumped) "/usr/bin/gdb" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-ifoflcfq.xvl" 1>"/tmp/Microsoft-MIEngine-Out-h4yklwfm.ghy"
The same problem does not occur when I'm using GDB from the command line and for that reason, I assume that the problem is related to the integration of GDB with VSCode. I cannot reproduce the problem with a small program. For a small test application, it works fine. At the beginning of debugging session, the following warning is displayed for a small amount of time before the terminal is cleared and the logs of the debugged application started to appear.
warning: GDB: Failed to set controlling terminal: Operation not permitted
I'm not sure whether it is somehow related to the problem.
This appears to be an issue with version GDB 12.09 and VS Code upgrading GDB to 12.1 by building from source resolved this issue for me as per this
https://github.com/microsoft/vscode-cpptools/issues/103#issuecomment-1151217772

cgdb not working macOS Sierra

I'm trying to run after setting a breakpoint in cgdb
Starting program: /path/to/my/executable
Unable to find Mach task port for process-id 1996: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
I tried both these guides with no success:
https://opensource.apple.com/source/lldb/lldb-69/docs/code-signing.txt
https://sourceware.org/gdb/wiki/BuildingOnDarwin
Running macOS Sierra 10.12.2 (16C67)

Eclipse debugger error in final launch sequence

For months I've been running Eclipse Juno with CDT to debug my C++ code. Up to a couple weeks ago (when I last tried to debug) everything was working fine. Recently I upgraded my eclipse juno installation to the latest. Building and executing the code in eclipse works fine. But now when I try to launch the eclipse debugger I get the following error:
Error in final launch sequence
Failed to execute MI command:
-break-insert -t -f main
Error message from debugger back end:
Cannot access memory at address 0xfffe9900
Cannot access memory at address 0xfffe9900
I've tried searching online for this error without success. I'm wondering if anyone has any ideas about how to address this.
My environment:
I'm running on Mac OSX El Capitan 10.11.6
My xcode version is: Version 8.0 (8A218a) (with Command line tools installed)
My Eclipse info is:
Eclipse IDE for Java Developers
Version: Luna Service Release 2 (4.4.2)
Build id: 20150219-0600
CDT Version: 8.6.0.201502131403
My Eclipse CDT Tool chain Editor looks like:
Current toolchain: MacOSX GCC
Current builder: Gnu Make Builder
I'm running with GNU gdb (GDB) 7.6.2
This GDB was configured as "x86_64-apple-darwin13.0.0"
I'm guessing that there is some sort of gdb version issue. I'm using whatever gdb version that xcode dropped into /usr/local/bin/
Any ideas would be appreciated.
Thanks, Mike
.
.
.
.
.
Ok. So I ran gdb from the command line and it's behaving a little strangely. If I set a breakpoint anywhere within the main program it results in an error, such as, Cannot access memory at address 0xfffe9900. If instead I set a breakpoint in a function in an external file then run it goes to the proper breakpoint and accepts step, print, continue,.... For some reason I cannot set break points in main without getting the error, Cannot access memory at address 0x............. I'm compiling all the codes (including my main) with the -g option. BTW the error, Cannot access memory at address 0x......... is the same as what I'm getting from eclipse debugger. So it looks like it cannot access the main code memory for whatever reason. I haven't changed my make file either. The only things that changed possibly is gcc and gdb.

lldb linux - Not recognized engine using "/usr/bin/lldb"

I'm trying to set lldb as the debugger in a Qt Creator kit on Debian Jessie. But got:
Not recognized engine using "/usr/bin/lldb"
What might be going on?
I got clang and lldb via apt-get.

GDB Could not find the frame base in NetBeans

After making break point in NetBeans IDE, I am faced with problem which show the message <error reading variable: Could not find the frame base for "nn::Layer::Layer(unsigned int, unsigned int)".>.
screenshot
Because of it, I can't read values of variables even types of them.
Any help would be appreciated.
Edit:
I have tried several ways.
downgrade gdb from 7.9 to 7.7.
signing my gdb with codesign -s gdb-cert /usr/local/bin/gdb which did solve Unable to find Mach task port for process-id problem. But doesn't work for this issue.
Using lldb. However, using it even doesn't allow me to make a break point.
My MacOS version is OS X EI capitan 10.11.1.
Gdb is GNU gdb (GDB) 7.9.
NetBeans is 8.0.2.
If there is other version of gdb or NetBeans which works fine, tell me please.