0

Cannot remotely debug an application on a remote computer. The problem occurs when connecting the CodeLite IDE version 12.0.10 and GNU gdbserver (GDB) version 7.6.1. The CodeLite IDE runs on the local computer; GNU gdbserver runs on the remote computer.

The debug build application that you need to debug is pre-copied to the remote computer. GNU gdbserver starts with parameters. GNU gdbserver listens on the specified port. GNU gdbserver startup example:

gdbserver.exe: port name_application.exe

On the local computer, in the project settings of the compiled application in the IDE CodeLite (Settings) in the Debugger tab, remote debugging is set by setting a daw in the "Debugging a remote target" field. In the field "Host / tty" the ip of the remote computer is set. In the "Port" field, the port is set.

After successfully connecting the IDE CodeLite and GNU gdbserver, a debugged application is launched on the local computer in the IDE CodeLite. The application crashes with an error. Presumably, the running application on the remote computer accesses the libraries and cannot find them.

Error code:

Reading C:\WINDOWS\SysWOW64\IPHLPAPI.DLL from remote target...
0x76fef147 in ?? ()
Successfully connected to debugger server
Applying breakpoints...
Applying breakpoints... done
Successfully set breakpoint 2 at: K:\Work\Repositories\MainFrame.cpp:33
Continuing...
Reading C:\WINDOWS\SysWOW64\imm32.dll from remote target...
Thread 1 hit Temporary breakpoint 1, 0x008e9c9e in main ()
Internal breakpoint was hit (id=1), Applying user breakpoints and continuing
Continuing...
Reading C:\WINDOWS\SysWOW64\msctf.dll from remote target...
\nThread
2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 9272]
0x07850006 in ?? ()
Program Received signal SIGSEGV

How to specify a path GDBServer with libraries?

Daniel
  • 3
  • 4
  • I began to understand further and found the reason for the departure. I am building my application using the wxWidgets library. Correspondingly, the crash occurs in the libraries in the CreateWindowEx() function in the file wxWidgets/src/msw/window.cpp line 3984 – Daniel Oct 28 '19 at 10:11
  • this function: WXHWND hWnd = ::CreateWindowEx(exStyle, clName, title, style, x, y, width, height, parent, (HMENU)wxUIntToPtr(id), wxGetInstance(), NULL); // no extra data – Daniel Oct 28 '19 at 10:14
  • List of linked libraries with website https://www.win7dll.info/msctf_dll.html section Static Linking: msvcrt.dll API-MS-Win-Core-LocalRegistry-L1-1-0.dll API-MS-Win-Core-ProcessThreads-L1-1-0.dll API-MS-Win-Security-Base-L1-1-0.dll KERNEL32.dll ntdll.dll USER32.dll GDI32.dll IMM32.dll – Daniel Oct 29 '19 at 08:36
  • i find all but API-MS-Win-Core-LocalRegistry-L1-1-0.dll, and i I put them with .exe on remote computer. But gdbserver still accesses the libraries of windows on remote computer – Daniel Oct 29 '19 at 08:42
  • I think it is necessary to tell the linker some kind of flask in order to build these libraries together with the exe or either tell the gdbserver where to look for these libraries – Daniel Oct 29 '19 at 08:45

0 Answers0