Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Adding dwarf2 regnum mapping
@ 2002-04-29 10:58 Michal Ludvig
  2002-04-29 11:44 ` Daniel Jacobowitz
  2002-04-29 12:18 ` Jim Blandy
  0 siblings, 2 replies; 4+ messages in thread
From: Michal Ludvig @ 2002-04-29 10:58 UTC (permalink / raw)
  To: gdb

Hi,
I'm adding x86_64_dwarf2_reg_to_regno() function but don't know how to 
let gdb know it's there. I got inspired by i386 and put

#define DWARF2_REG_TO_REGNUM(reg) x86_64_dwarf2_reg_to_regnum ((reg))

into nm-x86-64.h. Unfortunately then the compilation fails with:

gdbarch.h:664:2: #error "Non multi-arch definition of DWARF2_REG_TO_REGNUM"

If I don't put this define into nm.h, the new function isn't used at 
all. Can someone please tell me how do I tell gdb about this function 
while retaining the target multiarch_pure? If I change the target to 
multiarch_partial, everything works just fine, but I don't think it's 
the right way to go.

Thanks in advance.

Michal Ludvig
-- 
* SuSE CR, s.r.o     * mludvig@suse.cz
* +420 2 9654 5373   * http://www.suse.cz


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

* Re: Adding dwarf2 regnum mapping
  2002-04-29 10:58 Adding dwarf2 regnum mapping Michal Ludvig
@ 2002-04-29 11:44 ` Daniel Jacobowitz
  2002-04-30  3:01   ` Michal Ludvig
  2002-04-29 12:18 ` Jim Blandy
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2002-04-29 11:44 UTC (permalink / raw)
  To: gdb

On Mon, Apr 29, 2002 at 07:57:49PM +0200, Michal Ludvig wrote:
> Hi,
> I'm adding x86_64_dwarf2_reg_to_regno() function but don't know how to 
> let gdb know it's there. I got inspired by i386 and put
> 
> #define DWARF2_REG_TO_REGNUM(reg) x86_64_dwarf2_reg_to_regnum ((reg))
> 
> into nm-x86-64.h. Unfortunately then the compilation fails with:
> 
> gdbarch.h:664:2: #error "Non multi-arch definition of DWARF2_REG_TO_REGNUM"
> 
> If I don't put this define into nm.h, the new function isn't used at 
> all. Can someone please tell me how do I tell gdb about this function 
> while retaining the target multiarch_pure? If I change the target to 
> multiarch_partial, everything works just fine, but I don't think it's 
> the right way to go.

mn10300-tdep.c:  set_gdbarch_dwarf2_reg_to_regnum (gdbarch, mn10300_dwarf2_reg_to_regnum);
s390-tdep.c:  set_gdbarch_dwarf2_reg_to_regnum (gdbarch, s390_stab_reg_to_regnum);

Do it just like either of those; set it in i386_gdbarch_init.


-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: Adding dwarf2 regnum mapping
  2002-04-29 10:58 Adding dwarf2 regnum mapping Michal Ludvig
  2002-04-29 11:44 ` Daniel Jacobowitz
@ 2002-04-29 12:18 ` Jim Blandy
  1 sibling, 0 replies; 4+ messages in thread
From: Jim Blandy @ 2002-04-29 12:18 UTC (permalink / raw)
  To: Michal Ludvig; +Cc: gdb


Michal Ludvig <mludvig@suse.cz> writes:
> I'm adding x86_64_dwarf2_reg_to_regno() function but don't know how to
> let gdb know it's there. I got inspired by i386 and put
> 
> #define DWARF2_REG_TO_REGNUM(reg) x86_64_dwarf2_reg_to_regnum ((reg))
> 
> into nm-x86-64.h. Unfortunately then the compilation fails with:
> 
> gdbarch.h:664:2: #error "Non multi-arch definition of DWARF2_REG_TO_REGNUM"
> 
> If I don't put this define into nm.h, the new function isn't used at
> all. Can someone please tell me how do I tell gdb about this function
> while retaining the target multiarch_pure? If I change the target to
> multiarch_partial, everything works just fine, but I don't think it's
> the right way to go.

Why not do the right thing in x86-64-tdep.c:i386_gdbarch_init?


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

* Re: Adding dwarf2 regnum mapping
  2002-04-29 11:44 ` Daniel Jacobowitz
@ 2002-04-30  3:01   ` Michal Ludvig
  0 siblings, 0 replies; 4+ messages in thread
From: Michal Ludvig @ 2002-04-30  3:01 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

Daniel Jacobowitz wrote:
> mn10300-tdep.c:  set_gdbarch_dwarf2_reg_to_regnum (gdbarch, mn10300_dwarf2_reg_to_regnum);
> s390-tdep.c:  set_gdbarch_dwarf2_reg_to_regnum (gdbarch, s390_stab_reg_to_regnum);
> 
> Do it just like either of those; set it in i386_gdbarch_init.

My fault, of course. I tried this, but by mistake I used 
gdbarch_dwarf_reg... instead of gdbarch_dwarf2_reg... and was wondering 
why it doesn't work. So I finally asked here for the trick. Of course if 
I use the _right_ set function it works :-)

Michal Ludvig
-- 
* SuSE CR, s.r.o     * mludvig@suse.cz
* +420 2 9654 5373   * http://www.suse.cz


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

end of thread, other threads:[~2002-04-30 10:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-29 10:58 Adding dwarf2 regnum mapping Michal Ludvig
2002-04-29 11:44 ` Daniel Jacobowitz
2002-04-30  3:01   ` Michal Ludvig
2002-04-29 12:18 ` Jim Blandy

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