btrace: Fix memory leak in btrace_clear.
[deliverable/binutils-gdb.git] / gdb / linespec.h
index 2a76283cfc3cccf3bdaeb80ee3e2d401eba5f650..f1244c408565dd3662cdfc9c47a08f4274b703a9 100644 (file)
@@ -1,5 +1,5 @@
 /* Header for GDB line completion.
-   Copyright (C) 2000-2015 Free Software Foundation, Inc.
+   Copyright (C) 2000-2017 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -19,6 +19,7 @@
 
 struct symtab;
 
+#include "location.h"
 #include "vec.h"
 
 /* Flags to pass to decode_line_1 and decode_line_full.  */
@@ -41,12 +42,12 @@ struct linespec_sals
 {
   /* This is the location corresponding to the sals contained in this
      object.  It can be passed as the FILTER argument to future calls
-     to decode_line_full.  This is freed by
-     destroy_linespec_result.  */
+     to decode_line_full.  This is freed by the linespec_result
+     destructor.  */
   char *canonical;
 
-  /* Sals.  The 'sals' field is destroyed by
-     destroy_linespec_result.  */
+  /* Sals.  The 'sals' field is destroyed by the linespec_result
+     destructor.  */
   struct symtabs_and_lines sals;
 };
 
@@ -54,12 +55,22 @@ typedef struct linespec_sals linespec_sals;
 DEF_VEC_O (linespec_sals);
 
 /* An instance of this may be filled in by decode_line_1.  The caller
-   must call init_linespec_result to initialize it and
-   destroy_linespec_result to destroy it.  The caller must make copies
-   of any data that it needs to keep.  */
+   must make copies of any data that it needs to keep.  */
 
 struct linespec_result
 {
+  linespec_result ()
+    : special_display (0),
+      pre_expanded (0),
+      sals (NULL)
+  {
+  }
+
+  ~linespec_result ();
+
+  linespec_result (const linespec_result &) = delete;
+  linespec_result &operator= (const linespec_result &) = delete;
+
   /* If non-zero, the linespec should be displayed to the user.  This
      is used by "unusual" linespecs where the ordinary `info break'
      display mechanism would do the wrong thing.  */
@@ -72,31 +83,18 @@ struct linespec_result
   int pre_expanded;
 
   /* If PRE_EXPANDED is non-zero, this is set to the location entered
-     by the user.  This will be freed by destroy_linespec_result.  */
-  struct event_location *location;
+     by the user.  */
+  event_location_up location;
 
-  /* The sals.  The vector will be freed by
-     destroy_linespec_result.  */
+  /* The sals.  The vector will be freed by the destructor.  */
   VEC (linespec_sals) *sals;
 };
 
-/* Initialize a linespec_result.  */
-
-extern void init_linespec_result (struct linespec_result *);
-
-/* Destroy a linespec_result.  */
-
-extern void destroy_linespec_result (struct linespec_result *);
-
-/* Return a cleanup that destroys a linespec_result.  */
-
-extern struct cleanup *
-        make_cleanup_destroy_linespec_result (struct linespec_result *);
-
 /* Decode a linespec using the provided default symtab and line.  */
 
 extern struct symtabs_and_lines
        decode_line_1 (const struct event_location *location, int flags,
+                      struct program_space *search_pspace,
                       struct symtab *default_symtab, int default_line);
 
 /* Parse LOCATION and return results.  This is the "full"
@@ -106,6 +104,9 @@ extern struct symtabs_and_lines
    For FLAGS, see decode_line_flags.  DECODE_LINE_LIST_MODE is not
    valid for this function.
 
+   If SEARCH_PSPACE is not NULL, symbol search is restricted to just
+   that program space.
+
    DEFAULT_SYMTAB and DEFAULT_LINE describe the default location.
    DEFAULT_SYMTAB can be NULL, in which case the current symtab and
    line are used.
@@ -136,6 +137,7 @@ extern struct symtabs_and_lines
    filtered out.  */
 
 extern void decode_line_full (const struct event_location *location, int flags,
+                             struct program_space *search_pspace,
                              struct symtab *default_symtab, int default_line,
                              struct linespec_result *canonical,
                              const char *select_mode,
This page took 0.038125 seconds and 4 git commands to generate.