public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/18112] New: Search does not start at current line
@ 2015-03-11 13:21 dpetras at gmx dot de
  2024-01-05 13:32 ` [Bug gdb/18112] " ssbssa at sourceware dot org
  0 siblings, 1 reply; 2+ messages in thread
From: dpetras at gmx dot de @ 2015-03-11 13:21 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18112

            Bug ID: 18112
           Summary: Search does not start at current line
           Product: gdb
           Version: 7.9
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: dpetras at gmx dot de

When a program is suspended at a breakpoint and I search for a regex, then the
search does not start at the current line, but at the beginning of the source
file. To reproduce, set a breakpoint in the middle of a function and run your
program until the breakpoint is hit. Then do a
(gdb) serach .
GDB should print the next line after the breakpoint hit. But instead it prints
the first line of the file with the breakpoint hit.

I assume this goes back the the introduction of function
clear_lines_listed_range(void) in file gdb-7.9/gdb/source.c

A fix could look like this:

--- source.c    2015-03-10 16:29:20.000000000 +0100
+++ .BACKUP/source.c~    2015-02-20 18:11:44.000000000 +0100
@@ -1605,7 +1605,7 @@
   char *msg;
   struct cleanup *cleanups;

-  line = (last_line_listed!=0? last_line_listed : current_source_line) + 1;
+  line = last_line_listed + 1;

   msg = (char *) re_comp (regex);
   if (msg)
@@ -1694,7 +1694,7 @@
   char *msg;
   struct cleanup *cleanups;

-  line = (last_line_listed!=0? last_line_listed : current_source_line) - 1;
+  line = last_line_listed - 1;

   msg = (char *) re_comp (regex);
   if (msg)

Regards,
Dietmar

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug gdb/18112] Search does not start at current line
  2015-03-11 13:21 [Bug gdb/18112] New: Search does not start at current line dpetras at gmx dot de
@ 2024-01-05 13:32 ` ssbssa at sourceware dot org
  0 siblings, 0 replies; 2+ messages in thread
From: ssbssa at sourceware dot org @ 2024-01-05 13:32 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18112

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |doldiac at gmx dot de

--- Comment #1 from Hannes Domani <ssbssa at sourceware dot org> ---
*** Bug 26596 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-05 13:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-11 13:21 [Bug gdb/18112] New: Search does not start at current line dpetras at gmx dot de
2024-01-05 13:32 ` [Bug gdb/18112] " ssbssa at sourceware dot org

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