mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-29 21:12:07 -06:00
util/selfmap: Rewrite using qemu/interval-tree.h
We will want to be able to search the set of mappings. For this patch, the two users iterate the tree in order. Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
5f4e5b3409
commit
3ce3dd8ca9
4 changed files with 97 additions and 68 deletions
|
@ -9,9 +9,10 @@
|
|||
#ifndef SELFMAP_H
|
||||
#define SELFMAP_H
|
||||
|
||||
#include "qemu/interval-tree.h"
|
||||
|
||||
typedef struct {
|
||||
unsigned long start;
|
||||
unsigned long end;
|
||||
IntervalTreeNode itree;
|
||||
|
||||
/* flags */
|
||||
bool is_read;
|
||||
|
@ -19,26 +20,25 @@ typedef struct {
|
|||
bool is_exec;
|
||||
bool is_priv;
|
||||
|
||||
unsigned long offset;
|
||||
gchar *dev;
|
||||
uint64_t offset;
|
||||
uint64_t inode;
|
||||
gchar *path;
|
||||
const char *path;
|
||||
char dev[];
|
||||
} MapInfo;
|
||||
|
||||
|
||||
/**
|
||||
* read_self_maps:
|
||||
*
|
||||
* Read /proc/self/maps and return a list of MapInfo structures.
|
||||
* Read /proc/self/maps and return a tree of MapInfo structures.
|
||||
*/
|
||||
GSList *read_self_maps(void);
|
||||
IntervalTreeRoot *read_self_maps(void);
|
||||
|
||||
/**
|
||||
* free_self_maps:
|
||||
* @info: a GSlist
|
||||
* @info: an interval tree
|
||||
*
|
||||
* Free a list of MapInfo structures.
|
||||
* Free a tree of MapInfo structures.
|
||||
*/
|
||||
void free_self_maps(GSList *info);
|
||||
void free_self_maps(IntervalTreeRoot *root);
|
||||
|
||||
#endif /* SELFMAP_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue