all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* gdba probs
@ 2002-12-05 20:40 Nick Roberts
  2002-12-05 21:49 ` Stefan Monnier
  2002-12-07 21:25 ` Richard Stallman
  0 siblings, 2 replies; 25+ messages in thread
From: Nick Roberts @ 2002-12-05 20:40 UTC (permalink / raw)
  Cc: emacs-devel


Miles Bader writes:

> Seeing the recent activity on `gdba', I decided to check it out, and got
> bunches of errors.  The gdb command line I used was this:
...

> It initially divided the frame into 6 (!) windows, most of which I
> don't want; 

The totalview debugger starts with 6 windows. But, hey!, lets be open minded
about this. How do you know you don't want them before you know what they do ?

> is there a way to customize which windows it uses?

(setq gdb-many-windows nil) gives you the just the two windows that I think
you're looking for. C-h f `gdba' explains a bit more.

Regarding the bunches of errors, they occur because you're using commands that
stop/step at the instruction level (break *_start, stepi, etc). Handling these
commands is on my TODO list. ;-)

For the moment if you want explore what this mode does you have to stick to
the statement level (break main, step, etc). I append below a nonsense program
that I have used to develop gdb-ui.el. Clearly this isn't useful test the lisp
code but it might help to show what it can do.

> BTW, note all the spurious `Mark set' and `Replaced 0 occurrences'
> messages (I never set the mark or did any replacing) -- it looks like
> some lisp code is using the `replace-string' function when it shouldn't
> (generally lisp code shouldn't use it at all).

I'm using replace-regexp which I know I shouldn't. The elisp manual does say
this but doesn't offer an alternative. I have noticed in vc.el from emacs-20.7 :

;; (replace-regexp (concat ":" (regexp-quote file) "$") (concat ":" newname))
(while (re-search-forward (concat ":" (regexp-quote file) "$") nil t)
   (replace-match (concat ":" newname) nil nil))

Is this construction a standard replacement for replace-regexp in lisp programs ?
(if so I think it would be a good idea to say so in the manual)

Nick

-----------------------------------------------------------

temp.c...

/* cc -g -o temp temp.c myprint.o */
typedef struct {
  int r;
  float s;
} substruct;

typedef struct {
  int* r;
  float* s;
} subref;

main(int argc, char **argv) {
  int a[10]={0,1,4,9,16,25,36,49,64,81};
  int i,j,n,bigarray[20][20];
  int* k;
  char* b="fred";
  int c[4][3][2];
  substruct fred;
  substruct* bert;
  struct {
    int p;
    substruct q1;
    substruct q2;
  } t, *u;
  struct {
    int* p;
    subref* q;
  } w, *x;
  int l,m;
  for (i=0;i<20;i++) {
    for (j=0;j<20;j++) bigarray[i][j] = 20*i + j;
  }
  fred.r = 1;
  fred.s = 5.5;
  bert = (void*)malloc(8);
  w.p = (void*)malloc(4);
  w.q = (void*)malloc(4);
  bert->r = 7;
  bert->s = 8.5;
  *w.p = 8;
  t.p = 7;
  t.q1.r = 2;
  t.q1.s = 2.5;
  t.q2.r = 3;
  t.q2.s = 3.5;
  /*  *x->q->r = 1;
   *x->q->s = 1.5; */
  k = (void*)malloc(4*sizeof(int));
  printf("Enter number of iterations : ");
  scanf("%d",&n);
  printf("Enter number of iterations again : ");
  scanf("%d",&n);
  printf("And again : ");
  scanf("%d",&n);
  for (i=0;i<n;i++) {
    m = 4;
    a[i] = 2*i;
    myprint(i,a[i]);
  }
}

myprint.c...

myprint(int i,int j) {
  printf("a[%d] = %d\n",i,j);
}

^ permalink raw reply	[flat|nested] 25+ messages in thread
* gdba probs
@ 2002-12-05  6:19 Miles Bader
  0 siblings, 0 replies; 25+ messages in thread
From: Miles Bader @ 2002-12-05  6:19 UTC (permalink / raw)
  Cc: emacs-devel

Seeing the recent activity on `gdba', I decided to check it out, and got
bunches of errors.  The gdb command line I used was this:

   kgdb -annotate=2 $lkb/as85ep1-rom/linux

