• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修订版0fc21fd8cf92de78c3c383378e70a2955e2631c3 (tree)
时间2017-09-10 05:10:50
作者Tom Tromey <tom@trom...>
CommiterTom Tromey

Log Message

Use gdb::def_vector in create_sals_line_offset

This changes create_sals_line_offset to use gdb::def_vector, removing
some cleanups.

ChangeLog
2017-09-09 Tom Tromey <tom@tromey.com>

* linespec.c (create_sals_line_offset): Use gdb::def_vector.

更改概述

差异

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
11 2017-09-09 Tom Tromey <tom@tromey.com>
22
3+ * linespec.c (create_sals_line_offset): Use gdb::def_vector.
4+
5+2017-09-09 Tom Tromey <tom@tromey.com>
6+
37 * p-valprint.c (pascal_object_print_value): Use gdb::byte_vector.
48
59 2017-09-09 Tom Tromey <tom@tromey.com>
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -45,6 +45,7 @@
4545 #include "stack.h"
4646 #include "location.h"
4747 #include "common/function-view.h"
48+#include "common/def-vector.h"
4849
4950 /* An enumeration of the various things a user might attempt to
5051 complete for a linespec location. */
@@ -2182,8 +2183,6 @@ create_sals_line_offset (struct linespec_state *self,
21822183 else
21832184 {
21842185 struct linetable_entry *best_entry = NULL;
2185- int *filter;
2186- const struct block **blocks;
21872186 int i, j;
21882187
21892188 std::vector<symtab_and_line> intermediate_results
@@ -2203,10 +2202,8 @@ create_sals_line_offset (struct linespec_state *self,
22032202 above, we see if there are other PCs that are in the same
22042203 block. If yes, the other PCs are filtered out. */
22052204
2206- filter = XNEWVEC (int, intermediate_results.size ());
2207- struct cleanup *cleanup = make_cleanup (xfree, filter);
2208- blocks = XNEWVEC (const struct block *, intermediate_results.size ());
2209- make_cleanup (xfree, blocks);
2205+ gdb::def_vector<int> filter (intermediate_results.size ());
2206+ gdb::def_vector<const block *> blocks (intermediate_results.size ());
22102207
22112208 for (i = 0; i < intermediate_results.size (); ++i)
22122209 {
@@ -2245,8 +2242,6 @@ create_sals_line_offset (struct linespec_state *self,
22452242 add_sal_to_sals (self, &values, &intermediate_results[i],
22462243 sym ? SYMBOL_NATURAL_NAME (sym) : NULL, 0);
22472244 }
2248-
2249- do_cleanups (cleanup);
22502245 }
22512246
22522247 if (values.empty ())