From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90826 invoked by alias); 11 Mar 2015 13:11:59 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 90802 invoked by uid 48); 11 Mar 2015 13:11:59 -0000 From: "dpetras at gmx dot de" To: gdb-prs@sourceware.org Subject: [Bug gdb/18112] New: Search does not start at current line Date: Wed, 11 Mar 2015 13:21:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 7.9 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dpetras at gmx dot de X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-q1/txt/msg00421.txt.bz2 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.