This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: How to add a new command?
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Fei Ding <fdingiit at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Thu, 26 Mar 2015 05:49:10 +0200
- Subject: Re: How to add a new command?
- Authentication-results: sourceware.org; auth=none
- References: <CAGmPkf+_LZdUpz=jcXGNBbaqpJqzmZfkeF5qKxJZTwX9omi8-Q at mail dot gmail dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> 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.