On 12/09/2014 01:04 AM, Dave Anderson wrote:
Good catch -- thanks!

The "shifting" is due to the caching in symval_hash_search().  But since 
sp->name
is guaranteed to exist, I think the pre-existing strstr_rightmost() function 
makes
it a little easier to understand:

Yes, strstr_rightmost() will be better. And is it going to be merged into 7.1.0?


--- crash-7.0.9/symbols.c.orig
+++ crash-7.0.9/symbols.c
@@ -4527,6 +4527,11 @@ value_search(ulong value, ulong *offset)
                            (spnext->value == value))
                                sp = spnext;

+                       if (strstr_rightmost(sp->name, "_text_start")&&
+                           ((spnext = sp+1)<  st->symend)&&
+                           (spnext->value == value))
+                               sp = spnext;
+
                          return((struct syment *)sp);
                  }
                  if (sp->value>  value) {

and I'll add a comment above it.


--
Regards
Qiao Nuohan

--
Crash-utility mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/crash-utility

Reply via email to