Welcome, Guest
Username: Password: Remember me
CodeTyphon MS Windows (Win7, Win8.x, Win10 and Win11) OS Development, discussions and problems
  • Page:
  • 1

TOPIC:

GDBserver does NOT work!! 9 years 7 months ago #7028

  • Hoseongson
  • Hoseongson's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
hi
I wanna use "remote debug" my application from windows. but i got problem
My target system is Raspberrypi2 (raspbian) host is win64(windows7)
I did this :
1) "target > gdbserver host:2345 ./Myapp" and get "processe execfilename created; pid =3029 listening port 2345"

2) IDE(typhon) >


I got result :
target > "remote side has terminated connection. gdbserver will reopen the connection"
and GDB in IDB does not work.

How can i solve this problem.. i need your help
Attachments:

Please Log in or Create an account to join the conversation.

GDBserver does NOT work!! 9 years 7 months ago #7031

  • Martin - Lazarus Development Team
  • Martin - Lazarus Development Team's Avatar
  • Visitor
  • Visitor
Different GDB versions have different issues. This is most likely an issue in GDB.

Probably you may have to find another version of gdb server (this could also mean a downgrade). Not sure if gdb and gdb server must match. You have to try that yourself.

As for gdb, and from the tests performed with Lazarus: GDB 7.8.x has more bugs that makes it crash.

Try 7.7, or 7.2 or in between.


Also make sure you do not inspect certain kind of data : wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Bugs_in_GDB
e.g. resourcestrings.

Please Log in or Create an account to join the conversation.

GDBserver does NOT work!! 9 years 7 months ago #7035

  • Hoseongson
  • Hoseongson's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
thank you for answer.

my host(window) gdb version is 7.7.5. but my target(raspberry2) gdb version is 4.4.

so i did install 7.7.5 on my target using configure-make-make install.

