This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [windows] patch to set breakpoint in a dll
On 2012-3-9 6:39, Doug Evans wrote:
No such quick check is available, but I think we can ignore the cost
of the xmalloc/xfree for this particular case until the data shows
it's a problem.
Ok, this is the modified patch.(simply replace gdb_fullpath with xfullpath)
It works Ok under mingw+windowsXP.
gdb/source.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/gdb/source.c b/gdb/source.c
index cfdf81b..cd87e34 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -979,6 +979,7 @@ find_and_open_source (const char *filename,
char *path = source_path;
const char *p;
int result;
+ char *lpath;
/* Quick way out if we already know its full name. */
@@ -997,7 +998,12 @@ find_and_open_source (const char *filename,
result = open (*fullname, OPEN_MODE);
if (result >= 0)
- return result;
+ {
+ lpath = xfullpath(*fullname);
+ xfree(*fullname);
+ *fullname = lpath;
+ return result;
+ }
/* Didn't work -- free old one, try again. */
xfree (*fullname);
*fullname = NULL;