[Bug cli/23687] allow more source lines to be shown by up/down/next/etc

palves at redhat dot com sourceware-bugzilla@sourceware.org
Thu Sep 20 12:16:00 GMT 2018


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.


More information about the Gdb-prs mailing list