Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Aleksandar Ristovski <aristovski@qnx.com>
To: gdb@sources.redhat.com
Subject: Re: corelow and threads question
Date: Tue, 09 Jun 2009 16:10:00 -0000	[thread overview]
Message-ID: <h0m1h3$pbd$1@ger.gmane.org> (raw)
In-Reply-To: <200906060127.57034.pedro@codesourcery.com>

Hello Pedro,

Thanks for your comments.

Pedro Alves wrote:
> On Friday 05 June 2009 20:40:23, Aleksandar Ristovski wrote:
> 
>> +static LONGEST
>> +nto_core_xfer_partial (struct target_ops *ops, enum target_object object,
>> +                      const char *annex, gdb_byte *readbuf,
>> +                      const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
>> +{
>> +  if (object == TARGET_OBJECT_AUXV
>> +      && readbuf)
>> +    {
...
> 
> You don't really need this.  Fix bfd/elf.c to grok the note, and export
> a .auxv section, just like corelow.c expects, and other archs do.

I agree, however, my problem is, we do not really dump auxv 
in a note, I have to retrieve auxv from initial stack; I 
only read status from the note (and from status initial 
stack), then have to read target memory to fetch auxv.

> 
>> +  core_ops->to_extra_thread_info = nto_target_extra_thread_info;
> 
> Looks like one of two things would be possible here:
>  - a gdbarch callback so that cores can customize this, move the
>    needed code into a nto-tdep.c file, and register the callback.
>  - come up with new fake bfd sections like e.g., ".thrextrainfo/TID"
>    (named similarly to to .reg/TID), whose contents would simply be the
>    string GDB should display, in target_extra_thread_info.  Implement support
>    for that in bfd and corelow.c.

The main purpose of fetching extra thread info is to fetch 
thread statuses.

> 
>> +  core_ops->to_xfer_partial = nto_core_xfer_partial;
> 
> This isn't needed, as explained.
> 
>> +  core_ops->to_pid_to_str = nto_pid_to_str;
> 
> There's already a gdbarch callback  for this.

Ok, thanks.

> 
>> +  core_ops->to_find_new_threads = nto_find_new_threads_in_core;
> 
> Then you'd not have a need for this.  Do any extra needed processing
> lazilly in to_extra_thread_info if you must.
> 

But I do not have my to_extra_thread_info active?

I think this is going back to my initial question (pardon my 
ignorance): how do I "install" my to_extra_thread_info? I 
don't see a clean way of pushing my core_ops on top of 
default ones (and I thought that would be a clean way).

I think letting architecture push its customization on top 
of default provided _ops would be very useful. In the 
core_ops example, maybe we could have arch. callback for 
that, and have the callback be called from core_open just 
after core_open pushes core_ops?  That would definitely 
solve all the problems I have in a generic way.


Thanks,

-- 
Aleksandar Ristovski
QNX Software Systems


  reply	other threads:[~2009-06-09 16:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-05 18:55 Aleksandar Ristovski
2009-06-05 19:03 ` Daniel Jacobowitz
2009-06-05 19:20   ` Aleksandar Ristovski
2009-06-05 19:24 ` Pedro Alves
2009-06-05 19:41   ` Aleksandar Ristovski
2009-06-06  0:01     ` Pedro Alves
2009-06-06  0:27     ` Pedro Alves
2009-06-09 16:10       ` Aleksandar Ristovski [this message]
2009-06-10 16:49         ` Pedro Alves
2009-06-10 20:38           ` Aleksandar Ristovski

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='h0m1h3$pbd$1@ger.gmane.org' \
    --to=aristovski@qnx.com \
    --cc=gdb@sources.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