aboutsummaryrefslogtreecommitdiff
path: root/gdb/block.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-01-20 07:46:51 -0700
committerTom Tromey <tom@tromey.com>2023-02-19 12:51:06 -0700
commit0d1912950e35ff6555d12c0baa983acc006c3cf0 (patch)
treeda40715cada37627b7c1d943cb251c30585a14fa /gdb/block.h
parentb32797e8b99b53d4cdd22a4e649792146b219adc (diff)
downloadgdb-0d1912950e35ff6555d12c0baa983acc006c3cf0.zip
gdb-0d1912950e35ff6555d12c0baa983acc006c3cf0.tar.gz
gdb-0d1912950e35ff6555d12c0baa983acc006c3cf0.tar.bz2
Convert contained_in to method
This converts contained_in to be a method of block.
Diffstat (limited to 'gdb/block.h')
-rw-r--r--gdb/block.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/gdb/block.h b/gdb/block.h
index 32e3c9e..cdcee08 100644
--- a/gdb/block.h
+++ b/gdb/block.h
@@ -271,6 +271,15 @@ struct block : public allocate_on_obstack
struct dynamic_prop *static_link () const;
+ /* Return true if block A is lexically nested within this block, or
+ if A and this block have the same pc range. Return false
+ otherwise. If ALLOW_NESTED is true, then block A is considered
+ to be in this block if A is in a nested function in this block's
+ function. If ALLOW_NESTED is false (the default), then blocks in
+ nested functions are not considered to be contained. */
+
+ bool contains (const struct block *a, bool allow_nested = false) const;
+
private:
/* If the namespace_info is NULL, allocate it via OBSTACK and
@@ -400,16 +409,6 @@ private:
struct block *m_blocks[1];
};
-/* Return true if block A is lexically nested within block B, or if a
- and b have the same pc range. Return false otherwise. If
- ALLOW_NESTED is true, then block A is considered to be in block B
- if A is in a nested function in B's function. If ALLOW_NESTED is
- false (the default), then blocks in nested functions are not
- considered to be contained. */
-
-extern bool contained_in (const struct block *a, const struct block *b,
- bool allow_nested = false);
-
extern const struct blockvector *blockvector_for_pc (CORE_ADDR,
const struct block **);