1

For some reason, when I attempt to use GDB on my windows machine under cygwin, even after compiling it from the latest source, it won't let me do a:

target remote localhost:1234

Instead, when I try that, it says:

localhost:1234: Operation not permitted.

However, the same command works just fine on my Arch Linux VM and my OSX 10.5.8 computer. Which, AFAIK, are using older versions of gdb. "i586-pc-elf-gdb -v" reports:

GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-cygwin --target=i586-pc-elf".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Eli
  • 636
  • 2
  • 7
  • 17

2 Answers2

0

Try compiling your code also with the -ggdbx" option: CFLAGS = -Wall -g -ggdb3 -O0

don
  • 1
  • THis won't help, it doesn't connect at all to the server. Running these commands on a linux host connects fine and source-level debugging works. – Eli May 04 '11 at 03:28
0

This might sound dumb but are you certain that you have a gdbserver running on 1234?

Eric
  • 19,525
  • 19
  • 84
  • 147
  • Yes, the GDB server is QEMU which by default sets the port to 1234, and it always has done that every time I've tried. – Eli May 04 '11 at 03:27