public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug cli/17669] New: edit command wrong source line
@ 2014-12-02 15:26 kraftcheck at gmail dot com
  2014-12-02 15:28 ` [Bug cli/17669] " kraftcheck at gmail dot com
  2014-12-02 20:17 ` dje at google dot com
  0 siblings, 2 replies; 3+ messages in thread
From: kraftcheck at gmail dot com @ 2014-12-02 15:26 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 17669
           Summary: edit command wrong source line
           Product: gdb
           Version: 7.8
            Status: NEW
          Severity: normal
          Priority: P2
         Component: cli
          Assignee: unassigned at sourceware dot org
          Reporter: kraftcheck at gmail dot com

The source line passed to the editor for the 'edit' command appears to
consistently be off by five.  The script below will produce this output:

  Breakpoint 1, main () at test.c:3
  3      int i = 5;
  edit +8 /tmp/test.c

Note that source line is 3.  Line number passed to editor is 8.


#!/bin/sh

GDB=${HOME}/opt/gdb-7.8.1/bin/gdb

cat >test.c <<end_of_source
int main()
{
  int i = 5;
  int j = 6;
  int k = 1;
  return i - j + k;
}
end_of_source

gcc test.c -g -o test

cat <<end_of_gdb | EDITOR=echo $GDB test
b 2
r
edit
q
end_of_gdb

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


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

* [Bug cli/17669] edit command wrong source line
  2014-12-02 15:26 [Bug cli/17669] New: edit command wrong source line kraftcheck at gmail dot com
@ 2014-12-02 15:28 ` kraftcheck at gmail dot com
  2014-12-02 20:17 ` dje at google dot com
  1 sibling, 0 replies; 3+ messages in thread
From: kraftcheck at gmail dot com @ 2014-12-02 15:28 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Jason Kraftcheck <kraftcheck at gmail dot com> ---
Script and output don't quite match up.  Corrected script (cosmetic change).

#!/bin/sh

GDB=${HOME}/opt/gdb-7.8.1/bin/gdb

cat >test.c <<end_of_source
int main()
{
  int i = 5;
  int j = 6;
  int k = 1;
  return i - j + k;
}
end_of_source

gcc test.c -g -o test

cat <<end_of_gdb | EDITOR="echo edit" $GDB test
b 2
r
edit
q
end_of_gdb

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


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

* [Bug cli/17669] edit command wrong source line
  2014-12-02 15:26 [Bug cli/17669] New: edit command wrong source line kraftcheck at gmail dot com
  2014-12-02 15:28 ` [Bug cli/17669] " kraftcheck at gmail dot com
@ 2014-12-02 20:17 ` dje at google dot com
  1 sibling, 0 replies; 3+ messages in thread
From: dje at google dot com @ 2014-12-02 20:17 UTC (permalink / raw)
  To: gdb-prs

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

dje at google dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dje at google dot com

--- Comment #2 from dje at google dot com ---
I wonder if this is related to the list window size.

Yeah, simple experiments suggest it is.

E.g., do "set listsize 1", and I get the cursor on the right line.

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


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

end of thread, other threads:[~2014-12-02 20:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-02 15:26 [Bug cli/17669] New: edit command wrong source line kraftcheck at gmail dot com
2014-12-02 15:28 ` [Bug cli/17669] " kraftcheck at gmail dot com
2014-12-02 20:17 ` dje at google dot com

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