This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH]: dcache.c, memattr.c, and sol-thread.c cleanup.
- To: jtc at redback dot com
- Subject: Re: [PATCH]: dcache.c, memattr.c, and sol-thread.c cleanup.
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Wed, 24 Jan 2001 16:23:47 -0800
- CC: gdb-patches at sourceware dot cygnus dot com
- Organization: Red Hat
- References: <5m4ryor7k5.fsf@jtc.redback.com>
"J.T. Conklin" wrote:
>
> I'm going to be committing the enclosed patch shortly.
>
> It fixes a typo in dcache.c which causes all sorts of bad things to
> happen when the cache is enabled.
>
> It changes free to xfree in memattr.c, in line with all the other
> conversions that are going on.
>
> It also fixes one, and works around another, case where the attrib
> argument is not passed through to the target vector in sol-thread.c.
> For sol_thread_xfer_memory() all that was needed to add the attrib
> argument to the function and pass it through to the vector functions,
> but for rw_common() I worked around by passing 0. I'm not very happy
> with this solution, but I can't figure out how to get the attributes
> through. rw_common() is called by ps_pdread(), ps_pdwrite, ps_ptread(),
> and ps_ptwrite(); but I cannot find where any of these functions are
> called from.
That's not surprising. They are callbacks that are provided by gdb
for sun's library libthread_db.a. That library uses them to read
target memory so it can munge thru the thread list data structures.
In other words, GDB calls libthread_db to ask "what threads have you
got?"
and libthread_db calls back thru these functions to read the inferior's
memory before it can answer the question.