This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

Re: [PATCH 2/4] 'catch syscall' feature -- Architecture-dependent part


On Tue, Nov 04, 2008 at 02:49:16PM -0200, Sérgio Durigan Júnior wrote:
> Hi Tom,
> 
> On Tue, 2008-11-04 at 09:15 -0700, Tom Tromey wrote:
> > >>>>> "Sérgio" == Sérgio Durigan Júnior <sergiodj@linux.vnet.ibm.com> writes:
> > 
> > Sérgio> 	* i386-linux-tdep.c: Define the syscall's XML struct to hold
> > Sérgio> 	information about syscalls.
> > Sérgio> 	(init_sysinfo): New.
> > 
> > There is some code duplication between this and ppc-linux-tdep.c.
> > It seems to me that much of the Linux code will be shared by all
> > ports.  So, I think the duplicated stuff should go in linux-nat.c.
> 
> Thank you so much for this comment! I was aware of this replication, but
> I still wasn't able to figure out a way to solve this. Now it looks so
> obvious! I'll put the common functions in linux-nat.c :-).

Please create a new linux-tdep.c file instead.  Search for
glibc-tdep to find the places to add it.

You can't reference anything in a *-nat.c file from a *-tdep.c file.
The nat files are "native GDB" support; the tdep files are used for
both native and cross debuggers.

> Right, I'll do it for both. But I have a question. Depending on the
> architecture, I must pick the correct XML file to open and parse. That's
> why I've put these functions in separate files. So, do you have a clue
> on how to solve this?

Have an architecture method that returns the filename, perhaps?

-- 
Daniel Jacobowitz
CodeSourcery


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