public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/13052] New: hook-stop command bug
@ 2011-08-03  6:55 amker.cheng at gmail dot com
  0 siblings, 0 replies; only message in thread
From: amker.cheng at gmail dot com @ 2011-08-03  6:55 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13052

           Summary: hook-stop command bug
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned@sourceware.org
        ReportedBy: amker.cheng@gmail.com


In gdb document, it is said hook-stop makes the associated commands
execute every time execution stops in your program.

while for cases where continue command included in hook-stop, it's not true.
for example:
define hook-stop
 p /x $pc
 continue
end

User defined hook-stop command is executed by codes:

void execute_cmd_pre_hook (struct cmd_list_element *c)
{
 if ((c->hook_pre) && (!c->hook_in))
   {
     struct cleanup *cleanups = make_cleanup (clear_hook_in_cleanup, c);
     c->hook_in = 1; /* Prevent recursive hooking.  */
     execute_user_command (c->hook_pre, (char *) 0);
     do_cleanups (cleanups);
   }
}
Since hook_in is set to 1, the (!c->hook_in) is false next time
breakpoint is hit, resulting in
hook-stop will be executed at the first breakpoint.

I understand hook_in is essential to prevent gdb from possible
recursion and seems hard
to change the behavior within current infrastructure.
Is this a bug? Should we state this in GDB document?

-- 
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] only message in thread

only message in thread, other threads:[~2011-08-03  6:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-03  6:55 [Bug gdb/13052] New: hook-stop command bug amker.cheng at gmail 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).