[RFC dwarves 3/6] dwarf_loader: transfer low_pc info from subtroutine to its abstract origin

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

 



when recoding, often the subroutine DIE contains low_pc for a function
whereas the abstract origin it refers to does not; in such cases
copy the low_pc info into the abstract origin also.

Signed-off-by: Alan Maguire <alan.maguire@xxxxxxxxxx>
---
 dwarf_loader.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/dwarf_loader.c b/dwarf_loader.c
index 9271ac0..ed94873 100644
--- a/dwarf_loader.c
+++ b/dwarf_loader.c
@@ -2594,9 +2594,16 @@ static int tag__recode_dwarf_type(struct tag *tag, struct cu *cu)
 			dtype = dwarf_cu__find_tag_by_ref(cu->priv, &dtag->abstract_origin);
 			if (dtype == NULL)
 				dtype = dwarf_cu__find_tag_by_ref(cu->priv, &specification);
-			if (dtype != NULL)
-				fn->name = tag__function(dtype->tag)->name;
-			else {
+			if (dtype != NULL) {
+				struct function *ofn = tag__function(dtype->tag);
+
+				fn->name = ofn->name;
+				/* abstract origin may not have low_pc... */
+				if (fn->has_low_pc && !ofn->has_low_pc) {
+					ofn->has_low_pc = fn->has_low_pc;
+					ofn->low_pc = fn->low_pc;
+				}
+			} else {
 				fprintf(stderr,
 					"%s: couldn't find name for "
 					"function %#llx, abstract_origin=%#llx,"
-- 
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