and i did same thing(target>gdbserver HOST:2345 project1

but i got same result(target>remote side has terminated connection. gdbserver will reopen the connection.)...

Please Log in or Create an account to join the conversation.

Last edit: by Hoseongson.

GDBserver does NOT work!! 9 years 7 months ago #7038

  • Martin - Lazarus Development Team
  • Martin - Lazarus Development Team's Avatar
  • Visitor
  • Visitor
Does that happen when you just run the app? Or does it happen when you inspect variables? Or hit a breakpoint?

Does it happen with a simple app, just one button, OnClick: Caption := 'Foo'; // breakpoint here?

Please test if it is the debug settings. Project options > Debugging. Try setting it to "stabs" or "Dwarf 2", and test with either setting.

Either run a log, or provide the debug output window content. See: wiki.lazarus.freepascal.org/GDB_Debugger...fo_for_debug_session

Please Log in or Create an account to join the conversation.

GDBserver does NOT work!! 9 years 7 months ago #7040

  • Hoseongson
  • Hoseongson's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
Thank you, I'll do right now.

I think host(windows) GDB configuration is wrong.

Host GDB config : host=i686-mingw64, target=i686-mingw64.

How can i chainge windows GDB configuration?

Please Log in or Create an account to join the conversation.

GDBserver does NOT work!! 9 years 7 months ago #7042

  • Martin - Lazarus Development Team
  • Martin - Lazarus Development Team's Avatar
  • Visitor
  • Visitor

Host GDB config : host=i686-mingw64, target=i686-mingw64


To change that, you have to build gdb yourself. But assuming you have a 64 bit window, this should work (just tells you it was build with/for mingw, but really it can debug any win64 app.

However in the past 64bit gdb often had there own issues. Try the 32 bit gdb from sourceforge
sourceforge.net/projects/lazarus/files/L...s/Alternative%20GDB/
This is 7.7.1. It will run on a 64 bit win too, and since your app is not win64 it might work.

Or try the gdb form the 32 bit installer 7.7.2 (might be more stable).
It should (iirc) also be included in the 32 bit cross comyiler sourceforge.net/projects/lazarus/files/L...ts/Lazarus%201.4RC3/

Also add (with any gdb) wiki.lazarus.freepascal.org/GDB_Debugger..._has_stopped_working
>> go to the debugger options and set the field "DisableLoadSymbolsForLibraries" to "True"

Please Log in or Create an account to join the conversation.

GDBserver does NOT work!! 9 years 7 months ago #7043

  • Hoseongson
  • Hoseongson's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
I did it all your answer. but i got any chage..

By any chance, did i wrong way to build Cross-debugging?

Please check my way is right.

Here's my way

1. Installing Codetyphon and typhon following this instruction : www.pilotlogic.com/sitejoom/index.php/wi...allation-for-windows

2. Setting Cross-Compile environment follwing this instruction : www.pilotlogic.com/sitejoom/index.php/wiki?id=386

3. Setting IDE : tools - option - debugger as my post.

4. Setting target GDBserver : target>gdbserver HOST:2345 "myapp" or target>gdbserver --remote-debug -multi HOST:2345

5. Build and run (press F9)

Please Log in or Create an account to join the conversation.

Last edit: by Hoseongson.

GDBserver does NOT work!! 9 years 7 months ago #7044

  • Martin - Lazarus Development Team
  • Martin - Lazarus Development Team's Avatar
  • Visitor
  • Visitor
First some clarification, about what I know, and what not, and so on.

I work with Lazarus not codetyphon. But last time I checked the debugger code (at least any relevant part) was identical.. I also do not have a raspi.

But what I know is a lot about how the IDE works with gdb. I maintained that code for several years. I also wrote how the IDE parts that are needed for gdbserver. And in the years of testing I got some experience with bugs in gdb.

Since I can not test this myself, I rely on feedback from you. And then I can give you options that may be worth trying.

To double check:

target > "remote side has terminated connection. gdbserver will reopen the connection"

This is printed by gdbserver on the raspi?

Then what does gdb do/print (can be seen either in "View" > "debug windows" > "Debug output", or with a log file (link in earlier post of mine)
What exact error does the IDE give at that time?

And this is while you try to launch the app? Before doing any stepping or watches?

Any info on the above questions (especially "Debug output", ) may help finding when exactly things go wrong.

At step 5 or 6 (Project Options) in the link you posted, go to the "Debugging" options.
Make sure you do not use smartlinking.

Open the break point window, and check that all breakpoints are in files from your project. And on lines in code.

A few thinks you could try. I do not know if they will help.
I might know more if I know the answers to the above section

Other options worth playing with are (in the property grid, global debugger options).Change one at a time
- "Internal start break", try "main" and "entry"
- UseAsyncCommandMode
- UseNoneMiRurommand

Those option affect how the IDE initializes the debug session, and it is possible that some version of gdb do not like all of them.

If your exe is result of a cross compile or native compile does not matter. As long as the final exe actually runs (or runs and crashes) on the target.

At step 5 or 6 (Project Options) in the link you posted, go to the "Debugging" options.
Try the build with
- "dwarf 2 (-gw2)"
- "Stabs (-gs)"

Also check all the packages your project uses, and for each of them:
- either disable debug info
- set it to the same setting
Avoid to have a mix of stabs and dwarf. (e.g. package does stabs, project does dwarf)

Do you use an external debug file, or not? If the exe with included debug info is not to big for the raspi, you may try to NOT use an external debug info file.

Sorry it is a lot of try this, try that.

Please Log in or Create an account to join the conversation.

GDBserver does NOT work!! 9 years 7 months ago #7046

  • Hoseongson
  • Hoseongson's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
Thank you.

When i got "target > "remote side has terminated connection. gdbserver will reopen the connection" in raspi, i got this in "View > debug windows > Debug output" :
<target remote 192.168.0.26:2345>
&"target remote 192.168.0.26:2345\n"
~"Remote debugging using 192.168.0.26:2345\n"
&"The target is not running (try extended-remote?)\n"
^error,msg="The target is not running (try extended-remote?)"
(gdb)

I typed before run Host IDE "target>gdbserver --remote-debug --multi HOST:2345"

Thank you for your kind answer all the time.

Please Log in or Create an account to join the conversation.

GDBserver does NOT work!! 9 years 7 months ago #7047

  • Martin - Lazarus Development Team
  • Martin - Lazarus Development Team's Avatar
  • Visitor
  • Visitor
Please see here too: forum.lazarus.freepascal.org/index.php?topic=28062.new very similar issue.

I do not yet know what the issue is between gdb and gdbserver on raspery

Please Log in or Create an account to join the conversation.

  • Page:
  • 1