GDB (xrefs)

Classes | Functions | Variables
/tmp/gdb-8.1/gdb/addrmap.c File Reference
`#include "defs.h"`
`#include "splay-tree.h"`
`#include "gdb_obstack.h"`
`#include "addrmap.h"`

Go to the source code of this file.

## Classes
struct | addrmap_funcs
struct | addrmap
struct | addrmap_transition
struct | addrmap_fixed
struct | addrmap_mutable
struct | mutable_foreach_data

## Functions
void | addrmap_set_empty (struct addrmap *map, CORE_ADDR start, CORE_ADDR end_inclusive, void *obj)
void * | addrmap_find (struct addrmap *map, CORE_ADDR addr)
struct addrmap * | addrmap_create_fixed (struct addrmap *original, struct obstack *obstack)
void | addrmap_relocate (struct addrmap *map, CORE_ADDR offset)
int | addrmap_foreach (struct addrmap *map, addrmap_foreach_fn fn, void *data)
static void | addrmap_fixed_set_empty (struct addrmap *self, CORE_ADDR start, CORE_ADDR end_inclusive, void *obj)
static void * | addrmap_fixed_find (struct addrmap *self, CORE_ADDR addr)
static struct addrmap * | addrmap_fixed_create_fixed (struct addrmap *self, struct obstack *obstack)
static void | addrmap_fixed_relocate (struct addrmap *self, CORE_ADDR offset)
static int | addrmap_fixed_foreach (struct addrmap *self, addrmap_foreach_fn fn, void *data)
static splay_tree_key | allocate_key (struct addrmap_mutable *map, CORE_ADDR addr)
static splay_tree_node | addrmap_splay_tree_lookup (struct addrmap_mutable *map, CORE_ADDR addr)
static splay_tree_node | addrmap_splay_tree_predecessor (struct addrmap_mutable *map, CORE_ADDR addr)
static splay_tree_node | addrmap_splay_tree_successor (struct addrmap_mutable *map, CORE_ADDR addr)
static void | addrmap_splay_tree_remove (struct addrmap_mutable *map, CORE_ADDR addr)
static CORE_ADDR | addrmap_node_key (splay_tree_node node)
static void * | addrmap_node_value (splay_tree_node node)
static void | addrmap_node_set_value (splay_tree_node node, void *value)
static void | addrmap_splay_tree_insert (struct addrmap_mutable *map, CORE_ADDR key, void *value)
static void | force_transition (struct addrmap_mutable *self, CORE_ADDR addr)
static void | addrmap_mutable_set_empty (struct addrmap *self, CORE_ADDR start, CORE_ADDR end_inclusive, void *obj)
static void * | addrmap_mutable_find (struct addrmap *self, CORE_ADDR addr)
static int | splay_foreach_count (splay_tree_node n, void *closure)
static int | splay_foreach_copy (splay_tree_node n, void *closure)
static struct addrmap * | addrmap_mutable_create_fixed (struct addrmap *self, struct obstack *obstack)
static void | addrmap_mutable_relocate (struct addrmap *self, CORE_ADDR offset)
static int | addrmap_mutable_foreach_worker (splay_tree_node node, void *data)
static int | addrmap_mutable_foreach (struct addrmap *self, addrmap_foreach_fn fn, void *data)
static void * | splay_obstack_alloc (int size, void *closure)
static void | splay_obstack_free (void *obj, void *closure)
static int | splay_compare_CORE_ADDR_ptr (splay_tree_key ak, splay_tree_key bk)
struct addrmap * | addrmap_create_mutable (struct obstack *obstack)
void | _initialize_addrmap (void)

## Variables
static const struct addrmap_funcs | addrmap_fixed_funcs
static const struct addrmap_funcs | addrmap_mutable_funcs

## Function Documentation

## ◆ _initialize_addrmap()

void _initialize_addrmap | ( | void |  | ) |

Definition at line 594 of file addrmap.c.

References gdb_assert.

## ◆ addrmap_create_fixed()

struct addrmap* addrmap_create_fixed | ( | struct addrmap * | original,
|  | struct obstack * | obstack
| ) |  |

Definition at line 66 of file addrmap.c.

References addrmap_funcs::create_fixed, and addrmap::funcs.

Referenced by create_addrmap_from_aranges(), create_addrmap_from_index(), dwarf2_build_psymtabs_hard(), and make_blockvector().

## ◆ addrmap_create_mutable()

struct addrmap* addrmap_create_mutable | ( | struct obstack * | obstack | ) |

Definition at line 569 of file addrmap.c.

