Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Wiljan Derks <Wiljan.Derks@zonnet.nl>,
	gdb@sourceware.org, 	Mark Kettenis <kettenis@gnu.org>
Subject: Re: How to tell gdb about dlls using remote protocol
Date: Thu, 01 Feb 2007 17:52:00 -0000	[thread overview]
Message-ID: <20070201175311.GG17864@adacore.com> (raw)
In-Reply-To: <20070131223113.GA15122@nevyn.them.org>

[-- Attachment #1: Type: text/plain, Size: 1143 bytes --]

Hi Daniel,

> > The problem that I have run into, is that I can find no way to let gdb know 
> > what dll's are inside the
> > debugee using the remote protocol.
> > 
> > Does anyone know if there is a way to do this ?
> 
> There's no way to do this yet.  If you look at the list archives for
> the last several months, you'll see a patch (in the "GDB solib
> interface" thread) that implements something which might help.  But it
> hasn't been finalized or committed yet (sorry Stephen - I just haven't
> had time).

This makes me wonder how well the debugger can work in certain
situations like when backtracing from DLL code. If the debugger
doesn't know where it is, then it's probably let to prologue analysis
to do the unwinding. Except that it cannot determine where the prologue
is... In that case, I see that the i386 unwinder assumes that the frame
base can be deduced from the SP and the SP offset. Unfortunately,
this SP offset can only be deduced from prologue analysis. Catch 22?

Mark,

What do you think of this (untested) patch? We we couldn't find
the function start address, the safest seems to be relying on ebp.

-- 
Joel

[-- Attachment #2: i386-tdep.c.diff --]
[-- Type: text/plain, Size: 717 bytes --]

Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.230
diff -u -p -r1.230 i386-tdep.c
--- i386-tdep.c	29 Jan 2007 17:31:06 -0000	1.230
+++ i386-tdep.c	1 Feb 2007 17:50:51 -0000
@@ -979,6 +979,12 @@ i386_frame_cache (struct frame_info *nex
 	  /* This will be added back below.  */
 	  cache->saved_regs[I386_EIP_REGNUM] -= cache->base;
 	}
+      else if (cache->pc == 0)
+        {
+          /* We couldn't determine the function start address, bla
+             bla bla.  */
+          cache->saved_regs[I386_EBP_REGNUM] = 0;
+        }
       else
 	{
 	  frame_unwind_register (next_frame, I386_ESP_REGNUM, buf);

  reply	other threads:[~2007-02-01 17:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-31 21:08 Wiljan Derks
2007-01-31 22:31 ` Daniel Jacobowitz
2007-02-01 17:52   ` Joel Brobecker [this message]
2007-02-01 22:54     ` Daniel Jacobowitz
2007-02-01 23:02       ` Joel Brobecker
2007-02-01 23:59         ` Daniel Jacobowitz
2007-02-02  6:20           ` Robert Dewar
2007-02-02 11:43             ` Daniel Jacobowitz
2007-02-02 16:51               ` Joel Brobecker
2007-02-02 16:56                 ` Daniel Jacobowitz
2007-02-02 17:34                   ` Joel Brobecker
2007-02-05 20:34                     ` Wiljan Derks
2007-02-05 21:21                       ` Joel Brobecker
2007-02-07 21:47                     ` Mark Kettenis
2007-02-07 22:14     ` Mark Kettenis
2007-02-07 22:17       ` Daniel Jacobowitz
2007-02-08 21:14         ` Mark Kettenis
2007-02-08 23:00           ` Daniel Jacobowitz
2007-02-14  8:51             ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070201175311.GG17864@adacore.com \
    --to=brobecker@adacore.com \
    --cc=Wiljan.Derks@zonnet.nl \
    --cc=gdb@sourceware.org \
    --cc=kettenis@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox