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]

duplicated code in gdb and gdbserver


I noticed that sharing code of GDB and GDBServer is discussed in 2010
GCC Summit.
http://sourceware.org/gdb/wiki/2010_GCC_Summit_BoF

Looks like one conclusion is that "it is likely to be quite complex".  I
don't understand this point fully, so I had a try by myself to create a
new file linux-common.h in gdb/common/, move some duplicated macro
definitions from gdb/linux-nat.c and gdb/gdbserver/linux-low.c to
common/linux-common.h, and adjust *.h files include order.  Then, both
GDB and GDBServer can be build on x86.  Totally, it costs me nearly half
an hour to complete this experiment.

Could anyone tell me which part of this work is "quite complex"?  Am I
missing something?
Regardless of this potential complexity I haven't met, it is worthwhile
moving obviously common/duplicated code into single file, isn't?
Comments are welcome.

-- 
Yao (éå)


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