References addrmap_mutable::addrmap, addrmap_mutable_funcs, addrmap_mutable::free_nodes, addrmap::funcs, addrmap_mutable::obstack, splay_compare_CORE_ADDR_ptr(), splay_obstack_alloc(), splay_obstack_free(), and addrmap_mutable::tree.

Referenced by create_addrmap_from_aranges(), create_addrmap_from_index(), dwarf2_build_psymtabs_hard(), and record_block_range().

## ◆ addrmap_find()

void* addrmap_find | ( | struct addrmap * | map,
|  | CORE_ADDR | addr
| ) |  |

Definition at line 59 of file addrmap.c.

References addrmap_funcs::find, and addrmap::funcs.

Referenced by block_starting_point_at(), dw2_find_pc_sect_compunit_symtab(), find_block_in_blockvector(), and find_pc_sect_psymtab().

## ◆ addrmap_fixed_create_fixed()

static struct addrmap* addrmap_fixed_create_fixed | ( | struct addrmap * | self,
|  | struct obstack * | obstack
| ) |  |
| static

Definition at line 160 of file addrmap.c.

References _, and internal_error().

## ◆ addrmap_fixed_find()

static void* addrmap_fixed_find | ( | struct addrmap * | self,
|  | CORE_ADDR | addr
| ) |  |
| static

Definition at line 127 of file addrmap.c.

References addrmap_transition::addr, addrmap_fixed::num_transitions, addrmap_fixed::transitions, and addrmap_transition::value.

## ◆ addrmap_fixed_foreach()

static int addrmap_fixed_foreach | ( | struct addrmap * | self,
|  | addrmap_foreach_fn | fn,
|  | void * | data
| ) |  |
| static

Definition at line 180 of file addrmap.c.

References addrmap_transition::addr, addrmap_fixed::num_transitions, addrmap_fixed::transitions, and addrmap_transition::value.

## ◆ addrmap_fixed_relocate()

static void addrmap_fixed_relocate | ( | struct addrmap * | self,
|  | CORE_ADDR | offset
| ) |  |
| static

Definition at line 169 of file addrmap.c.

References addrmap_transition::addr, addrmap_fixed::num_transitions, offset, and addrmap_fixed::transitions.

## ◆ addrmap_fixed_set_empty()

static void addrmap_fixed_set_empty | ( | struct addrmap * | self,
|  | CORE_ADDR | start,
|  | CORE_ADDR | end_inclusive,
|  | void * | obj
| ) |  |
| static

Definition at line 116 of file addrmap.c.

References internal_error().

## ◆ addrmap_foreach()

int addrmap_foreach | ( | struct addrmap * | map,
|  | addrmap_foreach_fn | fn,
|  | void * | data
| ) |  |

Definition at line 82 of file addrmap.c.

References addrmap_funcs::foreach, and addrmap::funcs.

Referenced by dump_psymtab_addrmap(), and write_address_map().

## ◆ addrmap_mutable_create_fixed()

static struct addrmap* addrmap_mutable_create_fixed | ( | struct addrmap * | self,
|  | struct obstack * | obstack
| ) |  |
| static

Definition at line 425 of file addrmap.c.

References addrmap_transition::addr, addrmap_fixed::addrmap, addrmap_fixed_funcs, addrmap::funcs, gdb_assert, addrmap_fixed::num_transitions, splay_foreach_copy(), splay_foreach_count(), addrmap_fixed::transitions, addrmap_mutable::tree, and addrmap_transition::value.

## ◆ addrmap_mutable_find()

static void* addrmap_mutable_find | ( | struct addrmap * | self,
|  | CORE_ADDR | addr
| ) |  |
| static

Definition at line 387 of file addrmap.c.

References _, and internal_error().

## ◆ addrmap_mutable_foreach()

static int addrmap_mutable_foreach | ( | struct addrmap * | self,
|  | addrmap_foreach_fn | fn,
|  | void * | data
| ) |  |
| static

Definition at line 492 of file addrmap.c.

References addrmap_mutable_foreach_worker(), mutable_foreach_data::data, mutable_foreach_data::fn, and addrmap_mutable::tree.

## ◆ addrmap_mutable_foreach_worker()

static int addrmap_mutable_foreach_worker | ( | splay_tree_node | node,
|  | void * | data
| ) |  |
| static

Definition at line 480 of file addrmap.c.

References addrmap_node_key(), addrmap_node_value(), mutable_foreach_data::data, and mutable_foreach_data::fn.

Referenced by addrmap_mutable_foreach().

## ◆ addrmap_mutable_relocate()

