Thanks for reporting this bug to help improve Ubuntu!

I looked into the source code for the gdb list command (see at the end
of this comment). It looks to me that gdb will center the listing if it
is called for the first time with no other parameters.

If you want that the listing starts at the beginning of the file, use
"list 1" or "list FILE:1". (See more help by typing "help list").

We appreciate that this bug may be old and you might not be interested
in discussing it anymore. But if you are then please re-test. If you
then still think that this is a bug, please add a comment here telling
us, why you think this is a bug, how to re-produce it and which version
it is in (or at least which version you used).

Partial Source Code of gdb list command
=======================================
/* Pull in the current default source line if necessary.  */
  if (arg == NULL || ((arg[0] == '+' || arg[0] == '-') && arg[1] == '\0'))
    {
      set_default_source_symtab_and_line ();
      symtab_and_line cursal = get_current_source_symtab_and_line ();

      /* If this is the first "list" since we've set the current
         source line, center the listing around that line.  */
      if (get_first_line_listed () == 0)
        {
          int first;

          first = std::max (cursal.line - get_lines_to_list () / 2, 1);

          /* A small special case --- if listing backwards, and we
             should list only one line, list the preceding line,
             instead of the exact line we've just shown after e.g.,
             stopping for a breakpoint.  */
          if (arg != NULL && arg[0] == '-'
              && get_lines_to_list () == 1 && first > 1)
            first -= 1;

          print_source_lines (cursal.symtab, source_lines_range (first), 0);
        }

** Changed in: gdb (Ubuntu)
       Status: Confirmed => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to gdb in Ubuntu.
https://bugs.launchpad.net/bugs/1390905

Title:
  gdb list not from the first line

Status in gdb package in Ubuntu:
  Invalid

Bug description:
  when I use gdb list command, it does not list source code from the
  first line.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1390905/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to