From: Elena Zannoni <ezannoni@redhat.com>
To: Keith Seitz <keiths@redhat.com>
Cc: Elena Zannoni <ezannoni@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFA] stack.c: Always set current_source_{symtab,line}
Date: Thu, 29 Aug 2002 12:54:00 -0000 [thread overview]
Message-ID: <15726.30979.37641.242222@localhost.redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0208291226120.1396-100000@valrhona.uglyboxes.com>
Keith Seitz writes:
> On Thu, 29 Aug 2002, Elena Zannoni wrote:
>
> > Ok, I am going to be a PITA: does this odd behavior occur with non-mi
> > gdb? I am not clear on why it is happening only with mi. Or at
> > least I don't see it in regular gdb.
>
> This happens because we suppress printing the listing when we stop
> (infrun.c/normal_stop):
>
Ahhh, right. Ok, I am convinced.
Go ahead.
Elena
> if (stop_print_frame && selected_frame)
> {
> int bpstat_ret;
> int source_flag;
> int do_frame_printing = 1;
>
> bpstat_ret = bpstat_print (stop_bpstat);
> switch (bpstat_ret)
> {
> case PRINT_UNKNOWN:
> if (stop_step
> && step_frame_address == FRAME_FP (get_current_frame ())
> && step_start_function == find_pc_function (stop_pc))
> source_flag = SRC_LINE; /* finished step, just print source line */
> else
> source_flag = SRC_AND_LOC; /* print location and source line */
> break;
> case PRINT_SRC_AND_LOC:
> source_flag = SRC_AND_LOC; /* print location and source line */
> break;
> case PRINT_SRC_ONLY:
> source_flag = SRC_LINE;
> break;
> case PRINT_NOTHING:
> source_flag = SRC_LINE; /* something bogus */
> do_frame_printing = 0;
> break;
> default:
> internal_error (__FILE__, __LINE__, "Unknown value.");
> }
> /* For mi, have the same behavior every time we stop:
> print everything but the source line. */
> if (ui_out_is_mi_like_p (uiout))
> source_flag = LOC_AND_ADDRESS;
>
> We use LOC_AND_ADDRESS to suppress source listings, but a side affect is
> that it doesn't set current_source_symtab, either, because
> current_source_symtab is set in print_source_lines_base, called from
> print_source_lines, from print_frame_info_base:
>
> source_print = (source == SRC_LINE || source == SRC_AND_LOC);
>
> if (source_print && sal.symtab)
> {
> int done = 0;
> int mid_statement = (source == SRC_LINE) && (fi->pc != sal.pc);
>
> if (annotation_level)
> done = identify_source_line (sal.symtab, sal.line, mid_statement,
> fi->pc);
> if (!done)
> {
> if (print_frame_info_listing_hook)
> {
> print_frame_info_listing_hook (sal.symtab, sal.line, sal.line + 1, 0);
> current_source_symtab = sal.symtab;
> }
> else
> {
> /* We used to do this earlier, but that is clearly
> wrong. This function is used by many different
> parts of gdb, including normal_stop in infrun.c,
> which uses this to print out the current PC
> when we stepi/nexti into the middle of a source
> line. Only the command line really wants this
> behavior. Other UIs probably would like the
> ability to decide for themselves if it is desired. */
> if (addressprint && mid_statement)
> {
> ui_out_field_core_addr (uiout, "addr", fi->pc);
> ui_out_text (uiout, "\t");
> }
>
> print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
> }
> }
> current_source_line = max (sal.line - lines_to_list / 2, 1);
> }
>
> Keith
>
next prev parent reply other threads:[~2002-08-29 19:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-14 16:25 Keith Seitz
2002-08-22 11:09 ` Keith Seitz
2002-08-26 15:57 ` Kevin Buettner
2002-08-29 8:07 ` Elena Zannoni
2002-08-29 9:10 ` Keith Seitz
2002-08-29 12:32 ` Elena Zannoni
2002-08-29 12:43 ` Keith Seitz
2002-08-29 12:54 ` Elena Zannoni [this message]
2002-08-29 13:16 ` Keith Seitz
2002-08-29 20:28 ` Elena Zannoni
2002-08-30 11:12 ` Keith Seitz
2002-08-30 12:44 ` Andrew Cagney
2002-08-30 12:57 ` Keith Seitz
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=15726.30979.37641.242222@localhost.redhat.com \
--to=ezannoni@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=keiths@redhat.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