Re: [RFC] Python Finish Breakpoints

Joel Brobecker
2011-12-27T04:17:18Z

[-- Attachment #1: Type: text/plain, Size: 272 bytes --]

> (i won't be able to fix the ARI until the mid of next week but i'll take a
> look at that ASAP and for sure before the release)

I've checked in a fix in HEAD. Tested on x86_64-linux without any
regression. Not sure if we'll want it for the 7.4 branch or not.

--
Joel

[-- Attachment #2: py-bp-sprintf.diff --]
[-- Type: text/x-diff, Size: 998 bytes --]

commit b8c553d40b229b1b25c1e5bb309e0c8f5745ebc2
Author: Joel Brobecker <brobecker@adacore.com>
Date: Mon Dec 26 15:08:34 2011 +0400

remove use of sprintf in py-finishbreakpoint.c...

... and replace it with call to xsnprintf, following GDB's coding rules.

gdb/ChangeLog:

* py-finishbreakpoint.c (bpfinishpy_init): Replace call to
sprintf by call to xsnprintf.

diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c
index a2d8165..c158d47 100644
--- a/gdb/python/py-finishbreakpoint.c
+++ b/gdb/python/py-finishbreakpoint.c
@@ -277,7 +277,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
{
/* Set a breakpoint on the return address. */
finish_pc = get_frame_pc (prev_frame);
- sprintf (small_buf, "*%s", hex_string (finish_pc));
+ xsnprintf (small_buf, sizeof (small_buf), "*%s", hex_string (finish_pc));
addr_str = small_buf;

create_breakpoint (python_gdbarch,