Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [commit/mips] For elf_flags, use the previous arch
@ 2004-01-08  5:06 Andrew Cagney
  2004-01-08 14:21 ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2004-01-08  5:06 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 211 bytes --]

Hello,

This fixes a subtle edge case.  Given the sequence:

	(gdb) file foo
	(gdb) set mipsfpu none
	(gdb) file foo

An extra, unnecessary arch was being created after the second "file foo".

committed,
Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 780 bytes --]

2004-01-07  Andrew Cagney  <cagney@redhat.com>

	* mips-tdep.c (mips_gdbarch_init): Set elf_flags to the previous
	architecture's elf flags (when available).

Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.267
diff -u -r1.267 mips-tdep.c
--- mips-tdep.c	8 Jan 2004 04:57:38 -0000	1.267
+++ mips-tdep.c	8 Jan 2004 05:02:23 -0000
@@ -5688,6 +5688,8 @@
   /* First of all, extract the elf_flags, if available.  */
   if (info.abfd && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour)
     elf_flags = elf_elfheader (info.abfd)->e_flags;
+  else if (arches != NULL)
+    elf_flags = gdbarch_tdep (arches->gdbarch)->elf_flags;
   else
     elf_flags = 0;
   if (gdbarch_debug)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [commit/mips] For elf_flags, use the previous arch
  2004-01-08  5:06 [commit/mips] For elf_flags, use the previous arch Andrew Cagney
@ 2004-01-08 14:21 ` Daniel Jacobowitz
  2004-01-08 17:55   ` Andrew Cagney
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2004-01-08 14:21 UTC (permalink / raw)
  To: gdb-patches

On Thu, Jan 08, 2004 at 12:06:25AM -0500, Andrew Cagney wrote:
> Hello,
> 
> This fixes a subtle edge case.  Given the sequence:
> 
> 	(gdb) file foo
> 	(gdb) set mipsfpu none
> 	(gdb) file foo
> 
> An extra, unnecessary arch was being created after the second "file foo".

After the "file foo"?  I'm confused as to how this case can trigger,
since we ought to have info.abfd at that point, right?

> 2004-01-07  Andrew Cagney  <cagney@redhat.com>
> 
> 	* mips-tdep.c (mips_gdbarch_init): Set elf_flags to the previous
> 	architecture's elf flags (when available).
> 
> Index: mips-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/mips-tdep.c,v
> retrieving revision 1.267
> diff -u -r1.267 mips-tdep.c
> --- mips-tdep.c	8 Jan 2004 04:57:38 -0000	1.267
> +++ mips-tdep.c	8 Jan 2004 05:02:23 -0000
> @@ -5688,6 +5688,8 @@
>    /* First of all, extract the elf_flags, if available.  */
>    if (info.abfd && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour)
>      elf_flags = elf_elfheader (info.abfd)->e_flags;
> +  else if (arches != NULL)
> +    elf_flags = gdbarch_tdep (arches->gdbarch)->elf_flags;
>    else
>      elf_flags = 0;
>    if (gdbarch_debug)


-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [commit/mips] For elf_flags, use the previous arch
  2004-01-08 14:21 ` Daniel Jacobowitz
@ 2004-01-08 17:55   ` Andrew Cagney
  2004-01-08 17:57     ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2004-01-08 17:55 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> On Thu, Jan 08, 2004 at 12:06:25AM -0500, Andrew Cagney wrote:
> 
>> Hello,
>> 
>> This fixes a subtle edge case.  Given the sequence:
>> 
>> 	(gdb) file foo

this changes:
	elf_flags 0 -> 0x<something>
	fpu_type 0 -> 0

>> 	(gdb) set mipsfpu none

this was changing:
	elf_flags 0x<something> -> 0
	fpu_type 0 -> 2
but should have changed:
	elf_flags 0x<something> -> 0x<something>
	fpu_type 0 -> 2

>> 	(gdb) file foo

this was changing:
	elf_flags 0 -> 0x<something>
	fpu_type 2 -> 2
but should have changed:
	elf_flags 0x<something> -> 0x<something>
	fpu_type 2 -> 2
i.e., no change

>> 
>> An extra, unnecessary arch was being created after the second "file foo".
> 
> 
> After the "file foo"?  I'm confused as to how this case can trigger,
> since we ought to have info.abfd at that point, right?

Andrew



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [commit/mips] For elf_flags, use the previous arch
  2004-01-08 17:55   ` Andrew Cagney
@ 2004-01-08 17:57     ` Daniel Jacobowitz
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2004-01-08 17:57 UTC (permalink / raw)
  To: gdb-patches

On Thu, Jan 08, 2004 at 12:55:20PM -0500, Andrew Cagney wrote:
> >On Thu, Jan 08, 2004 at 12:06:25AM -0500, Andrew Cagney wrote:
> >
> >>Hello,
> >>
> >>This fixes a subtle edge case.  Given the sequence:
> >>
> >>	(gdb) file foo
> 
> this changes:
> 	elf_flags 0 -> 0x<something>
> 	fpu_type 0 -> 0
> 
> >>	(gdb) set mipsfpu none
> 
> this was changing:
> 	elf_flags 0x<something> -> 0
> 	fpu_type 0 -> 2
> but should have changed:
> 	elf_flags 0x<something> -> 0x<something>
> 	fpu_type 0 -> 2
> 
> >>	(gdb) file foo
> 
> this was changing:
> 	elf_flags 0 -> 0x<something>
> 	fpu_type 2 -> 2
> but should have changed:
> 	elf_flags 0x<something> -> 0x<something>
> 	fpu_type 2 -> 2
> i.e., no change

Thanks, I gotcha now.  The unnecessary architecture happens after set
mpsfpu none.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-01-08 17:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-08  5:06 [commit/mips] For elf_flags, use the previous arch Andrew Cagney
2004-01-08 14:21 ` Daniel Jacobowitz
2004-01-08 17:55   ` Andrew Cagney
2004-01-08 17:57     ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox