public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Nurdin Premji <npremji@redhat.com>
To: Roland McGrath <roland@redhat.com>
Cc: frysk <frysk@sourceware.org>
Subject: Re: Elfutils module reporting
Date: Mon, 16 Jul 2007 22:00:00 -0000	[thread overview]
Message-ID: <469BEA6A.606@redhat.com> (raw)
In-Reply-To: <20070716204031.42CC84D05BE@magilla.localdomain>

[-- Attachment #1: Type: text/plain, Size: 1441 bytes --]

Roland McGrath wrote:
> The expected pattern is that you do:
>
> 	dwfl_report_begin
> 	dwfl_report_foo all modules that are in the address space now
> 	dwfl_report_end
>
> i.e., just like with a fresh Dwfl, but dwfl_report_begin instead of dwfl_begin.
> This preserves the existing data structures for modules that haven't
> changed since before dwfl_report_begin, and removes any old modules that
> you didn't report again.  
>
> dwfl_report_begin_add is intended for something like gdb's add-symbol-file,
> where you are always just adding one new thing as opposed to re-synch'ing
> to the new set of mappings after they've changed.  It's just a shorthand
> and mild optimization for re-reporting all the existing modules after
> dwfl_report_begin.
>
> I could add something like a dwfl_report_remove to de-report a reported
> module in a reporting loop (which after dwfl_report_begin_add would be
> equivalent to removing the preexisting module).  But I'd rather exercise
> the interface as it stands a bit more before deciding to add a
> microoptimization.
>
>   
>> I got an assertion failure at the dwfl_report_end stage
>>  /home/yyz/npremji/mainworkspace/frysk/frysk-imports/elfutils/libdwfl/dwfl_module.c:249: 
>> dwfl_report_end: Assertion `i == dwfl->nmodules' failed.
>>     
>
> Please send me a small C test program to reproduce this bug.
>
>
> Thanks,
> Roland
>   
Try this. It was tested against elfutils 0.128 in fedora 7.

[-- Attachment #2: dwfltest.c --]
[-- Type: text/x-csrc, Size: 620 bytes --]

#include <libdwfl.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>

int main()
{
static char *flags = "-:.debug:/usr/lib/debug";
Dwfl_Callbacks *cbs = (Dwfl_Callbacks *) malloc(sizeof (Dwfl_Callbacks));
cbs->find_elf = dwfl_linux_proc_find_elf;
cbs->find_debuginfo = dwfl_standard_find_debuginfo;
cbs->debuginfo_path = &flags; 

Dwfl* dwfl = dwfl_begin(cbs);
dwfl_report_begin(dwfl);
dwfl_report_module(dwfl, "module1", 0, 10);
dwfl_report_end(dwfl, NULL, NULL);
dwfl_report_begin(dwfl);
dwfl_report_module(dwfl, "module1", 0, 10);
dwfl_report_end(dwfl, NULL, NULL);
}

  reply	other threads:[~2007-07-16 22:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-16 20:05 Nurdin Premji
2007-07-16 20:41 ` Roland McGrath
2007-07-16 22:00   ` Nurdin Premji [this message]
2007-07-16 22:25     ` Roland McGrath

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=469BEA6A.606@redhat.com \
    --to=npremji@redhat.com \
    --cc=frysk@sourceware.org \
    --cc=roland@redhat.com \
    /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).