public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "dpetras at gmx dot de" <sourceware-bugzilla@sourceware.org> 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 [thread overview] Message-ID: <bug-18112-4717@http.sourceware.org/bugzilla/> (raw) 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.
next reply other threads:[~2015-03-11 13:11 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-03-11 13:21 dpetras at gmx dot de [this message] 2024-01-05 13:32 ` [Bug gdb/18112] " ssbssa at sourceware dot org
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=bug-18112-4717@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=gdb-prs@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: linkBe 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; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).