This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH]: dcache.c, memattr.c, and sol-thread.c cleanup.


"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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]