Fix: flt.lttng-utils.debug-info: Error in src line reporting
[babeltrace.git] / plugins / lttng-utils / bin-info.c
index c810f8c6f8e738bcdf7ba57218b4d71169be95e8..c3e16cec9b97c3ff38ec5c8315f4acc548f27360 100644 (file)
@@ -1218,22 +1218,37 @@ int bin_info_child_die_has_address(struct bt_dwarf_die *die, uint64_t addr, bool
        }
 
        do {
-               int tag;
-
-               ret = bt_dwarf_die_get_tag(die, &tag);
+               ret = bt_dwarf_die_contains_addr(die, addr, &_contains);
                if (ret) {
                        goto error;
                }
 
-               if (tag == DW_TAG_inlined_subroutine) {
-                       ret = bt_dwarf_die_contains_addr(die, addr, &_contains);
+               if (_contains) {
+                       /*
+                        * The address is within the range of the current DIE
+                        * or its children.
+                        */
+                       int tag;
+
+                       ret = bt_dwarf_die_get_tag(die, &tag);
                        if (ret) {
                                goto error;
                        }
 
-                       if (_contains) {
+                       if (tag == DW_TAG_inlined_subroutine) {
+                               /* Found the tracepoint. */
                                goto end;
                        }
+
+                       if (bt_dwarf_die_has_children(die)) {
+                               /*
+                                * Look for the address in the children DIEs.
+                                */
+                               ret = bt_dwarf_die_child(die);
+                               if (ret) {
+                                       goto error;
+                               }
+                       }
                }
        } while (bt_dwarf_die_next(die) == 0);
 
This page took 0.023957 seconds and 4 git commands to generate.