public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* gdbserver 6.7.1 for mingw32ce connect to host gdb problem
@ 2007-12-15 15:44 Steve DeLaney
  2007-12-16 16:41 ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Steve DeLaney @ 2007-12-15 15:44 UTC (permalink / raw)
  To: gdb



using the newly supplied build script, the bfd patch is applied and the
build is clean.

but now I am struggling to get gdbserver to accept a connection from
development host using target remote xxxx

first I noticed that gdbserver needs a command line like this

gdbserver.exe 169.254.2.2:9999 \\path\\test.exe

without path to .exe it just exits with a usage message
this is due to the fact that wince doesn't define a default (current)
directory like '.'

Test over RNDIS and WLAN with the same results.  gdbserver times out after
about 8 seconds

on the host
arm-wince-mingw32ce-gdb test.exe
target remote 169.254.2.1:9999

returns Connection refused

tcp test is OK, able to ping the IPAQ 2795 target.

I'm kind of stumped.  I hacked a few diagnostics into gdbserver/server.c to
try and trace what was going on.  I wondered about __MINGW32CE__ asserted in
the make CFLAGS 

any ideas what might be going on, or how best to trace this?

thanks
/steverino2

-----Original Message-----
From: Steve DeLaney [mailto:onramp123@yahoo.com] 
Sent: Wednesday, December 12, 2007 1:39 PM
To: 'Pedro Alves'; 'gdb@sourceware.org'
Subject: build script for gdb 6.7.1 for mingw32ce 


 Thanks to all the help from Pedro on this.  I'm including a build script
that patches gdb 6.7.1 and builds gdb and gdbserver.  not sure the best way
to post this so I'll just include it inline for now.



#!/bin/bash
# build-gdb-6.7.1-mingw32ce
# built with mingw32ce distro 0.51
#

src=gdb-6.7.1
patchfile=mingw32ce.patch

echo "UNTAR $src DISTRO"
tar xvzf $src.tar.gz

echo "PATCHING $src DISTRO for mingw32ce"
cd $src/bfd
# using bfd patch submitted by Pedro 2007-12-10
patch < ../../mingw32ce.patch
cd ../..

echo "BUILDING GDB"
mkdir build-gdb
cd build-gdb
../$src/configure --target=arm-wince-mingw32ce --prefix=/opt/mingw32ce
make 
make install
cd ..
echo "GDB BUILD COMPLETE"

echo "BUILDING GDBSERVER"
mkdir build-gdbserver
cd build-gdbserver
../$src/gdb/gdbserver/configure --host=arm-wince-mingw32ce 
make
arm-wince-mingw32ce-strip gdbserver.exe -o gdbserver-stripped.exe
echo "GDBSERVER BUILD COMPLETE"
echo "copy gdbserver-stripped.exe to the device and rename it gdbserver.exe"
cd ..









-----Original Message-----
From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] On Behalf
Of Pedro Alves
Sent: Monday, December 10, 2007 2:25 PM
To: gdb@sourceware.org; onramp123@yahoo.com
Subject: RE: help building gdb 6.7.1 for windows CE ARM

Steve DeLaney wrote:
 > I am attempting a build of gdb 6.7.1 for windows CE ARM target using  >
mingw32ce  the objective is to have gdbserver on target providing a "target
> remote x" interface to the host development gdb.  in other words a
standard  > session configuration.
 >
 > can anyone help with the --target and --host configure options ?
 >

Build gdb with --target=arm-wince-mingw32ce Build gdbserver with
--host=arm-wince-mingw32ce

 > I think there is a bfd patch but not sure if it is located in the patches
> archive ?
 >

I had never submitted it upstream ...

... until now:
http://sourceware.org/ml/binutils/2007-12/msg00051.html

--
Pedro Alves

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gdbserver 6.7.1 for mingw32ce connect to host gdb problem
  2007-12-15 15:44 gdbserver 6.7.1 for mingw32ce connect to host gdb problem Steve DeLaney
@ 2007-12-16 16:41 ` Pedro Alves
  2007-12-16 23:14   ` Steve DeLaney
  0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2007-12-16 16:41 UTC (permalink / raw)
  To: onramp123; +Cc: gdb

Steve DeLaney wrote:

> first I noticed that gdbserver needs a command line like this
> 
> gdbserver.exe 169.254.2.2:9999 \\path\\test.exe
> 
> without path to .exe it just exits with a usage message
> this is due to the fact that wince doesn't define a default (current)
> directory like '.'
> 

1) gdbserver currently ignores host part in HOST:PORT, so you can
    just use '$GDBSERVER :$PORT $PATH'.

2) There is *no* notion of current directory on Windows CE.  On
    WinCE, every path *must* be absolute.  (There is an
    hardcoded $PATH, that looks of executables in \Windows and \ )

    Gdbserver allows you to use forward slashes too:
    gdbserver.exe :9999 /path/test.exe

    And skip the .exe extension:
    gdbserver.exe :9999 /path/test


> Test over RNDIS and WLAN with the same results.  gdbserver times out after
> about 8 seconds
> 

I'm not sure what you're seeing.  You should see something like
this:

\> gdbserver :9999 main
Process main created; pid=-1226757750
Listening on port 9999

 > I wondered about __MINGW32CE__ asserted in
> the make CFLAGS 
> 

Can you be more specific?   (__MINGW32CE__ is automatically
defined by the mingw32ce compiler.)

> any ideas what might be going on, or how best to trace this?

