public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug breakpoints/12958] New: How to set a breakpoint at the exit of a function?
@ 2011-07-04 9:21 wuchengping at h3c dot com
2011-07-06 1:33 ` [Bug breakpoints/12958] " qiyao at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: wuchengping at h3c dot com @ 2011-07-04 9:21 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=12958
Summary: How to set a breakpoint at the exit of a function?
Product: gdb
Version: 7.2
Status: NEW
Severity: enhancement
Priority: P2
Component: breakpoints
AssignedTo: unassigned@sourceware.org
ReportedBy: wuchengping@h3c.com
I know how to set a breakpoint at the begin of a function.it is "break
function_name",but how to set a breakpoint at the exit/end of a function?
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug breakpoints/12958] How to set a breakpoint at the exit of a function?
2011-07-04 9:21 [Bug breakpoints/12958] New: How to set a breakpoint at the exit of a function? wuchengping at h3c dot com
@ 2011-07-06 1:33 ` qiyao at gcc dot gnu.org
2011-07-06 3:08 ` wuchengping at h3c dot com
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: qiyao at gcc dot gnu.org @ 2011-07-06 1:33 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=12958
Yao Qi <qiyao at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |qiyao at gcc dot gnu.org
--- Comment #1 from Yao Qi <qiyao at gcc dot gnu.org> 2011-07-06 01:33:03 UTC ---
(In reply to comment #0)
> I know how to set a breakpoint at the begin of a function.it is "break
> function_name",but how to set a breakpoint at the exit/end of a function?
you can dissembly the function in gdb, and get the address of exit/end of a
function, then you can set breakpoint on that address, for example, "b
*0x123456".
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug breakpoints/12958] How to set a breakpoint at the exit of a function?
2011-07-04 9:21 [Bug breakpoints/12958] New: How to set a breakpoint at the exit of a function? wuchengping at h3c dot com
2011-07-06 1:33 ` [Bug breakpoints/12958] " qiyao at gcc dot gnu.org
@ 2011-07-06 3:08 ` wuchengping at h3c dot com
2011-07-06 3:45 ` wuchengping at h3c dot com
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: wuchengping at h3c dot com @ 2011-07-06 3:08 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=12958
--- Comment #2 from 伍成平 <wuchengping at h3c dot com> 2011-07-06 03:08:21 UTC ---
(In reply to comment #0)
> I know how to set a breakpoint at the begin of a function.it is "break
> function_name",but how to set a breakpoint at the exit/end of a function?
test
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug breakpoints/12958] How to set a breakpoint at the exit of a function?
2011-07-04 9:21 [Bug breakpoints/12958] New: How to set a breakpoint at the exit of a function? wuchengping at h3c dot com
2011-07-06 1:33 ` [Bug breakpoints/12958] " qiyao at gcc dot gnu.org
2011-07-06 3:08 ` wuchengping at h3c dot com
@ 2011-07-06 3:45 ` wuchengping at h3c dot com
2011-07-07 9:31 ` jan.kratochvil at redhat dot com
2011-07-18 16:26 ` tromey at redhat dot com
4 siblings, 0 replies; 6+ messages in thread
From: wuchengping at h3c dot com @ 2011-07-06 3:45 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=12958
--- Comment #3 from 伍成平 <wuchengping at h3c dot com> 2011-07-06 03:44:40 UTC ---
(In reply to comment #1)
> (In reply to comment #0)
> > I know how to set a breakpoint at the begin of a function.it is "break
> > function_name",but how to set a breakpoint at the exit/end of a function?
> you can dissembly the function in gdb, and get the address of exit/end of a
> function, then you can set breakpoint on that address, for example, "b
> *0x123456".
yes,I can set a breakpoint at the exit of a function in this way,but it can
only be used once, because when I modified my code,the exit address of the
function will also change,so I must modify "the gdb command file"
synchronously.I use the gdb command in this way "gdb -p $(pidof vmserver) -x
cmd.txt",and the gdb command lies in the file(cmd.txt).the file content is:
b CDeviceMgr::queryPhyDevsInDomain
command
silent
p pcUserCode
c
end
c
In this way,I can watch the input parameters of the function,but how to watch
the output parameters?
I hope that I can set the exit breakpoint as simple as the entrance
breakpoint.The most important thing is that I hope,when I modified my code,the
gdb command file will be no need to modify synchronously.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug breakpoints/12958] How to set a breakpoint at the exit of a function?
2011-07-04 9:21 [Bug breakpoints/12958] New: How to set a breakpoint at the exit of a function? wuchengping at h3c dot com
` (2 preceding siblings ...)
2011-07-06 3:45 ` wuchengping at h3c dot com
@ 2011-07-07 9:31 ` jan.kratochvil at redhat dot com
2011-07-18 16:26 ` tromey at redhat dot com
4 siblings, 0 replies; 6+ messages in thread
From: jan.kratochvil at redhat dot com @ 2011-07-07 9:31 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=12958
Jan Kratochvil <jan.kratochvil at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jan.kratochvil at redhat
| |dot com
--- Comment #4 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2011-07-07 09:30:18 UTC ---
set record insn-number-max 10000000
record
finish
reverse-step
record stop
But that works only for functions not executing too long.
GDB currently does not have the feature to find all the function exit points, I
guess it would need some GCC debug info marking extension first.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug breakpoints/12958] How to set a breakpoint at the exit of a function?
2011-07-04 9:21 [Bug breakpoints/12958] New: How to set a breakpoint at the exit of a function? wuchengping at h3c dot com
` (3 preceding siblings ...)
2011-07-07 9:31 ` jan.kratochvil at redhat dot com
@ 2011-07-18 16:26 ` tromey at redhat dot com
4 siblings, 0 replies; 6+ messages in thread
From: tromey at redhat dot com @ 2011-07-18 16:26 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=12958
Tom Tromey <tromey at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at redhat dot com
--- Comment #5 from Tom Tromey <tromey at redhat dot com> 2011-07-18 16:24:45 UTC ---
There is a patch pending (maybe in assignment limbo) to add this feature.
I think it can also be done from python, perhaps with some difficulty.
On the gcc side: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49167
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-07-18 16:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-04 9:21 [Bug breakpoints/12958] New: How to set a breakpoint at the exit of a function? wuchengping at h3c dot com
2011-07-06 1:33 ` [Bug breakpoints/12958] " qiyao at gcc dot gnu.org
2011-07-06 3:08 ` wuchengping at h3c dot com
2011-07-06 3:45 ` wuchengping at h3c dot com
2011-07-07 9:31 ` jan.kratochvil at redhat dot com
2011-07-18 16:26 ` tromey at redhat dot com
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).