daily update
[deliverable/binutils-gdb.git] / gdb / source.c
index 27c5b0e00b52d780f4c5106b6beb75d03292d6d6..bd11c63192e6e07305ee111a5beedbdf61cc5d49 100644 (file)
@@ -243,7 +243,8 @@ select_source_symtab (struct symtab *s)
      if one exists.  */
   if (lookup_symbol (main_name (), 0, VAR_DOMAIN, 0))
     {
-      sals = decode_line_spec (main_name (), DECODE_LINE_FUNFIRSTLINE);
+      sals = decode_line_with_current_source (main_name (),
+                                             DECODE_LINE_FUNFIRSTLINE);
       sal = sals.sals[0];
       xfree (sals.sals);
       current_source_pspace = sal.pspace;
@@ -769,6 +770,25 @@ openp (const char *path, int opts, const char *string,
            }
          strcpy (filename, current_directory);
        }
+      else if (strchr(dir, '~'))
+       {
+        /* See whether we need to expand the tilde.  */
+         int newlen;
+         char *tilde_expanded;
+
+         tilde_expanded  = tilde_expand (dir);
+
+         /* First, realloc the filename buffer if too short.  */
+         len = strlen (tilde_expanded);
+         newlen = len + strlen (string) + 2;
+         if (newlen > alloclen)
+           {
+             alloclen = newlen;
+             filename = alloca (alloclen);
+           }
+         strcpy (filename, tilde_expanded);
+         xfree (tilde_expanded);
+       }
       else
        {
          /* Normal file name in path -- just use it.  */
@@ -1061,7 +1081,7 @@ open_source_file (struct symtab *s)
    If this function fails to find the file that this symtab represents,
    NULL will be returned and s->fullname will be set to NULL.  */
 
-char *
+const char *
 symtab_to_fullname (struct symtab *s)
 {
   int r;
@@ -1386,7 +1406,7 @@ line_info (char *arg, int from_tty)
     }
   else
     {
-      sals = decode_line_spec_1 (arg, DECODE_LINE_LIST_MODE);
+      sals = decode_line_with_last_displayed (arg, DECODE_LINE_LIST_MODE);
 
       dont_repeat ();
     }
@@ -1945,12 +1965,12 @@ The matching line number is also stored as the value of \"$_\"."));
       add_com_alias ("?", "reverse-search", class_files, 0);
     }
 
-  add_setshow_integer_cmd ("listsize", class_support, &lines_to_list, _("\
+  add_setshow_zuinteger_unlimited_cmd ("listsize", class_support,
+                                      &lines_to_list, _("\
 Set number of source lines gdb will list by default."), _("\
 Show number of source lines gdb will list by default."), NULL,
-                           NULL,
-                           show_lines_to_list,
-                           &setlist, &showlist);
+                                      NULL, show_lines_to_list,
+                                      &setlist, &showlist);
 
   add_cmd ("substitute-path", class_files, set_substitute_path_command,
            _("\
This page took 0.024235 seconds and 4 git commands to generate.