[kgdb is just a symbolic link to `v850e-elf-gdb']

It initially divided the frame into 6 (!) windows, most of which I
don't want; is there a way to customize which windows it uses?

I think ideally, certain windows would only show up if they had
contents.  Note that most GUI debuggers I've used only display the
source-code window and command windows by default; you have to
explicitly pop up windows to show registers/breakpoints/stack/etc
(though once they're popped up, the debugger keeps them updated).

Here's the *gdb-linux* buffer's contents:

   Current directory is /proj/soft2/uclinux/uclinux/build/as85ep1-rom/
   GNU gdb 4.18-v850ice-000414-nmit-20010327
   Copyright 1998 Free Software Foundation, Inc.
   GDB is free software, covered by the GNU General Public License, and you are
   welcome to change it and/or distribute copies of it under certain conditions.
   Type "show copying" to see the conditions.  This version of GDB is supported
   for customers of Cygnus Solutions.  Type "show warranty" for details.
   This GDB was configured as "--host=i386-pc-linux-gnu --target=v850e-elf"...
   warning: Target may not support unknown architecture

   Connected to the simulator.
   Breakpoint 1 at 0x80
   Breakpoint 2 at 0x4b0
   Loading section .intv, size 0x480 vma 0x0
   Loading section .text, size 0x45be0 vma 0x480
   Loading section .init_text, size 0x3b7c vma 0x47000
   Loading section .root, size 0x7a800 vma 0x4b000
   Loading section .data, size 0x6000 vma 0x400000
   Loading section .init_data, size 0x3b8 vma 0x406000
   Start address 0x480
   Transfer rate: 6634656 bits in <1 sec.
   (gdb) break *_start
   Breakpoint 3 at 0x480
   (gdb) run
   Starting program: /proj/soft2/uclinux/uclinux/build/as85ep1-rom/linux 
     C-c C-cQuit
   (gdb) (gdb) (gdb) fr
   #0  0x480 in _start ()
   (gdb) fr
   #0  0x480 in _start ()
   (gdb) si

It seemed to hang despite the fist break point, which is why I hit `C-c C-c'.

At that point, it also popped up _another_ window in its own frame,
called `*display 1*'; I have no idea what the purpose of this is...

I got various lisp errors too; here's the contents of my *Messages*
buffer:

   Loading gdb-ui (source)...done
   Loading cc-mode...done
   Loading vc-cvs...done
   Followed link to /proj/soft2/uclinux/uclinux/uClinux-2.4.x/init/main.c
   Mark set
   Replaced 0 occurrences
   Mark set
   Replaced 0 occurrences
   Mark set
   Replaced 0 occurrences
   Mark set [3 times]
   error in process filter: progn: Search failed: "in\\s-+\\S-+\\s-+at\\s-+"
   error in process filter: Search failed: "in\\s-+\\S-+\\s-+at\\s-+"
   Mark set [2 times]
   Replaced 0 occurrences
   Mark set
   Replaced 0 occurrences
   Mark set
   Replaced 0 occurrences
   Mark set [3 times]
   error in process filter: progn: Search failed: "in\\s-+\\S-+\\s-+at\\s-+"
   error in process filter: Search failed: "in\\s-+\\S-+\\s-+at\\s-+"
   error in process filter: not: Wrong type argument: stringp, nil
   error in process filter: Wrong type argument: stringp, nil
   error in process filter: cond: Phase error in gdb-prompt (got emacs)
   error in process filter: Phase error in gdb-prompt (got emacs)
   Mark set
   Replaced 0 occurrences
   Mark set
   Replaced 0 occurrences
   Mark set
   Replaced 0 occurrences
   Mark set [4 times]
   Replaced 0 occurrences
   Mark set
   Replaced 0 occurrences
   Mark set
   Replaced 0 occurrences
   Mark set [3 times]
   Replaced 0 occurrences
   Mark set
   Replaced 0 occurrences
   Mark set
   Replaced 0 occurrences
   Mark set [2 times]
   error in process filter: not: Wrong type argument: stringp, nil
   error in process filter: Wrong type argument: stringp, nil
   error in process filter: cond: Phase error in gdb-prompt (got emacs)
   error in process filter: Phase error in gdb-prompt (got emacs)

BTW, note all the spurious `Mark set' and `Replaced 0 occurrences'
messages (I never set the mark or did any replacing) -- it looks like
some lisp code is using the `replace-string' function when it shouldn't
(generally lisp code shouldn't use it at all).

Hmmm, is there anything I can do to provide more useful bug reports?

Thanks,

-Miles
-- 
`Cars give people wonderful freedom and increase their opportunities.
 But they also destroy the environment, to an extent so drastic that
 they kill all social life' (from _A Pattern Language_)

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

end of thread, other threads:[~2002-12-15  0:36 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-05 20:40 gdba probs Nick Roberts
2002-12-05 21:49 ` Stefan Monnier
2002-12-07  2:38   ` Nick Roberts
2002-12-07  3:10     ` Miles Bader
2002-12-09 15:46     ` Stefan Monnier
2002-12-10 14:19     ` Stefan Monnier
     [not found]       ` <15862.30022.647969.267154@nick.uklinux.net>
     [not found]         ` <200212111411.gBBEBUn03805@rum.cs.yale.edu>
2002-12-11 22:27           ` Nick Roberts
2002-12-11 22:48             ` Stefan Monnier
2002-12-12  0:05               ` Nick Roberts
2002-12-12 13:49                 ` Stefan Monnier
2002-12-12 14:13                   ` Miles Bader
2002-12-13 22:21                 ` Richard Stallman
2002-12-12  1:24             ` Miles Bader
2002-12-12 10:22               ` Kim F. Storm
2002-12-15  0:36   ` Nick Roberts
2002-12-07 21:25 ` Richard Stallman
2002-12-08  1:55   ` Nick Roberts
2002-12-09 20:21     ` Richard Stallman
2002-12-10 21:39       ` Nick Roberts
2002-12-10 23:44         ` Kim F. Storm
2002-12-11 20:40         ` Richard Stallman
2002-12-08  2:27   ` Miles Bader
2002-12-10 14:14     ` Stefan Monnier
2002-12-11 17:45       ` Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2002-12-05  6:19 Miles Bader

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.