static void addrmap_mutable_relocate | ( | struct addrmap * | self,
|  | CORE_ADDR | offset
| ) |  |
| static

Definition at line 460 of file addrmap.c.

References _, and internal_error().

## ◆ addrmap_mutable_set_empty()

static void addrmap_mutable_set_empty | ( | struct addrmap * | self,
|  | CORE_ADDR | start,
|  | CORE_ADDR | end_inclusive,
|  | void * | obj
| ) |  |
| static

Definition at line 333 of file addrmap.c.

References addrmap_node_key(), addrmap_node_set_value(), addrmap_node_value(), addrmap_splay_tree_lookup(), addrmap_splay_tree_predecessor(), addrmap_splay_tree_remove(), addrmap_splay_tree_successor(), CORE_ADDR_MAX, force_transition(), and gdb_assert.

## ◆ addrmap_node_key()

static CORE_ADDR addrmap_node_key | ( | splay_tree_node | node | ) |
| static

Definition at line 284 of file addrmap.c.

Referenced by addrmap_mutable_foreach_worker(), addrmap_mutable_set_empty(), and splay_foreach_copy().

## ◆ addrmap_node_set_value()

static void addrmap_node_set_value | ( | splay_tree_node | node,
|  | void * | value
| ) |  |
| static

Definition at line 298 of file addrmap.c.

Referenced by addrmap_mutable_set_empty().

## ◆ addrmap_node_value()

static void* addrmap_node_value | ( | splay_tree_node | node | ) |
| static

Definition at line 291 of file addrmap.c.

Referenced by addrmap_mutable_foreach_worker(), addrmap_mutable_set_empty(), force_transition(), and splay_foreach_copy().

## ◆ addrmap_relocate()

void addrmap_relocate | ( | struct addrmap * | map,
|  | CORE_ADDR | offset
| ) |  |

Definition at line 75 of file addrmap.c.

References addrmap::funcs, offset, and addrmap_funcs::relocate.

Referenced by objfile_relocate1().

## ◆ addrmap_set_empty()

void addrmap_set_empty | ( | struct addrmap * | map,
|  | CORE_ADDR | start,
|  | CORE_ADDR | end_inclusive,
|  | void * | obj
| ) |  |

Definition at line 50 of file addrmap.c.

References addrmap::funcs, and addrmap_funcs::set_empty.

Referenced by add_partial_subprogram(), create_addrmap_from_aranges(), create_addrmap_from_index(), dwarf2_ranges_read(), process_psymtab_comp_unit_reader(), and record_block_range().

## ◆ addrmap_splay_tree_insert()

static void addrmap_splay_tree_insert | ( | struct addrmap_mutable * | map,
|  | CORE_ADDR | key,
|  | void * | value
| ) |  |
| static

Definition at line 305 of file addrmap.c.

References allocate_key(), and addrmap_mutable::tree.

Referenced by force_transition().

## ◆ addrmap_splay_tree_lookup()

static splay_tree_node addrmap_splay_tree_lookup | ( | struct addrmap_mutable * | map,
|  | CORE_ADDR | addr
| ) |  |
| static

Definition at line 256 of file addrmap.c.

References addrmap_mutable::tree.

Referenced by addrmap_mutable_set_empty(), and force_transition().

## ◆ addrmap_splay_tree_predecessor()

static splay_tree_node addrmap_splay_tree_predecessor | ( | struct addrmap_mutable * | map,
|  | CORE_ADDR | addr
| ) |  |
| static

Definition at line 263 of file addrmap.c.

References addrmap_mutable::tree.

Referenced by addrmap_mutable_set_empty(), and force_transition().

## ◆ addrmap_splay_tree_remove()

static void addrmap_splay_tree_remove | ( | struct addrmap_mutable * | map,
|  | CORE_ADDR | addr
| ) |  |
| static

Definition at line 277 of file addrmap.c.

References addrmap_mutable::tree.

Referenced by addrmap_mutable_set_empty().

## ◆ addrmap_splay_tree_successor()

static splay_tree_node addrmap_splay_tree_successor | ( | struct addrmap_mutable * | map,
|  | CORE_ADDR | addr
| ) |  |
| static

Definition at line 270 of file addrmap.c.

References addrmap_mutable::tree.

Referenced by addrmap_mutable_set_empty().

## ◆ allocate_key()

static splay_tree_key allocate_key | ( | struct addrmap_mutable * | map,
|  | CORE_ADDR | addr
| ) |  |
| static

Definition at line 245 of file addrmap.c.

References addrmap_mutable::obstack.

Referenced by addrmap_splay_tree_insert().

