public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Fabrice Gautier <Fabrice_Gautier@sdesigns.com>
To: 'Jonathan Larmour' <jlarmour@redhat.co.uk>,
	Fabrice Gautier <Fabrice_Gautier@sdesigns.com>
Cc: "Ecos-List (E-mail)" <ecos-discuss@sourceware.cygnus.com>
Subject: RE: [ECOS] Multi thread Debugging
Date: Wed, 30 Aug 2000 16:39:00 -0000	[thread overview]
Message-ID: <8AE4B526B977D411841F00A0CC334020052C34@cuz-exchange.sdesigns.net> (raw)

> -----Original Message-----
> From: Jonathan Larmour [ mailto:jlarmour@redhat.co.uk ]
> Subject: Re: [ECOS] Multi thread Debugging
> 
> 
> 
> The stack_ptr member is there for a different purpose than 
> saved_context.
> saved_context is for GDB debugging purposes only and provides the full
> context. AFAIK interrupt_end is the only place that stores 
> the context in
> saved_context.

In fact I've seen that when saved_context member is NULL, the stack_ptr is
used instead.
 

> This is interesting - it's not clear to me either how 
> saved_context is set
> if threads get rescheduled for any reason other than an interrupt.

It is not set at all. But get_saved_context get the registers from
stack_ptr.
 
> Is this a bug?

It doesn't seem 
 
> I wouldn't have thought this would have caused a problem on the scale
> Fabrice is seeing at any rate.

The problem may be elsewhere.

May be here: (Warning, this is i386 PC specific stuff now)

void hal_get_gdb_registers(target_register_t * d, HAL_SavedRegisters * s)
{
	int i ;

	for (i = 0; i < NUMREGS; i++)
		d[i] = hal_pc_trap_registers[i] ;
} 

This is seen in hal/i386/pc/current/src/plf_stub.c. Note how this function
does not use the 's' parameter while all we need is in there. This is called
in dbg_getthreadreg and 's' would be either saved_context or stack_ptr.

I found another version of this function in
hal/i386/arch/current/src/i386_stub.c

#if 0
void hal_get_gdb_registers(target_register_t * d, HAL_SavedRegisters * s)
{
	d[ESP] = s->esp ;
	d[ESP] = s->esp ;
	d[EBP] = s->ebp ;
	d[EBX] = s->ebx ;
	d[ESI] = s->esi ;
	d[EDI] = s->edi ;
	d[PC] = s->eip ;
}
#endif

This one looks better, but unfortunately there is no s->eip. The
HAL_SavedRegister doesn't have one. Unfortunate.

If someone know why this version has been discarded and what the other is
intented to do it sould be fun.

Thanks

A+

-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 

             reply	other threads:[~2000-08-30 16:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-30 16:39 Fabrice Gautier [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-09-01 14:18 Fabrice Gautier
2000-08-31 18:54 Fabrice Gautier
2000-09-01  3:12 ` Nick Garnett
2000-08-31 15:31 Fabrice Gautier
2000-09-01  2:55 ` Nick Garnett
2000-08-31  3:56 Fabrice Gautier
2000-08-30 19:56 Fabrice Gautier
2000-08-31  4:15 ` Nick Garnett
2000-08-25 12:06 Fabrice Gautier
2000-08-25 11:18 Fabrice Gautier
2000-08-25 11:38 ` Jonathan Larmour
2000-08-23 14:53 Fabrice Gautier
2000-08-24  7:17 ` Jonathan Larmour
2000-08-21 19:15 Fabrice Gautier
2000-08-15 12:00 Fabrice Gautier

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=8AE4B526B977D411841F00A0CC334020052C34@cuz-exchange.sdesigns.net \
    --to=fabrice_gautier@sdesigns.com \
    --cc=ecos-discuss@sourceware.cygnus.com \
    --cc=jlarmour@redhat.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).