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]

[PATCH v3 00/14] let gdb reuse gcc's C compiler


Hi,

https://github.com/tromey/gdb.git
submit/compile

This is version 3 of the patch to let gdb reuse gcc's C compiler.

Version 2 is here:

    https://sourceware.org/ml/gdb-patches/2014-06/msg00758.html

New in version 3:
 * x86_64 in -m32 mode testsuite run was failing:
     (gdb) compile code -- ;
     Could not find a compiler matching "^i.86-[^-]*-linux(-gnu)?-gcc$"
   Therefore applied the patch included below.
 * Rename dwarf_expr_frame_base_1 -> func_get_frame_base_dwarf_block:
   https://sourceware.org/ml/gdb-patches/2014-10/msg00158.html
 * doc updates:
   https://sourceware.org/ml/gdb-patches/2014-10/msg00164.html

Built and regtested on x86-64, x86_64-m32 and i686 Fedora 21pre in linux-nat
and gdbserver modes.

Going to check it in in a week as v2 has been posted by global maintainer Tom
Tromey and there has already been enough time for its reviews.


Thanks,
Jan


diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index ca61b1b..ed41f88 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -2914,14 +2914,6 @@ static const int amd64_record_regmap[] =
   AMD64_DS_REGNUM, AMD64_ES_REGNUM, AMD64_FS_REGNUM, AMD64_GS_REGNUM
 };
 
-/* gdbarch gnu_triplet_regexp method.  */
-
-static const char *
-amd64_gnu_triplet_regexp (struct gdbarch *gdbarch)
-{
-  return "x86_64";
-}
-
 void
 amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
@@ -3071,8 +3063,6 @@ amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_gdbarch_insn_is_call (gdbarch, amd64_insn_is_call);
   set_gdbarch_insn_is_ret (gdbarch, amd64_insn_is_ret);
   set_gdbarch_insn_is_jump (gdbarch, amd64_insn_is_jump);
-
-  set_gdbarch_gnu_triplet_regexp (gdbarch, amd64_gnu_triplet_regexp);
 }
 
 
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 4a59560..56bfd49 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -4305,12 +4305,13 @@ i386_stap_parse_special_token (struct gdbarch *gdbarch,
 
 
 
-/* gdbarch gnu_triplet_regexp method.  */
+/* gdbarch gnu_triplet_regexp method.  Both arches are acceptable as GDB always
+   also supplies -m64 or -m32 by gdbarch_gcc_target_options.  */
 
 static const char *
 i386_gnu_triplet_regexp (struct gdbarch *gdbarch)
 {
-  return "i.86";
+  return "(x86_64|i.86)";
 }
 
 


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