## ◆ force_transition()

static void force_transition | ( | struct addrmap_mutable * | self,
|  | CORE_ADDR | addr
| ) |  |
| static

Definition at line 318 of file addrmap.c.

References addrmap_node_value(), addrmap_splay_tree_insert(), addrmap_splay_tree_lookup(), and addrmap_splay_tree_predecessor().

Referenced by addrmap_mutable_set_empty().

## ◆ splay_compare_CORE_ADDR_ptr()

static int splay_compare_CORE_ADDR_ptr | ( | splay_tree_key | ak,
|  | splay_tree_key | bk
| ) |  |
| static

Definition at line 553 of file addrmap.c.

Referenced by addrmap_create_mutable().

## ◆ splay_foreach_copy()

static int splay_foreach_copy | ( | splay_tree_node | n,
|  | void * | closure
| ) |  |
| static

Definition at line 411 of file addrmap.c.

References addrmap_transition::addr, addrmap_node_key(), addrmap_node_value(), addrmap_fixed::num_transitions, addrmap_fixed::transitions, and addrmap_transition::value.

Referenced by addrmap_mutable_create_fixed().

## ◆ splay_foreach_count()

static int splay_foreach_count | ( | splay_tree_node | n,
|  | void * | closure
| ) |  |
| static

Definition at line 399 of file addrmap.c.

Referenced by addrmap_mutable_create_fixed().

## ◆ splay_obstack_alloc()

static void* splay_obstack_alloc | ( | int | size,
|  | void * | closure
| ) |  |
| static

Definition at line 516 of file addrmap.c.

References addrmap_mutable::free_nodes, gdb_assert, addrmap_mutable::obstack, and size.

Referenced by addrmap_create_mutable().

## ◆ splay_obstack_free()

static void splay_obstack_free | ( | void * | obj,
|  | void * | closure
| ) |  |
| static

Definition at line 538 of file addrmap.c.

References addrmap_mutable::free_nodes.

Referenced by addrmap_create_mutable().

## Variable Documentation

## ◆ addrmap_fixed_funcs

const struct addrmap_funcs addrmap_fixed_funcs
| static

Initial value:
=
{
addrmap_fixed_set_empty,
addrmap_fixed_find,
addrmap_fixed_create_fixed,
addrmap_fixed_relocate,
addrmap_fixed_foreach
}
addrmap_fixed_find
static void * addrmap_fixed_find(struct addrmap *self, CORE_ADDR addr)
Definition: addrmap.c:127
addrmap_fixed_foreach
static int addrmap_fixed_foreach(struct addrmap *self, addrmap_foreach_fn fn, void *data)
Definition: addrmap.c:180
addrmap_fixed_create_fixed
static struct addrmap * addrmap_fixed_create_fixed(struct addrmap *self, struct obstack *obstack)
Definition: addrmap.c:160
addrmap_fixed_relocate
static void addrmap_fixed_relocate(struct addrmap *self, CORE_ADDR offset)
Definition: addrmap.c:169
addrmap_fixed_set_empty
static void addrmap_fixed_set_empty(struct addrmap *self, CORE_ADDR start, CORE_ADDR end_inclusive, void *obj)
Definition: addrmap.c:116

Definition at line 198 of file addrmap.c.

Referenced by addrmap_mutable_create_fixed().

## ◆ addrmap_mutable_funcs

const struct addrmap_funcs addrmap_mutable_funcs
| static

Initial value:
=
{
addrmap_mutable_set_empty,
addrmap_mutable_find,
addrmap_mutable_create_fixed,
addrmap_mutable_relocate,
addrmap_mutable_foreach
}
addrmap_mutable_relocate
static void addrmap_mutable_relocate(struct addrmap *self, CORE_ADDR offset)
Definition: addrmap.c:460
addrmap_mutable_find
static void * addrmap_mutable_find(struct addrmap *self, CORE_ADDR addr)
Definition: addrmap.c:387
addrmap_mutable_create_fixed
static struct addrmap * addrmap_mutable_create_fixed(struct addrmap *self, struct obstack *obstack)
Definition: addrmap.c:425
addrmap_mutable_foreach
static int addrmap_mutable_foreach(struct addrmap *self, addrmap_foreach_fn fn, void *data)
Definition: addrmap.c:492
addrmap_mutable_set_empty
static void addrmap_mutable_set_empty(struct addrmap *self, CORE_ADDR start, CORE_ADDR end_inclusive, void *obj)
Definition: addrmap.c:333

Definition at line 505 of file addrmap.c.

Referenced by addrmap_create_mutable().