public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Mark Salter <msalter@redhat.com>
To: john@talisker.demon.co.uk
Cc: ecos-discuss@sourceware.cygnus.com
Subject: Re: [ECOS] gdb 'next' problem with i386 HAL
Date: Wed, 29 Aug 2001 06:47:00 -0000	[thread overview]
Message-ID: <200108291346.f7TDkrZ06511@deneb.localdomain> (raw)
In-Reply-To: <01C13098.3C43E7D0@bream.tr.localnet>

>>>>> John Gumb writes:

> Hi,
> I seem to have tracked down the cause of the problem and have a (nasty) workaround but I'm not sure why this is happening in the first place.

> The problem only occurs when 'nexting' over a function call. Immediately on entry to the called function, gdb attempts to work out the return PC address. It does this using the SAVED_PC_AFTER_CALL macro in /src/gdb/insight-5.0/gdb/config/i386/tm-i386.h invoked from step_over_function in /src/gdb/insight-5.0/gdb/infrun.c  What this does is to look on stack for the return address in order that it can set a breakpoint there. SAVED_PC_AFTER_CALL expands to

> read_memory_integer ( read_register (SP_REGNUM), 4) )

> The trouble is, the return address isn't there. I had a poke around and it actually is 16 bytes further down the stack. So I modified the above code to

> read_memory_integer ( read_register (SP_REGNUM)+0x10, 4) )

I think this is a problem in the HAL code. The HAL is passing
the wrong SP value to GDB. The problem is that the HAL stub
uses the same stack as the app being debugged. The HAL should
be switching to a dedicated GDB stub stack.

--Mark

  reply	other threads:[~2001-08-29  6:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-29  6:42 John Gumb
2001-08-29  6:47 ` Mark Salter [this message]
2001-09-05  8:32   ` Jonathan Larmour
2001-09-05  8:44     ` Mark Salter
2001-09-05  8:55       ` Jonathan Larmour
2001-09-05  9:33         ` Mark Salter
2001-09-05 14:16           ` Jonathan Larmour
2001-09-05 14:59             ` Mark Salter
2001-09-05 15:17               ` Jonathan Larmour
  -- strict thread matches above, loose matches on Subject: below --
2001-08-24  7:19 Patrick O'Grady
2001-08-23  2:54 John Gumb
2001-08-22 12:20 Allan Young
2001-08-15 15:08 John Gumb
2001-08-16  6:44 ` Jonathan Larmour
2001-08-17  0:31   ` Boris V. Guzhov
2001-08-17  6:17     ` Jonathan Larmour

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=200108291346.f7TDkrZ06511@deneb.localdomain \
    --to=msalter@redhat.com \
    --cc=ecos-discuss@sourceware.cygnus.com \
    --cc=john@talisker.demon.co.uk \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).