This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Add option to skip prologue in "break FILE:LINENO" (take 2)


Hello,

Following a request for comments regarding a proposed change of behavior
when inserting a breakpoint on a specific line number, we received a
variety of comments, and it appears very clearly that the proposal
was at the very least controversial.

So, here is a new proposal where the existing behavior is preserved.
A new set/show command is introduced to allow the user to configure
GDB to activate the new proposed behavior:

    (gdb) set/show breakpoint skip-prologue

The help text for this command explains the purpose of this option:

  Set the debugger behavior when inserting a breakpoint on a specific line.
  When inserting a breakpoint on a specific line number that corresponds
  to the prologue of a function, the debugger will automatically adjust
  its location to the first line past the prologue if this option is set.

By default, this option is OFF, preserving the current behavior.
I think this should take care of all the objections I read so far.

2008-01-10  Joel Brobecker  <brobecker@adacore.com>

        * breakpoint.c (breakpoint_skip_prologue_p): New static global.
        (show_breakpoint_skip_prologue): New function.
        (skip_prologue_sal): New function.
        (resolve_sal_pc): Adjust SAL past prologue if the SAL was computed
        from a line number and breakpoint_skip_prologue_p is set.
        (_initialize_breakpoint): Add new set/show break skip-prologue
        command.

Tested on x86-linux, no regression.
A new testcase, a NEWs entry, and proper documentation will be submitted
later if the patch is approved.

OK to commit?

Thanks,
-- 
Joel

Attachment: skip-prologue.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]