aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2018-01-18 15:29:31 +0000
committerYao Qi <yao.qi@linaro.org>2018-01-18 15:29:31 +0000
commit4a17f7688fbab8f170144fa13ffcd06bc749e6ec (patch)
treeee5988583bfae076826cfff190d175702fd4a7dc
parentd679c21a43852305c5eeae957854f6e13d6f884c (diff)
downloadgdb-4a17f7688fbab8f170144fa13ffcd06bc749e6ec.zip
gdb-4a17f7688fbab8f170144fa13ffcd06bc749e6ec.tar.gz
gdb-4a17f7688fbab8f170144fa13ffcd06bc749e6ec.tar.bz2
Make abbrev_table::abbrevs private
abbrev_table::abbrevs is only access within abbrev_table's methods, so it can be private. Add "m_" prefix. gdb: 2018-01-18 Yao Qi <yao.qi@linaro.org> * dwarf2read.c (abbrev_table) <abbrevs>: Rename it to m_abbrevs. (abbrev_table::add_abbrev): Update. (abbrev_table::lookup_abbrev): Update.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/dwarf2read.c14
2 files changed, 15 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 926ee20..90dacd2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2018-01-18 Yao Qi <yao.qi@linaro.org>
+ * dwarf2read.c (abbrev_table) <abbrevs>: Rename it to
+ m_abbrevs.
+ (abbrev_table::add_abbrev): Update.
+ (abbrev_table::lookup_abbrev): Update.
+
+2018-01-18 Yao Qi <yao.qi@linaro.org>
+
* ppc-linux-tdep.c (ppu2spu_prev_register): Call cooked_read.
2018-01-17 Sergio Durigan Junior <sergiodj@redhat.com>
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index d9ebf4e..215f331 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -1514,9 +1514,9 @@ struct abbrev_table
explicit abbrev_table (sect_offset off)
: sect_off (off)
{
- abbrevs =
+ m_abbrevs =
XOBNEWVEC (&abbrev_obstack, struct abbrev_info *, ABBREV_HASH_SIZE);
- memset (abbrevs, 0, ABBREV_HASH_SIZE * sizeof (struct abbrev_info *));
+ memset (m_abbrevs, 0, ABBREV_HASH_SIZE * sizeof (struct abbrev_info *));
}
DISABLE_COPY_AND_ASSIGN (abbrev_table);
@@ -1541,11 +1541,13 @@ struct abbrev_table
/* Storage for the abbrev table. */
auto_obstack abbrev_obstack;
+private:
+
/* Hash table of abbrevs.
This is an array of size ABBREV_HASH_SIZE allocated in abbrev_obstack.
It could be statically allocated, but the previous code didn't so we
don't either. */
- struct abbrev_info **abbrevs;
+ struct abbrev_info **m_abbrevs;
};
typedef std::unique_ptr<struct abbrev_table> abbrev_table_up;
@@ -18011,8 +18013,8 @@ abbrev_table::add_abbrev (unsigned int abbrev_number,
unsigned int hash_number;
hash_number = abbrev_number % ABBREV_HASH_SIZE;
- abbrev->next = abbrevs[hash_number];
- abbrevs[hash_number] = abbrev;
+ abbrev->next = m_abbrevs[hash_number];
+ m_abbrevs[hash_number] = abbrev;
}
/* Look up an abbrev in the table.
@@ -18025,7 +18027,7 @@ abbrev_table::lookup_abbrev (unsigned int abbrev_number)
struct abbrev_info *abbrev;
hash_number = abbrev_number % ABBREV_HASH_SIZE;
- abbrev = abbrevs[hash_number];
+ abbrev = m_abbrevs[hash_number];
while (abbrev)
{