🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #2204

Re: Remote debugging on Intel

#2204
From: Michael Snyder
Date: Fri, 26 Apr 2002 23:55
68 lines
4457 bytes
kar@cs.rit.edu wrote:
> 
> Hello!
> 
> The problem: I cannot get gdb to remotely debug a program on another machine.
> 
> The players: gdb 5.1.1, configured as i386-pc-solaris2.7
> 
> The situation: The host and target machines are both Intel boxes running
>         Solaris 2.7.  I have implemented the needed routines in the
>         i386-stub.c file, and the two machines do talk correctly with
>         each other across the serial line.
> 
>         I link the stub into my program and boot it on the target machine;
>         the first thing it does after calling set_debug_traps() is to call
>         breakpoint().
> 
>         When I issue the target remote command, it responds with an error:
> 
>                 Couldn't establish connection to remote target
>                 procfs: couldn't find pid 42000 in procinfo list
> 
>         Based on what I found looking through the source for gdb, I
>         implemented the qC command in the i386-stub and had it return
>         an ID of -1.  Here is the output that is produced:
> 
> Script started on Fri Apr 12 15:24:42 2002
> 
> sholto kar 1: gdb
> GNU gdb 5.1.1
> Copyright 2002 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "i386-pc-solaris2.7".
> Setting up the environment for debugging gdb.
> gdbinit:5: Error in sourced command file:
> No symbol table is loaded.  Use the "file" command.
> (gdb) target remote /dev/ttyb
> Remote debugging using /dev/ttyb
> sent qC packet, reply = QC-1 (oldpid = 42000)            <== my debug output

Well, first of all, you don't need to instrument with your own
debug output.  It's already instrumented.  Use this command:

  (gdb) set debug remote 1

> calling find_procinfo_or_die from stopped_by_watchpoint  <== my debug output

OK, well neither of these functions should be being called
(find_procinfo_or_die or stopped_by_watchpoint).
This is a little weird.  No, it's very weird.

> Couldn't establish connection to remote target
> procfs: couldn't find pid -1 in procinfo list.
> (gdb) quit
> 
> sholto kar 2: exit
> script done on Fri Apr 12 15:25:40 2002
> 
>         The "QC-1" is what the stub sent back to gdb, which shows that
>         the communication is working.
> 
> My guess as to the cause of the problem: I don't have one.

Not enough info.  Try it with "set debug remote 1" and see
what it says then.
Technical Details
Message-ID: <3CC9E8FB.D760B884@redhat.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!newsfeed.mathworks.com!news.mathworks.com!uunet!nyc.uu.net!dca.uu.net!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdb
References: <200204121951.PAA26878@madrid.cs.rit.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5053,e6e33499d163585c
X-Google-Attributes: gidf5053,public
X-Google-ArrivalTime: 2002-05-02 05:25:57 PST
x-uunet-gateway: mr1.ash.ops.us.uu.net from bug-gdb to gnu.gdb.bug; Thu, 2 May 2002 12:21:50 GMT
Mailing-List: contact gdb-bugs-help@sources.redhat.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:gdb-bugs-unsubscribe-bug-gdb=gnu.org@sources.redhat.com>
List-Subscribe: <mailto:gdb-bugs-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/gdb-bugs/>
List-Post: <mailto:gdb-bugs@sources.redhat.com>
List-Help: <mailto:gdb-bugs-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: gdb-bugs-owner@sources.redhat.com
Delivered-To: mailing list gdb-bugs@sources.redhat.com
From: msnyder@redhat.com (Michael Snyder)
Subject: Re: Remote debugging on Intel
Date: Fri, 26 Apr 2002 16:55:39 -0700
Organization: Red Hat, Inc.
Message-ID: <3CC9E8FB.D760B884@redhat.com>
References: <200204121951.PAA26878@madrid.cs.rit.edu>
NNTP-Posting-Host: reddwarf.sfbay.redhat.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: cronkite.cygnus.com 1019866072 27240 172.16.24.50 (27 Apr 2002 00:07:52 GMT)
X-Complaints-To: postmaster@cygnus.com
NNTP-Posting-Date: 27 Apr 2002 00:07:52 GMT
X-Accept-Language: en
DJ-Gateway: from newsgroup cygnus.bugs.gdb
Approved: bug-gdb-request@mail.gnu.org
Newsgroups: gnu.gdb.bug
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!newsfeed.mathworks.com!news.mathworks.com!uunet!nyc.uu.net!dca.uu.net!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdb
Lines: 69