List Info

Thread: how to add a new command in the gdb




how to add a new command in the gdb
user name
2007-07-10 11:58:21
hi...
    If I want to add a new command in the gdb, such as
"info TLB" or
some special operations. What should I do?
I'm using a RSP to communicate a target simulator. So, it is
remote debugging!

 any suggestion is welcome.
best regards,

Dave.

-- 
System  on Chip Design  Lab.
Dept. of Computer Science and Information Engineering,
National Chung Cheng University
E-mail : s88.twacm.org

Re: how to add a new command in the gdb
country flaguser name
United States
2007-07-11 13:56:54
s88 <dave.twgmail.com> writes:
>    If I want to add a new command in the gdb, such as
"info TLB" or
> some special operations. What should I do?
> I'm using a RSP to communicate a target simulator. So,
it is remote debugging!

Each .c file in the GDB sources ends with a function named
_initialize_foo.  Those call functions like 'add_cmd'.  I'm
afraid
you'll need to look at the definitions of add_cmd and its
companions
for the details.

Re: how to add a new command in the gdb
country flaguser name
Portugal
2007-07-11 17:33:35
Jim Blandy wrote:
> s88 writes:
>>    If I want to add a new command in the gdb, such
as "info TLB" or
>> some special operations. What should I do?
>> I'm using a RSP to communicate a target simulator.
So, it is remote debugging!
> 
> Each .c file in the GDB sources ends with a function
named
> _initialize_foo.  Those call functions like 'add_cmd'. 
I'm afraid
> you'll need to look at the definitions of add_cmd and
its companions
> for the details.
> 

Or, if you control the remote stub talking to the simulator,
implement
a monitor command:

"monitor cmd
     This command allows you to send arbitrary commands
directly to the remote 
monitor. Since GDB doesn't care about the commands it sends
like this, this 
command is the way to extend GDB---you can add new commands
that only the 
external monitor will understand and implement."

http://sourceware.org/gdb/current/onlinedocs/gdb_
18.html#IDX793

Cheers,
Pedro Alves


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )