public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Strange step behaviour
@ 2000-10-30 15:09 Fabrice Gautier
  0 siblings, 0 replies; only message in thread
From: Fabrice Gautier @ 2000-10-30 15:09 UTC (permalink / raw)
  To: GDB (E-mail); +Cc: Ecos-List (E-mail)

Hi,

I recently have done some modifications to the gdb stub used in eCos for the
i386 target.
Now it works almost fine except this:

When I step in the C source with "next", if there is a 'call' instruction in
the set of asm instruction generated by the C source line, I caught a
sigtrap with the pc set just after the call instruction. So when there is no
call instruction generated by the C source everything is as usual but if
there is some function calls I will get as many SIGTRAP than there are
calls. For example a "i=i+1" line will not trigger a signal and one "next"
will pass the line, but something like "str=(char *)malloc(strlen(s))" will
take 3 next to execute.  If I try to "step" instead of "next" then i will
have a SIGTRAP on the first line of the function I'm going into, and then if
I do a "finnish" I will get another SIGTRAP on the instruction after the
call.

I'm using insight and the mixed C-asm mode made it very easy to see what's
happening. And when I say i get a SIGTRAP i mean that there is a SIGTRAP
dialog box that appear but i guess the equivalent in the command line gdb
will be a SIGTRAP message that shouldn't appear.

I can still debug, but the problem is  a bit irritating...

I'm wondering what can cause the problem, what does the stub do when
'next'ing. 
The main change I've done in the eCos gdb stub was to allow the program to
be interrupted with a CTRL-C and maybe in the process I've changed something
wrong but I can't see what. If you can enlight me on the way the stub
process the debug trap, how the "next" and "step" are done, what kind of
breakpoints are used for this operations, does it use some hardware debug
capabilities or only "int $3" instructions, how does gdb manage the
difference between user breakpoint and breakpoint used for stepping, does
the stub put a breakpoint after each "call" instruction and why ?

Thanks

-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-10-30 15:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-30 15:09 [ECOS] Strange step behaviour Fabrice Gautier

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).