Looks like something is not 100% right in your tcp/ip
connection.
Can you ping the host from the device ?
Is there any firewalling involved ?
Can you start gdbserver listening on 9999, and telnet it (to
remove gdb from the picture) with 'telnet $ip 9999' ?

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: gdbserver 6.7.1 for mingw32ce connect to host gdb problem
  2007-12-16 16:41 ` Pedro Alves
@ 2007-12-16 23:14   ` Steve DeLaney
  2007-12-16 23:48     ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Steve DeLaney @ 2007-12-16 23:14 UTC (permalink / raw)
  To: 'Pedro Alves'; +Cc: gdb


Good suggestions. comments follow below.  

summary: pilot error on my part.  it turns out that gdbserver.exe MUST be
launched like this
gdbserver :9999 /path/test

and must NOT be launched as I attempted previously:
gdbserver.exe 169.254.2.2:9999 \\path\\test.exe

thanks to your support this is now working.  I even tested out 

ddd --debugger arm-wince-mingw32ce-gdb test.exe
target remote 169.254.2.1:9999
the session seems very responsive.

interesting test 
b main
c
p argc
$1 = 1
p argv[0]
$2 = 0x260930 "\\path\test.exe"

so gdb although invoked with single forward slash,converts to double back
slash.

/steverino2  

-----Original Message-----
From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] On Behalf
Of Pedro Alves
Sent: Sunday, December 16, 2007 8:41 AM
To: onramp123@yahoo.com
Cc: gdb@sourceware.org
Subject: Re: gdbserver 6.7.1 for mingw32ce connect to host gdb problem

Steve DeLaney wrote:

> first I noticed that gdbserver needs a command line like this
> 
> gdbserver.exe 169.254.2.2:9999 \\path\\test.exe
> 
> without path to .exe it just exits with a usage message this is due to 
> the fact that wince doesn't define a default (current) directory like 
> '.'
> 

1) gdbserver currently ignores host part in HOST:PORT, so you can
    just use '$GDBSERVER :$PORT $PATH'.

2) There is *no* notion of current directory on Windows CE.  On
    WinCE, every path *must* be absolute.  (There is an
    hardcoded $PATH, that looks of executables in \Windows and \ )

    Gdbserver allows you to use forward slashes too:
    gdbserver.exe :9999 /path/test.exe

    And skip the .exe extension:
    gdbserver.exe :9999 /path/test


> Test over RNDIS and WLAN with the same results.  gdbserver times out 
> after about 8 seconds
> 

I'm not sure what you're seeing.  You should see something like
this:

\> gdbserver :9999 main
Process main created; pid=-1226757750
Listening on port 9999

[s] yes, I agree this is what I expected just other embedded versions of
gdbserver.  in this case, when launched from powertools CMD shell (
gdbserver.exe :9999 /path/test) gdbserver just starts, waits approx 12
seconds, then returns to command prompt.  but there are no messages on
stdout. 


 > I wondered about __MINGW32CE__ asserted in
> the make CFLAGS
> 

Can you be more specific?   (__MINGW32CE__ is automatically
defined by the mingw32ce compiler.)
[s] gotcha.  yes I confirmed this with gdb -v
I can see now that __MINGW32CE__ options are enabled in the gdbserver build.

> any ideas what might be going on, or how best to trace this?

Looks like something is not 100% right in your tcp/ip
connection.
Can you ping the host from the device ?
[s] yes on RNDIS ping 169.254.2.1, on WLAN at 192.168.3.118

Is there any firewalling involved ?
[s] No, all inside firewall on single subnet.  RNDIS emulates a network
connection so it is point-to-point over USB, no?

Can you start gdbserver listening on 9999, and telnet it (to
remove gdb from the picture) with 'telnet $ip 9999' ?
[s] this did not work (telnet client gets "connection refused"  So gdbserver
is not listening on the port

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gdbserver 6.7.1 for mingw32ce connect to host gdb problem
  2007-12-16 23:14   ` Steve DeLaney
@ 2007-12-16 23:48     ` Pedro Alves
  0 siblings, 0 replies; 4+ messages in thread
From: Pedro Alves @ 2007-12-16 23:48 UTC (permalink / raw)
  To: onramp123; +Cc: gdb

Steve DeLaney wrote:
> Good suggestions. comments follow below.  
> 
> summary: pilot error on my part.  it turns out that gdbserver.exe MUST be
> launched like this
> gdbserver :9999 /path/test
> 
> and must NOT be launched as I attempted previously:
> gdbserver.exe 169.254.2.2:9999 \\path\\test.exe
> 

Well, it depends on what kind of "shell" you use to
invoke the command.  I was assuming you were
invoking from some remote RAPI tool from some shell
that needed the escaping, but since you seem to be
using MSFT's cmd.exe, you have to use
single back-slashes:
gdbserver.exe 169.254.2.2:9999 \path\test.exe

If that's the case, this is not a gdbserver problem.
If it's something else, it could be a bug.

> interesting test 
> b main
> c
> p argc
> $1 = 1
> p argv[0]
> $2 = 0x260930 "\\path\test.exe"
> 
> so gdb although invoked with single forward slash,converts to double back
> slash.
> 

Actually, it's converted into a single back slash, since that's
what the CreateProcess call used to launch the process expects.
The double back slash is shown because '\' is the escape char.  I
guess you have a typo in your example.

Glad it's working now.

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-12-16 23:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-15 15:44 gdbserver 6.7.1 for mingw32ce connect to host gdb problem Steve DeLaney
2007-12-16 16:41 ` Pedro Alves
2007-12-16 23:14   ` Steve DeLaney
2007-12-16 23:48     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).