Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFC/RFA] continue stepping if landed in new range of same line
Date: Sat, 22 Dec 2007 06:03:00 -0000	[thread overview]
Message-ID: <20071222060137.GS6154@adacore.com> (raw)
In-Reply-To: <20071221132401.GA22244@caradoc.them.org>

[-- Attachment #1: Type: text/plain, Size: 1247 bytes --]

> Might need (c-toggle-auto-state 1) too (C-c C-a).

Indeed, that enabled the auto-indenting. Thanks! I used to be an emacs
aficionado but a couple of years no slow (and shared) Solaris machines
had me converted to vim ;-).

> To be honest, I find this behavior a bit surprising.

Me too. I don't really like to abritrarily change the behavior of
the debugger, which is why I was trying to work around it, but it looks
like from our experiments that the originally intended behavior might
no longer be possible because of the current debugging info. And it looks
like it has been so for a number of years already - I looked at the
output generated by GCC 3.2.3, and we have the same line table.

I wouldn't mind removing the code altogether; as a bonus it would also
reduce the size of handle_inferior_event. I can send a patch now, or
I can poll users on gdb@ and see what they think... Honestly, given
the likeliness of one-line functions, I'd just say it's not very
important to keep that special case.

2007-12-22  Joel Brobecker  <brobecker@adacore.com>

        * infrun.c (handle_inferior_event): Remove code that made us
        stop when stepping into the last line of the current function.

Tested on x86-linux, no regression.

-- 
Joel

[-- Attachment #2: hie.diff --]
[-- Type: text/plain, Size: 1168 bytes --]

Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.260
diff -u -p -r1.260 infrun.c
--- infrun.c	19 Dec 2007 05:16:35 -0000	1.260
+++ infrun.c	22 Dec 2007 05:47:10 -0000
@@ -2702,20 +2702,6 @@ process_event_stop_test:
      new line in mid-statement, we continue stepping.  This makes
      things like for(;;) statements work better.)  */
 
-  if (ecs->stop_func_end && ecs->sal.end >= ecs->stop_func_end)
-    {
-      /* If this is the last line of the function, don't keep stepping
-         (it would probably step us out of the function).
-         This is particularly necessary for a one-line function,
-         in which after skipping the prologue we better stop even though
-         we will be in mid-line.  */
-      if (debug_infrun)
-	 fprintf_unfiltered (gdb_stdlog, "infrun: stepped to a different function\n");
-      stop_step = 1;
-      print_stop_reason (END_STEPPING_RANGE, 0);
-      stop_stepping (ecs);
-      return;
-    }
   step_range_start = ecs->sal.pc;
   step_range_end = ecs->sal.end;
   step_frame_id = get_frame_id (get_current_frame ());

  reply	other threads:[~2007-12-22  6:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-19 12:59 Joel Brobecker
2007-12-19 14:18 ` Daniel Jacobowitz
2007-12-20  5:40   ` Joel Brobecker
2007-12-20 14:08     ` Daniel Jacobowitz
2007-12-21  6:28       ` Joel Brobecker
2007-12-21 14:01         ` Daniel Jacobowitz
2007-12-22  6:03           ` Joel Brobecker [this message]
2007-12-22 18:05             ` Daniel Jacobowitz
2007-12-24  6:41               ` Joel Brobecker

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=20071222060137.GS6154@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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