public inbox for frysk-bugzilla@sourceware.org
help / color / mirror / Atom feed
From: "cagney at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: frysk-bugzilla@sourceware.org
Subject: [Bug general/6600] New: dwfl_module_getsrc doesn't allow for bias
Date: Fri, 06 Jun 2008 00:44:00 -0000	[thread overview]
Message-ID: <20080606004419.6600.cagney@redhat.com> (raw)

(unless of course the caller is expected to)

@@ -56,18 +57,24 @@ dwfl_module_getsrc (Dwfl_Module *mod, Dwarf_Addr addr)
   Dwarf_Addr bias;
   if (INTUSE(dwfl_module_getdwarf) (mod, &bias) == NULL)
     return NULL;
+  fprintf(stderr, "got dwarf 0x%lx\n", addr);
 
   struct dwfl_cu *cu;
   Dwfl_Error error = __libdwfl_addrcu (mod, addr, &cu);
   if (likely (error == DWFL_E_NOERROR))
     error = __libdwfl_cu_getsrclines (cu);
+  fprintf(stderr, "got addrcu\n");
   if (likely (error == DWFL_E_NOERROR))
     {
+      addr = addr - bias;
+      fprintf(stderr, "searching unbiased 0x%lx\n", (long) addr);
       /* The lines are sorted by address, so we can use binary search.  */
       size_t l = 0, u = cu->die.cu->lines->nlines;
       while (l < u)
        {
          size_t idx = (l + u) / 2;
+         fprintf(stderr, "%d 0x%lx\n", (int)idx,
+                 (long) cu->die.cu->lines->info[idx].addr);
          if (addr < cu->die.cu->lines->info[idx].addr)
            u = idx;
          else if (addr > cu->die.cu->lines->info[idx].addr)

which gives the improved effect:

got dwarf 0x2aaab057683c
addrarange 2aaab057683c
naranges 859
adjusted 6e83c by bias 2aaab0508000
found arange at 624
got addrcu
searching unbiased 0x6e83c
73 0x6e950
36 0x57fba
55 0x6e87b
46 0x6e83c

-- 
           Summary: dwfl_module_getsrc doesn't allow for bias
           Product: frysk
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: general
        AssignedTo: frysk-bugzilla at sourceware dot org
        ReportedBy: cagney at redhat dot com
OtherBugsDependingO 2785
             nThis:


http://sourceware.org/bugzilla/show_bug.cgi?id=6600

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


             reply	other threads:[~2008-06-06  0:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-06  0:44 cagney at redhat dot com [this message]
2008-06-06  0:49 ` [Bug general/6600] " cagney at redhat dot com
2008-06-07 12:27 ` cagney at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080606004419.6600.cagney@redhat.com \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=frysk-bugzilla@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).