[RFC dwarves 2/6] dwarf_loader: store address in function low_pc if available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



low_pc will be useful when we want to compare functions
by name and address.

Signed-off-by: Alan Maguire <alan.maguire@xxxxxxxxxx>
---
 dwarf_loader.c | 3 +++
 dwarves.h      | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/dwarf_loader.c b/dwarf_loader.c
index ccf3194..9271ac0 100644
--- a/dwarf_loader.c
+++ b/dwarf_loader.c
@@ -1319,6 +1319,9 @@ static struct function *function__new(Dwarf_Die *die, struct cu *cu, struct conf
 				    attr_type(die, DW_AT_specification));
 		func->accessibility   = attr_numeric(die, DW_AT_accessibility);
 		func->virtuality      = attr_numeric(die, DW_AT_virtuality);
+		func->has_low_pc      = dwarf_hasattr(die, DW_AT_low_pc);
+		if (func->has_low_pc)
+			dwarf_lowpc(die, &func->low_pc);
 		INIT_LIST_HEAD(&func->vtable_node);
 		INIT_LIST_HEAD(&func->annots);
 		INIT_LIST_HEAD(&func->tool_node);
diff --git a/dwarves.h b/dwarves.h
index eb1a6df..9cf13dd 100644
--- a/dwarves.h
+++ b/dwarves.h
@@ -937,7 +937,9 @@ struct function {
 	uint8_t		 virtuality:2; /* DW_VIRTUALITY_{none,virtual,pure_virtual} */
 	uint8_t		 declaration:1;
 	uint8_t		 btf:1;
+	uint8_t		 has_low_pc:1;
 	int32_t		 vtable_entry;
+	uint64_t	 low_pc;
 	struct list_head vtable_node;
 	struct list_head annots;
 	/* fields used by tools */
-- 
2.31.1





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux