Message ID | 94eb2c047d9c268cd705405ac313@google.com |
---|---|
State | New |
Headers | show |
On Thu, Nov 3, 2016 at 12:37 AM, Doug Evans <dje@google.com> wrote: > I was debugging a bare metal x86 target and a part of gdb wasn't working > as expected, and I found myself in the innards of the x86 port and wondering > what's going on. > > This patch helps clarify what's going on here, at least for this reader. > It'll certainly help me next time I'm in there. > > 2016-11-02 Doug Evans <dje@google.com> > > * i386-tdep.c (i386_gdbarch_init): Add comments. > Yeah, it indeed helps. It is good to me.
On Thu, Nov 3, 2016 at 10:01 AM, Yao Qi <qiyaoltc@gmail.com> wrote: > On Thu, Nov 3, 2016 at 12:37 AM, Doug Evans <dje@google.com> wrote: >> I was debugging a bare metal x86 target and a part of gdb wasn't working >> as expected, and I found myself in the innards of the x86 port and wondering >> what's going on. >> >> This patch helps clarify what's going on here, at least for this reader. >> It'll certainly help me next time I'm in there. >> >> 2016-11-02 Doug Evans <dje@google.com> >> >> * i386-tdep.c (i386_gdbarch_init): Add comments. >> > > Yeah, it indeed helps. It is good to me. Committed, thanks.
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index da8ff8e..60263cc 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -8320,6 +8320,8 @@ i386_validate_tdesc_p (struct gdbarch_tdep *tdep, } +/* Note: This is called for both i386 and amd64. */ + static struct gdbarch * i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { @@ -8337,7 +8339,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) if (arches != NULL) return arches->gdbarch; - /* Allocate space for the new architecture. */ + /* Allocate space for the new architecture. Assume i386 for now. */ tdep = XCNEW (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep);