unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Sanjeev Kumar.S" <sanjeevfiles@yahoo.com>
To: Nick Roberts <nickrob@snap.net.nz>
Cc: help-gnu-emacs@gnu.org
Subject: Re: kgdb in emacs
Date: Sun, 27 Jan 2008 02:17:36 -0800 (PST)	[thread overview]
Message-ID: <175841.40216.qm@web57709.mail.re3.yahoo.com> (raw)
In-Reply-To: <18332.19879.672102.308829@kahikatea.snap.net.nz>


[-- Attachment #1.1: Type: text/plain, Size: 4168 bytes --]

I will answer your questions from the beginning:


> When can you use gdb -k?
> With the latest GDB from CVS, I get:
> $ gdb -k
> gdb: unrecognized option `-k'
I believe in newer versions of bsd release we've moved from 
"bsd -k" to  kgdb. I don't know why this decision was made. Maybe
its for some simple reason but I haven't poked around it.

> Run gdb ( like this ) : kgdb -a -a -a kernel.debug
> (kgdb) target remote  /dev/cuad0

kgdb requires either a core file or a device file for remote
debugging. If we issue this command on a local machine this
behavior is pretty straightforward, with no quirkiness.

> I guess you mean Emacs now parses your command line now.

> But presumably you still get *gud-cuad0* in the mode-line of the GUD
> buffer.

Yes. I get the above, but is that an issue ? 

> Does kgdb work like gdb?
yes it works like gdb. In its full glory.

> Is "target remote  /dev/cuad0" a valid kgdb command?

Again, I was not able to get to this point without specifying the 
complete set of arguments while starting. ie. to start i need to specify
-r and the debug file. without that i was not able to start it up.

> Run gdb ( like this ) : kgdb -a -a -a -r /dev/cuad0 kernel.debug

Just -a works for me. "-a -a" or "-a -a -a" and I get some garbled output
on the screen. But still I have an issue, I have to press a "n" or "s" to
get emacs to display the source file. Any way around it ?

> One last thing, if you do get it to work well, please e-mail me what you
> have learnt so that I can add it to my homepage.

Yes...I will do this. I will make a complete document and give one copy
to you and one to the Freebsd doc team. But I will try and get as much
questions resolved in the document, so no one has to waste almost
a day figuring it out like me. 

Regards,
Sanjeev.

Nick Roberts <nickrob@snap.net.nz> wrote:  > Thank you very much Nick, Your clue of emacs version prompted me
 > to upgrade my emacs. after which I'm able to do it.

I guess you mean Emacs now parses your command line now.

But presumably you still get *gud-cuad0* in the mode-line of the GUD
buffer.

 > BTW,  my earlier emacs version was 21.2.4 and now it is 22.0.50.1
 > 
 > One more question: I'm still not able to open the file another emacs
 > window. I thought this was supposed happen automatically. In other
 > instances of emacs ( like when debugging apps ) the source code file
 > opens automatically in another emacs window ( vertical split style).

I have some more thoughts but you need to answer my questions for good
communication.

Does kgdb work like gdb?
Is "target remote  /dev/cuad0" a valid kgdb command?

 > Even if it doesn't, when I enter "f" it opens up automatically.

For the source to appear gdb/kgdb must output annotations.  In gdb, this
requires "--fullname" or "-annotate=1" for text mode and "-annotate=3"
for graphical mode.  In Emacs 21 "--fullname" was used but was not visible
to the user.

In Emacs 22, running an app like this:

  Run gdb (like this): gdb myprog

won't display the source, but:

  Run gdb (like this): gdb -annotate=3 myprog

will.  Likewise, I suspect

  Run gdb ( like this ) : kgdb -r /dev/cuad0 kernel.debug

won't display the source, but:

  Run gdb ( like this ) : kgdb -a -a -a -r /dev/cuad0 kernel.debug

will.

 > One possibility is, though i changed the emacs current directory
 > to /usr/obj/usr/src/sys/MYKERNEL/ , the -r /dev/cuad0 option would have
 > changed the default directory, as evident in the file line when a gud
 > window is opened:
 > Current directory is /dev/
 > :(

You really want to find another way of specifying the arguments along the lines
that I suggested, so that the directory doesn't change and you get
*gud-kernel.debug* in the mode-line of the GUD buffer.  However, I think
another way to stop the current directory from changing is to set
gud-chdir-before-run to nil.

One last thing, if you do get it to work well, please e-mail me what you
have learnt so that I can add it to my homepage.

Thanks,

Nick                                           http://www.inet.net.nz/~nickrob


       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.

[-- Attachment #1.2: Type: text/html, Size: 4871 bytes --]

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

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

  reply	other threads:[~2008-01-27 10:17 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-26 17:14 Mysterious hidden end of line characters David
2008-01-26 19:21 ` Thierry Volpiatto
2008-01-26 19:54   ` David
2008-01-26 20:06   ` David
2008-01-26 20:08     ` David
     [not found]   ` <mailman.6584.1201377847.18990.help-gnu-emacs@gnu.org>
2008-01-27  6:10     ` Tim X
2008-01-27  7:17       ` kgdb in emacs Sanjeev Kumar.S
2008-01-27  8:26         ` Nick Roberts
2008-01-27  8:53           ` Sanjeev Kumar.S
2008-01-27  9:23             ` Nick Roberts
2008-01-27 10:17               ` Sanjeev Kumar.S [this message]
2008-01-27 10:51                 ` Nick Roberts
2008-01-27 11:21                   ` Sanjeev Kumar.S
2008-01-27 20:40                     ` Nick Roberts
2008-01-26 20:41 ` Mysterious hidden end of line characters Peter Dyballa
2008-01-30 15:04   ` David
     [not found]   ` <mailman.6748.1201705322.18990.help-gnu-emacs@gnu.org>
2008-01-31  6:21     ` Tim X
2008-01-31 10:20       ` Thierry Volpiatto
2008-01-31 11:17         ` Peter Dyballa
2008-01-31 12:44           ` Thierry Volpiatto
2008-01-31 16:04           ` Thierry Volpiatto
2008-01-31 16:12           ` Thierry Volpiatto
2008-01-31 16:40           ` Thierry Volpiatto
2008-02-02 14:18           ` Thierry Volpiatto
2008-02-04 13:00           ` Thierry Volpiatto
2008-02-04 13:10           ` Thierry Volpiatto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=175841.40216.qm@web57709.mail.re3.yahoo.com \
    --to=sanjeevfiles@yahoo.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=nickrob@snap.net.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).