Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pierre Muller <muller@cerbere.u-strasbg.fr>
To: "Sarnath K - CTD, Chennai." <k_sarnath@ctd.hcltech.com>,
	Pierre Muller <muller@cerbere.u-strasbg.fr>
Cc: gdb@sources.redhat.com
Subject: RE: "xbreak" command in GDB ?
Date: Fri, 25 Jan 2002 01:20:00 -0000	[thread overview]
Message-ID: <4.2.0.58.20020125093551.00a481f0@ics.u-strasbg.fr> (raw)
In-Reply-To: <EF836A380096D511AD9000B0D021B52754B482@narmada.ctd.hcltech .com>

At 09:29 25/01/2002 , Sarnath K - CTD, Chennai. a écrit:
> >Simply try 
> >./gdb ./gdb
> >break main
> >xbreak main
> >disas main
>
>  GDB never exits via the leaving point
>of main() function, I suppose.
>It exits via "quit_command" function.
>I vaguely remember this ( when I was
>browsing GDB source code.) So this test
>might not reflect things correctly.
>Correct me if I am wrong

I didn't want to say that you should run the progream after.
Simply comparing the address of the xbreak with
the position of the ret instruction
in the function disassembly is enough to
show that you are right in saying that this
command is buggy for i386 at least.

Looking into source it apears that this is 
related to function
find_pc_sect_partial_function

because xbreak uses the returned endaddr value.

function description says that
/* Finds the "function" (text symbol) that is smaller than PC but
    greatest of all of the potential text symbols in SECTION.  Sets
    *NAME and/or *ADDRESS conditionally if that pointer is non-null.
    If ENDADDR is non-null, then set *ENDADDR to be the end of the
    function (exclusive), but passing ENDADDR as non-null means that
    the function might cause symbols to be read.  This function either
    succeeds or fails (not halfway succeeds).  If it succeeds, it sets
    *NAME, *ADDRESS, and *ENDADDR to real information and returns 1.
    If it fails, it sets *NAME, *ADDRESS, and *ENDADDR to zero and
    returns 0.  */

The exclusive attribute should be the reason why this works
but the endaddress is simply set by 
               cache_pc_function_high = BLOCK_END (SYMBOL_BLOCK_VALUE (f));
(cache_pc_function_high is copied into endaddr at function end)

But I don't think  that BLOCK_END should 
exclude any instruction, so its probably here that we should 
decrement  but there is no code for 
function_epilogue in i386-tdep.c 



Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07  Fax : (33)-3-88-41-40-99


       reply	other threads:[~2002-01-25  9:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <EF836A380096D511AD9000B0D021B52754B482@narmada.ctd.hcltech .com>
2002-01-25  1:20 ` Pierre Muller [this message]
2002-01-28 11:18   ` Elena Zannoni
2002-01-25  0:33 Sarnath K - CTD, Chennai.
  -- strict thread matches above, loose matches on Subject: below --
2002-01-25  0:24 Sarnath K - CTD, Chennai.
2002-01-24  1:33 Sarnath K - CTD, Chennai.
2002-01-24 23:46 ` Eli Zaretskii
2002-01-25  0:27   ` Pierre Muller
2002-01-31 12:45     ` Michael Snyder
2002-01-31 12:39   ` Michael Snyder
2002-01-31 12:43 ` Michael Snyder

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=4.2.0.58.20020125093551.00a481f0@ics.u-strasbg.fr \
    --to=muller@cerbere.u-strasbg.fr \
    --cc=gdb@sources.redhat.com \
    --cc=k_sarnath@ctd.hcltech.com \
    /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