* GDB
@ 1998-11-05 1:30 ralf
1998-11-06 20:24 ` GDB Thomas Bogendoerfer
0 siblings, 1 reply; 8+ messages in thread
From: ralf @ 1998-11-05 1:30 UTC (permalink / raw)
To: linux, linux-mips
I found that by accident GDB and the kernel were using different
ptrace(2) interfaces. After fixing that for example ``info registers''
works ok.
Ralf
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: GDB
1998-11-05 1:30 GDB ralf
@ 1998-11-06 20:24 ` Thomas Bogendoerfer
1998-11-08 23:50 ` GDB ralf
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Bogendoerfer @ 1998-11-06 20:24 UTC (permalink / raw)
To: linux-mips, linux
On Thu, Nov 05, 1998 at 02:30:15AM +0100, ralf@uni-koblenz.de wrote:
> I found that by accident GDB and the kernel were using different
> ptrace(2) interfaces. After fixing that for example ``info registers''
> works ok.
how about sharing your fix with us ?
Thomas.
--
This device has completely bogus header. Compaq scores again :-|
It's a host bridge, but it should be called ghost bridge instead ;^)
[Martin `MJ' Mares on linux-kernel]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: GDB
1998-11-06 20:24 ` GDB Thomas Bogendoerfer
@ 1998-11-08 23:50 ` ralf
0 siblings, 0 replies; 8+ messages in thread
From: ralf @ 1998-11-08 23:50 UTC (permalink / raw)
To: Thomas Bogendoerfer, linux-mips, linux, linux-mips
[-- Attachment #1: Type: text/plain, Size: 619 bytes --]
On Fri, Nov 06, 1998 at 09:24:24PM +0100, Thomas Bogendoerfer wrote:
> On Thu, Nov 05, 1998 at 02:30:15AM +0100, ralf@uni-koblenz.de wrote:
> > I found that by accident GDB and the kernel were using different
> > ptrace(2) interfaces. After fixing that for example ``info registers''
> > works ok.
>
> how about sharing your fix with us ?
Guess too much decaf when I wrote that mail ... Attached the fixed
version of mipslinux-nat.c. I've copied all the (corrected!) definitions
of the kernel interfaces into mipslinux-nat.c, therefore no more headerfile
problems even with old kernel headers installed.
Ralf
[-- Attachment #2: mipslinux-nat.c --]
[-- Type: text/plain, Size: 5768 bytes --]
/* Low level MIPS/Linux interface, for GDB when running native.
Copyright 1996 Free Software Foundation, Inc.
Contributed by David S. Miller (davem@caip.rutgers.edu) at
Rutgers University CAIP Research Center.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "inferior.h"
#include "gdbcore.h"
#include "target.h"
#include "gdb_string.h"
#include "symtab.h"
#include "bfd.h"
#include "symfile.h"
#include "objfiles.h"
#include "command.h"
#include "frame.h"
#include "gnu-regex.h"
#include "inferior.h"
#include "language.h"
#include "gdbcmd.h"
#include <sys/ptrace.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/user.h>
#include <setjmp.h> /* For JB_PC and friends. */
/* This duplicates definitions from <asm/elfcore.h> ... */
/* ELF register definitions */
#define ELF_NGREG 45
#define ELF_NFPREG 33
typedef unsigned long gregset_t [ELF_NGREG];
typedef double fpregset_t [ELF_NFPREG];
/* This duplicates definitions from <asm/elf.h> ... */
/* 0 - 31 are integer registers, 32 - 63 are fp registers. */
#define FPR_BASE 32
#define PC 64
#define CAUSE 65
#define BADVADDR 66
#define MMHI 67
#define MMLO 68
#define FPC_CSR 69
#define FPC_EIR 70
/* End of duplicated definitions */
/* Size of elements in jmpbuf */
#define JB_ELEMENT_SIZE 4
/* Figure out where the longjmp will land.
We expect the first arg to be a pointer to the jmp_buf structure from which
we extract the pc (JB_PC) that we will land at. The pc is copied into PC.
This routine returns true on success. */
int
get_longjmp_target(pc)
CORE_ADDR *pc;
{
CORE_ADDR jb_addr;
char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
jb_addr = read_register (A0_REGNUM);
if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
TARGET_PTR_BIT / TARGET_CHAR_BIT))
return 0;
*pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
return 1;
}
/*
* See the comment in m68k-tdep.c regarding the utility of these functions.
*
* These definitions are from the MIPS SVR4 ABI, so they may work for
* any MIPS SVR4 target.
*/
void
supply_gregset (gregsetp)
gregset_t *gregsetp;
{
register int regi;
register unsigned int *regp = (unsigned int *) &(*gregsetp)[0];
static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
for (regi = EF_REG0; regi <= EF_LO; regi++)
supply_register ((regi - EF_REG0), (char *)(regp + regi));
supply_register(PC_REGNUM, (char *)(regp + EF_CP0_EPC));
supply_register(CAUSE_REGNUM, (char *)(regp + EF_CP0_CAUSE));
supply_register(BADVADDR_REGNUM, (char *)(regp + EF_CP0_BADVADDR));
supply_register(LO_REGNUM, (char *)(regp + EF_LO));
supply_register(HI_REGNUM, (char *)(regp + EF_HI));
/* Fill inaccessible registers with zero. */
supply_register (FP_REGNUM, zerobuf);
supply_register (UNUSED_REGNUM, zerobuf);
}
void
fill_gregset (gregsetp, regno)
gregset_t *gregsetp;
int regno;
{
int regi;
register unsigned int *regp = (unsigned int *) &(*gregsetp)[0];
for (regi = 0; regi <= (EF_SIZE / 4); regi++)
if ((regno == -1) || (regno == regi))
*(regp + regi) = *(unsigned int *) ®isters[REGISTER_BYTE (regi)];
}
/* Now we do the same thing for floating-point registers.
* We don't bother to condition on FP0_REGNUM since any
* reasonable MIPS configuration has an R3010 in it.
*
* Again, see the comments in m68k-tdep.c.
*/
void
supply_fpregset (fpregsetp)
fpregset_t *fpregsetp;
{
register int regi;
static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
for (regi = 0; regi < 32; regi++)
supply_register (FP0_REGNUM + regi,
(char *)&fpregsetp[regi]);
supply_register (FCRCS_REGNUM, (char *)&fpregsetp[32]);
/* FIXME: how can we supply FCRIR_REGNUM? The ABI doesn't tell us. */
supply_register (FCRIR_REGNUM, zerobuf);
}
void
fill_fpregset (fpregsetp, regno)
fpregset_t *fpregsetp;
int regno;
{
int regi;
char *from, *to;
for (regi = FP0_REGNUM; regi < FP0_REGNUM + 32; regi++)
{
if ((regno == -1) || (regno == regi))
{
from = (char *) ®isters[REGISTER_BYTE (regi)];
to = (char *) &(fpregsetp[regi - FP0_REGNUM]);
memcpy(to, from, REGISTER_RAW_SIZE (regi));
}
}
#if 0
if ((regno == -1) || (regno == FCRCS_REGNUM))
fpregsetp[32] = *(unsigned int *) ®isters[REGISTER_BYTE(FCRCS_REGNUM)];
#endif
}
/* Map gdb internal register number to ptrace ``address''.
These ``addresses'' are defined in <mips/ptrace.h> */
#define REGISTER_PTRACE_ADDR(regno) \
(regno < 32 ? regno \
: regno == PC_REGNUM ? PC \
: regno == CAUSE_REGNUM ? CAUSE \
: regno == HI_REGNUM ? MMHI \
: regno == LO_REGNUM ? MMLO \
: regno == FCRCS_REGNUM ? FPC_CSR \
: regno == FCRIR_REGNUM ? FPC_EIR \
: regno >= FP0_REGNUM ? FPR_BASE + (regno - FP0_REGNUM) \
: 0)
/* Return the ptrace ``address'' of register REGNO. */
CORE_ADDR
register_addr (regno, blockend)
int regno;
CORE_ADDR blockend;
{
if(regno < 0 || regno >= NUM_REGS)
error ("Bogon register number %d.", regno);
return REGISTER_PTRACE_ADDR (regno);
}
^ permalink raw reply [flat|nested] 8+ messages in thread
* GDB
@ 1999-03-22 21:47 Ulf Carlsson
1999-03-22 23:10 ` GDB Thomas Bogendoerfer
0 siblings, 1 reply; 8+ messages in thread
From: Ulf Carlsson @ 1999-03-22 21:47 UTC (permalink / raw)
To: Linux SGI
Hi,
I'm having some problems with gdb for mips. I can't examine core files since gdb
itself dumps core files when I try start gdb (gdb nsgsml core). Are there other
ways to check where a program crashes (except for printf()s)? It isn't possible
to run nsgsml in gdb either, or at least it doesn't provide the information I
want.
It's also tricky to debug where gdb fails because it just dumps another core
when I try to debug the core file gdb dumps :)
By the way, I have received a new Indy from SGI (that's why I'm back in action).
But the monitor was not working so I had to take the machine to the support
center in Sweden, which I did last Friday. They replaced the monitor so
everything works fine now. Thanks Nancy!
FYI I've fixed /dev/graphics now (thanks for making it a module at first place
Alex!). The code was really broken. I'll commit that stuff sometime when I don't
experience too much CVS problems.. (CVS is really bad from here..)
I've applied for being an X developer now as well (X was the real reason for
fixing /dev/graphics). Maybe I can remove the abscence of X servers if it's so
easy to port the IBM8514 driver as everyone says it is.
- Ulf
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: GDB
1999-03-22 21:47 GDB Ulf Carlsson
@ 1999-03-22 23:10 ` Thomas Bogendoerfer
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Bogendoerfer @ 1999-03-22 23:10 UTC (permalink / raw)
To: Linux SGI
On Mon, Mar 22, 1999 at 04:47:06PM -0500, Ulf Carlsson wrote:
> I'm having some problems with gdb for mips. I can't examine core files
> since gdb itself dumps core files when I try start gdb (gdb nsgsml core).
> Are there other ways to check where a program crashes (except for printf()s)?
> It isn't possible to run nsgsml in gdb either, or at least it doesn't
> provide the information I want.
hmm, if memory serves right, I had reading core working at some point.
But I just tried it again and it fails like you described. I debugged
gdb some time ago and it's was a real nightmare. IMHO fixing gdb isn't
a short term task and I'm right now trying to plug all SCSI holes
(two bugs smashed, but still too much known bugs unfixed). And after
the SCSI stuff I'll port the RedHat Rawhide installer, so I'm not
available to fix gdb for some time.
For a short term solution edit arch/mips/mm/fault.c and look for the
second #if 0 (after the label bad_area) and change that to a #if 1.
This will give you a kernel message for every segfault, but it won't
help you for bus errors (but it's also possible to add printks there, too).
Thomas.
--
This device has completely bogus header. Compaq scores again :-|
It's a host bridge, but it should be called ghost bridge instead ;^)
[Martin `MJ' Mares on linux-kernel]
^ permalink raw reply [flat|nested] 8+ messages in thread
* GDB
@ 1999-07-25 12:34 Ralf Baechle
0 siblings, 0 replies; 8+ messages in thread
From: Ralf Baechle @ 1999-07-25 12:34 UTC (permalink / raw)
To: linux, linux-mips, linux-mips
Hi,
I'm currently preparing a new GDB release for Linux/MIPS. One that's even
easy to install as a binary package, whee :-) So if anybody's still got
patches or bug reports pending, please report to me asap.
Thanks,
Ralf
^ permalink raw reply [flat|nested] 8+ messages in thread
* gdb
@ 2006-07-31 23:41 Ratin Rahman (mratin)
2006-07-31 23:41 ` gdb Ratin Rahman (mratin)
0 siblings, 1 reply; 8+ messages in thread
From: Ratin Rahman (mratin) @ 2006-07-31 23:41 UTC (permalink / raw)
To: linux-mips
Anybody use gdb with mipsel? Is there something I need to know how to
compile gdb for mipsel
before I get my hands dirty with it :)
Ratin Rahman
^ permalink raw reply [flat|nested] 8+ messages in thread
* gdb
2006-07-31 23:41 gdb Ratin Rahman (mratin)
@ 2006-07-31 23:41 ` Ratin Rahman (mratin)
0 siblings, 0 replies; 8+ messages in thread
From: Ratin Rahman (mratin) @ 2006-07-31 23:41 UTC (permalink / raw)
To: linux-mips
Anybody use gdb with mipsel? Is there something I need to know how to
compile gdb for mipsel
before I get my hands dirty with it :)
Ratin Rahman
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2006-07-31 23:42 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-03-22 21:47 GDB Ulf Carlsson
1999-03-22 23:10 ` GDB Thomas Bogendoerfer
-- strict thread matches above, loose matches on Subject: below --
2006-07-31 23:41 gdb Ratin Rahman (mratin)
2006-07-31 23:41 ` gdb Ratin Rahman (mratin)
1999-07-25 12:34 GDB Ralf Baechle
1998-11-05 1:30 GDB ralf
1998-11-06 20:24 ` GDB Thomas Bogendoerfer
1998-11-08 23:50 ` GDB ralf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox