Introduce and use new_breakpoint_from_type
authorSimon Marchi <simon.marchi@polymtl.ca>
Fri, 2 Jun 2017 21:16:19 +0000 (23:16 +0200)
committerSimon Marchi <simon.marchi@ericsson.com>
Fri, 2 Jun 2017 21:16:19 +0000 (23:16 +0200)
commita5e364af4a3d745bb79cfc9a1d533632d4d04b57
tree8b6ee62ee15d5aaca6044f9b2a8d25d3954c9520
parente7cd2680e089327e7fefaf1cf5a58ec09e379f0d
Introduce and use new_breakpoint_from_type

This is a small preparatory patch to factor out a snippet that appears
twice.  More kinds of breakpoints will need to be created based on
bptype, so I think it's a good idea to centralize the instantiation of
breakpoint objects.

gdb/ChangeLog:

* breakpoint.c (new_breakpoint_from_type): New function.
(create_breakpoint_sal): Use new_breakpoint_from_type and
unique_ptr.
(create_breakpoint): Likewise.
gdb/ChangeLog
gdb/breakpoint.c