public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* How to add a new command?
@ 2015-03-26  2:59 Fei Ding
  2015-03-26  3:49 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Fei Ding @ 2015-03-26  2:59 UTC (permalink / raw)
  To: gdb

Hi all:

I want to add a new command to GDB based on my team's requirement,
like `(gdb) auto-check [input file]` , but I found it a litter bit
difficult to find related source code. I guess GDB should initialize
all command at some place,  and I plan to learn from it first. Any
body familiar with this? I just need some files' names of source code
,maybe function names is even more useful.

Thanks.

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

* Re: How to add a new command?
  2015-03-26  2:59 How to add a new command? Fei Ding
@ 2015-03-26  3:49 ` Eli Zaretskii
  2015-03-26  7:55 ` Dmitry Samersoff
  2015-03-26 18:32 ` Doug Evans
  2 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2015-03-26  3:49 UTC (permalink / raw)
  To: Fei Ding; +Cc: gdb

> Date: Thu, 26 Mar 2015 10:59:24 +0800
> From: Fei Ding <fdingiit@gmail.com>
> 
> I want to add a new command to GDB based on my team's requirement,
> like `(gdb) auto-check [input file]` , but I found it a litter bit
> difficult to find related source code. I guess GDB should initialize
> all command at some place,  and I plan to learn from it first. Any
> body familiar with this? I just need some files' names of source code
> ,maybe function names is even more useful.

GDB has many places where it initializes commands.  Look at any
function named _initialize_SOMETHING in the sources, that's where
commands and options are defined.

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

* Re: How to add a new command?
  2015-03-26  2:59 How to add a new command? Fei Ding
  2015-03-26  3:49 ` Eli Zaretskii
@ 2015-03-26  7:55 ` Dmitry Samersoff
  2015-03-26 18:32 ` Doug Evans
  2 siblings, 0 replies; 4+ messages in thread
From: Dmitry Samersoff @ 2015-03-26  7:55 UTC (permalink / raw)
  To: Fei Ding, gdb

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Fei,

Take a look at the Abhijith's patch:

https://sourceware.org/ml/gdb-patches/2012-05/msg00500.html

- -Dmitry

On 2015-03-26 05:59, Fei Ding wrote:
> Hi all:
> 
> I want to add a new command to GDB based on my team's requirement, 
> like `(gdb) auto-check [input file]` , but I found it a litter bit 
> difficult to find related source code. I guess GDB should
> initialize all command at some place,  and I plan to learn from it
> first. Any body familiar with this? I just need some files' names
> of source code ,maybe function names is even more useful.
> 
> Thanks.
> 


- -- 
Dmitry Samersoff
Saint Petersburg, Russia, http://devnull.samersoff.net
* There will come soft rains  ...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBAgAGBQJVE7uCAAoJEHEy08c4gIABvdsH/3DiAk9OYijIbbsumRDcEGbH
jZk4t/g1HiaxHyFMq9XaL11ZUazNMOV+k8inpQrijtW1nE8Rt/ogje0dYfFANSKB
mBAsbdXk7BGGEV6WLU2sxIZD+eFaaub5/cam9kmLAZSH8SvSzx07+4jkyex9z1t+
BXM+wxgkRx3Gpj35v6FzCYGsrztzy5XIGut8x1xp/RL/+guxnd01RMzEms2j+SFU
ScdP+SaRTvUwUkgqBCN3VJI6iyCyW/at9HJulLaEw4EhkWU31KBdBEogBWulGUQB
ht0XF1s4bOb80tuoc/4hzOF7tNwIEpZrEDtZGAhiqA2zBOATufcg9yNF9CO8mi8=
=YhE2
-----END PGP SIGNATURE-----

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

* Re: How to add a new command?
  2015-03-26  2:59 How to add a new command? Fei Ding
  2015-03-26  3:49 ` Eli Zaretskii
  2015-03-26  7:55 ` Dmitry Samersoff
@ 2015-03-26 18:32 ` Doug Evans
  2 siblings, 0 replies; 4+ messages in thread
From: Doug Evans @ 2015-03-26 18:32 UTC (permalink / raw)
  To: Fei Ding; +Cc: gdb

On Wed, Mar 25, 2015 at 7:59 PM, Fei Ding <fdingiit@gmail.com> wrote:
> Hi all:
>
> I want to add a new command to GDB based on my team's requirement,
> like `(gdb) auto-check [input file]` , but I found it a litter bit
> difficult to find related source code. I guess GDB should initialize
> all command at some place,  and I plan to learn from it first. Any
> body familiar with this? I just need some files' names of source code
> ,maybe function names is even more useful.

Another alternative is to write it in Python or Scheme:
[assuming your gdb is configured with their support]

https://sourceware.org/gdb/current/onlinedocs/gdb/Commands-In-Python.html#Commands-In-Python

https://sourceware.org/gdb/current/onlinedocs/gdb/Commands-In-Guile.html#Commands-In-Guile

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

end of thread, other threads:[~2015-03-26 18:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-26  2:59 How to add a new command? Fei Ding
2015-03-26  3:49 ` Eli Zaretskii
2015-03-26  7:55 ` Dmitry Samersoff
2015-03-26 18:32 ` Doug Evans

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).