* How can I define the breakpoint-commands in my gdbinit file
@ 2006-12-14 1:51 Luo Yi
2006-12-14 1:54 ` Daniel Jacobowitz
2006-12-14 4:27 ` Eli Zaretskii
0 siblings, 2 replies; 7+ messages in thread
From: Luo Yi @ 2006-12-14 1:51 UTC (permalink / raw)
To: gdb
How can I define the breakpoint-commands in my gdbinit file ?
define b1
b *0x805d3bf
commands
silent
printf "ne, eax = %x\n", $eax
end <<< ------------
end
the commands need a end instruction which can't appear in the middle
of the gdbinit file.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How can I define the breakpoint-commands in my gdbinit file
2006-12-14 1:51 How can I define the breakpoint-commands in my gdbinit file Luo Yi
@ 2006-12-14 1:54 ` Daniel Jacobowitz
2006-12-14 2:01 ` Luo Yi
2006-12-14 4:27 ` Eli Zaretskii
1 sibling, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2006-12-14 1:54 UTC (permalink / raw)
To: Luo Yi; +Cc: gdb
On Thu, Dec 14, 2006 at 09:51:19AM +0800, Luo Yi wrote:
> How can I define the breakpoint-commands in my gdbinit file ?
>
> define b1
> b *0x805d3bf
> commands
> silent
> printf "ne, eax = %x\n", $eax
> end <<< ------------
> end
>
> the commands need a end instruction which can't appear in the middle
> of the gdbinit file.
It should work fine. Are you using the latest GDB?
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How can I define the breakpoint-commands in my gdbinit file
2006-12-14 1:54 ` Daniel Jacobowitz
@ 2006-12-14 2:01 ` Luo Yi
2006-12-14 3:10 ` Daniel Jacobowitz
0 siblings, 1 reply; 7+ messages in thread
From: Luo Yi @ 2006-12-14 2:01 UTC (permalink / raw)
To: gdb
luoyi@slack$ cat ~/.gdbinit
define mybp
b main
commands
silent
printf "eax = %x\n", $eax
end
end
luoyi@slack$ gdb a.out
GNU gdb 6.5
Copyright (C) 2006 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.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as
"i486-slackware-linux".../home/luoyi/.gdbinit:7: Error in sourced
command file:
This command cannot be used at the top level.
Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) mybp
Breakpoint 1 at 0x8048440
Quit <<------------------ gdb stop here! after Ctrl+C, it go on with this
(gdb)
2006/12/14, Daniel Jacobowitz <drow@false.org>:
> On Thu, Dec 14, 2006 at 09:51:19AM +0800, Luo Yi wrote:
> > How can I define the breakpoint-commands in my gdbinit file ?
> >
> > define b1
> > b *0x805d3bf
> > commands
> > silent
> > printf "ne, eax = %x\n", $eax
> > end <<< ------------
> > end
> >
> > the commands need a end instruction which can't appear in the middle
> > of the gdbinit file.
>
> It should work fine. Are you using the latest GDB?
> --
> Daniel Jacobowitz
> CodeSourcery
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How can I define the breakpoint-commands in my gdbinit file
2006-12-14 2:01 ` Luo Yi
@ 2006-12-14 3:10 ` Daniel Jacobowitz
0 siblings, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2006-12-14 3:10 UTC (permalink / raw)
To: Luo Yi; +Cc: gdb
On Thu, Dec 14, 2006 at 10:01:51AM +0800, Luo Yi wrote:
> "i486-slackware-linux".../home/luoyi/.gdbinit:7: Error in sourced
> command file:
> This command cannot be used at the top level.
Then I was wrong - it must be broken.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How can I define the breakpoint-commands in my gdbinit file
2006-12-14 1:51 How can I define the breakpoint-commands in my gdbinit file Luo Yi
2006-12-14 1:54 ` Daniel Jacobowitz
@ 2006-12-14 4:27 ` Eli Zaretskii
2006-12-14 5:02 ` Luo Yi
1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2006-12-14 4:27 UTC (permalink / raw)
To: Luo Yi; +Cc: gdb
> Date: Thu, 14 Dec 2006 09:51:19 +0800
> From: "Luo Yi" <firingme@gmail.com>
>
> How can I define the breakpoint-commands in my gdbinit file ?
>
> define b1
> b *0x805d3bf
> commands
> silent
> printf "ne, eax = %x\n", $eax
> end <<< ------------
> end
>
> the commands need a end instruction which can't appear in the middle
> of the gdbinit file.
There are bugs in nesting canned commands that are finished by `end'.
I have a local patch to solve at least some of the bugs, but I never
got to apply it because I was requested to show the results of the
test suite after applying the patch, and never had time to install
expect and run the suite.
I could try to dig out that patch, if you want to try it.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How can I define the breakpoint-commands in my gdbinit file
2006-12-14 4:27 ` Eli Zaretskii
@ 2006-12-14 5:02 ` Luo Yi
2006-12-14 21:10 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Luo Yi @ 2006-12-14 5:02 UTC (permalink / raw)
To: Eli Zaretskii, gdb
> There are bugs in nesting canned commands that are finished by `end'.
>
> I have a local patch to solve at least some of the bugs, but I never
> got to apply it because I was requested to show the results of the
> test suite after applying the patch, and never had time to install
> expect and run the suite.
>
> I could try to dig out that patch, if you want to try it.
>
can you post your patches so I can get a try
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How can I define the breakpoint-commands in my gdbinit file
2006-12-14 5:02 ` Luo Yi
@ 2006-12-14 21:10 ` Eli Zaretskii
0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2006-12-14 21:10 UTC (permalink / raw)
To: Luo Yi; +Cc: gdb
> Date: Thu, 14 Dec 2006 13:02:31 +0800
> From: "Luo Yi" <firingme@gmail.com>
>
> > There are bugs in nesting canned commands that are finished by `end'.
> >
> > I have a local patch to solve at least some of the bugs, but I never
> > got to apply it because I was requested to show the results of the
> > test suite after applying the patch, and never had time to install
> > expect and run the suite.
> >
> > I could try to dig out that patch, if you want to try it.
> >
>
> can you post your patches so I can get a try
I already did, almost a year ago:
http://sourceware.org/ml/gdb-patches/2006-01/msg00140.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-12-14 21:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-14 1:51 How can I define the breakpoint-commands in my gdbinit file Luo Yi
2006-12-14 1:54 ` Daniel Jacobowitz
2006-12-14 2:01 ` Luo Yi
2006-12-14 3:10 ` Daniel Jacobowitz
2006-12-14 4:27 ` Eli Zaretskii
2006-12-14 5:02 ` Luo Yi
2006-12-14 21:10 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox