Discussion:
[Bug cli/23687] New: allow more source lines to be shown by up/down/next/etc
tromey at sourceware dot org
2018-09-19 14:53:43 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23687

Bug ID: 23687
Summary: allow more source lines to be shown by
up/down/next/etc
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: cli
Assignee: unassigned at sourceware dot org
Reporter: tromey at sourceware dot org
Target Milestone: ---

gdb will show the current line after step/next/etc.
lldb lets you configure the number of lines shown, so you
can see some context. Some users (there was a request on irc)
prefer this behavior, so gdb should add it.
--
You are receiving this mail because:
You are on the CC list for the bug.
kevin.tew at gmail dot com
2018-09-19 15:00:24 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23687

kevin.tew at gmail dot com changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |kevin.tew at gmail dot com

--- Comment #1 from kevin.tew at gmail dot com ---
lldb uses the following settings

settings set stop-line-count-before 30
settings set stop-line-count-after 10
--
You are receiving this mail because:
You are on the CC list for the bug.
palves at redhat dot com
2018-09-20 12:15:16 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23687

Pedro Alves <palves at redhat dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |palves at redhat dot com

--- Comment #2 from Pedro Alves <palves at redhat dot com> ---
I experimented with something like that last year. Take a look at this branch
(freshly rebased on current master):

https://github.com/palves/gdb/commits/palves/list-improvements

Here's what it looks like:

(gdb) start
Temporary breakpoint 1 at 0x400835: file threads.c, line 55.
[...]
Temporary breakpoint 1, main () at threads.c:55
50
51 int main() {
52 int res;
53 pthread_t threads[2];
54 void *thread_result;
-> 55 long i = 0;
56
57 args[i] = 1; /* Init value. */
58 res = pthread_create(&threads[i],
59 NULL,
(gdb) n
main () at threads.c:57
52 int res;
53 pthread_t threads[2];
54 void *thread_result;
55 long i = 0;
56
-> 57 args[i] = 1; /* Init value. */
58 res = pthread_create(&threads[i],
59 NULL,
60 thread_function0,
61 (void *) i);
(gdb) list
52 int res;
53 pthread_t threads[2];
54 void *thread_result;
55 long i = 0;
56
-> 57 args[i] = 1; /* Init value. */
58 res = pthread_create(&threads[i],
59 NULL,
60 thread_function0,
61 (void *) i);

Back then I stopped with these questions:

~~~~
should have a "set show-list-on-stop-mode foo|bar" enum option?

should have an option like "set listsize" just for the stop listing?

should always print the frame/source in the header?

should "list" print the "->" arrow?
~~~~

IMO, displaying more lines by default and the arrow is more user friendly,
but you never know what others think. There's also testsuite consequences, of
course...
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...