From: "H.J. Lu" <hjl.tools@gmail.com>
To: GDB <gdb-patches@sourceware.org>
Subject: Re: PATCH: Generate set_tdesc_osabi for valid OSABI
Date: Thu, 04 Feb 2010 16:55:00 -0000 [thread overview]
Message-ID: <6dc9ffc81002040854h6d88e085x4026d5a8320eeee7@mail.gmail.com> (raw)
In-Reply-To: <20100204160416.GB14962@caradoc.them.org>
[-- Attachment #1: Type: text/plain, Size: 620 bytes --]
On Thu, Feb 4, 2010 at 8:04 AM, Daniel Jacobowitz <dan@codesourcery.com> wrote:
> On Thu, Feb 04, 2010 at 07:49:10AM -0800, H.J. Lu wrote:
>> 2010-02-04 H.J. Lu <hongjiu.lu@intel.com>
>>
>> * target-descriptions.c (maint_print_c_tdesc_cmd): Generate
>> set_tdesc_osabi for valid OSABI.
>
> This patch would require regenerating the board files after changing
> the enum. If we have to hard-code the value, there should be a
> warning to only add new items to the end of the enum unless
> regenerating the files.
>
Good point. How about using OSABI string instead?
Thanks.
--
H.J.
[-- Attachment #2: gdb-tdesc-2.patch --]
[-- Type: text/plain, Size: 1336 bytes --]
2010-02-04 H.J. Lu <hongjiu.lu@intel.com>
* target-descriptions.c: Include "osabi.h".
(maint_print_c_tdesc_cmd): Generate set_tdesc_osabi for valid
OSABI.
diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c
index 720f0c7..22371ed 100644
--- a/gdb/target-descriptions.c
+++ b/gdb/target-descriptions.c
@@ -29,6 +29,7 @@
#include "vec.h"
#include "xml-support.h"
#include "xml-tdesc.h"
+#include "osabi.h"
#include "gdb_assert.h"
#include "gdb_obstack.h"
@@ -1406,6 +1407,7 @@ maint_print_c_tdesc_cmd (char *args, int from_tty)
printf_unfiltered ("/* THIS FILE IS GENERATED. Original: %s */\n\n",
filename);
printf_unfiltered ("#include \"defs.h\"\n");
+ printf_unfiltered ("#include \"osabi.h\"\n");
printf_unfiltered ("#include \"target-descriptions.h\"\n");
printf_unfiltered ("\n");
@@ -1427,6 +1429,15 @@ maint_print_c_tdesc_cmd (char *args, int from_tty)
printf_unfiltered ("\n");
}
+ if (tdesc_osabi (tdesc) > GDB_OSABI_UNKNOWN
+ && tdesc_osabi (tdesc) < GDB_OSABI_INVALID)
+ {
+ printf_unfiltered
+ (" set_tdesc_osabi (result, osabi_from_tdesc_string (\"%s\"));\n",
+ gdbarch_osabi_name (tdesc_osabi (tdesc)));
+ printf_unfiltered ("\n");
+ }
+
for (ix = 0; VEC_iterate (arch_p, tdesc->compatible, ix, compatible);
ix++)
{
next prev parent reply other threads:[~2010-02-04 16:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-04 15:49 H.J. Lu
2010-02-04 16:04 ` Daniel Jacobowitz
2010-02-04 16:55 ` H.J. Lu [this message]
2010-02-04 17:06 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6dc9ffc81002040854h6d88e085x4026d5a8320eeee7@mail.gmail.com \
--to=hjl.tools@gmail.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox