Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: asmwarrior <asmwarrior@gmail.com>
To: Doug Evans <dje@google.com>
Cc: gdb-patches@sourceware.org, Chris Sutcliffe <ir0nh34d@gmail.com>
Subject: Re: [windows] patch to set breakpoint in a dll
Date: Fri, 16 Mar 2012 01:52:00 -0000	[thread overview]
Message-ID: <4F629CE5.8030301@gmail.com> (raw)
In-Reply-To: <20120314182606.F20822461B2@ruffy.mtv.corp.google.com>

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

On 2012-3-15 2:26, Doug Evans wrote:
> On Fri, Mar 9, 2012 at 8:40 PM, asmwarrior<asmwarrior@gmail.com>  wrote:
>> 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.
> Thanks.
> This needs a ChangeLog entry of course.
> Something like
>
> 2012-03-14  Zhang Yuanhui<asmwarrior@gmail.com>
>
> 	* source.c (find_and_open_source): Consistently pass resulting
> 	full path through xfullpath.
>
> Further comments inline with the patch.
>
>    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;
>
> Move this declaration into the block where it is used.
>
>       /* 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;
>    +      {
>
> Add a comment here explaining why we're calling xfullpath.
> E.g.,
>             /* Call xfullpath here to be consistent with openp
>                which we use below.  */
>
>    +        lpath = xfullpath(*fullname);
>    +        xfree(*fullname);
>
> Space before '('.
> Plus, for consistency, I think the indentation here should use tabs.
>
>    +        *fullname = lpath;
>    +        return result;
>    +      }
>           /* Didn't work -- free old one, try again.  */
>           xfree (*fullname);
>           *fullname = NULL;
>
>
> Ok with those changes.
> Thanks!
Ok, this is the new patch.(I have problem using the TortoiseGit to generate a diff between two revisions.you can see, the file name is long and dirty)

Also, the log message is what you wrote:


2012-03-14  Zhang Yuanhui <asmwarrior@gmail.com>

     * source.c (find_and_open_source): Consistently pass resulting
     full path through xfullpath.


My family name is "Zhang", so I'm not sure it should be put before the given name or after the given name. The Chinese name and English name have different formats.


Thanks.









[-- Attachment #2: bp.patch --]
[-- Type: text/x-c++, Size: 704 bytes --]

diff --git "a/C:\\Temp\\sou4C.tmp\\source-765c91-left.c" "b/C:\\Temp\\sou49.tmp\\source-e835db-right.c"
index cfdf81b..1293b38 100644
--- "a/C:\\Temp\\sou4C.tmp\\source-765c91-left.c"
+++ "b/C:\\Temp\\sou49.tmp\\source-e835db-right.c"
@@ -996,8 +996,16 @@ find_and_open_source (const char *filename,
         }
 
       result = open (*fullname, OPEN_MODE);
+      /* Call xfullpath here to be consistent with openp
+         which we use below.  */
       if (result >= 0)
+      {
+	char *lpath;
+	lpath = xfullpath (*fullname);
+	xfree (*fullname);
+	*fullname = lpath;
 	return result;
+      }
       /* Didn't work -- free old one, try again.  */
       xfree (*fullname);
       *fullname = NULL;

  reply	other threads:[~2012-03-16  1:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05 15:10 asmwarrior
2012-03-07 18:46 ` Doug Evans
2012-03-08  2:18   ` asmwarrior
2012-03-08 22:39     ` Doug Evans
2012-03-10  4:39       ` asmwarrior
2012-03-14 18:26         ` Doug Evans
2012-03-16  1:52           ` asmwarrior [this message]
2012-03-16 22:23             ` Doug Evans
2012-03-17  1:13               ` asmwarrior
2012-04-11 15:25             ` asmwarrior
2012-04-11 18:43               ` Doug Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F629CE5.8030301@gmail.com \
    --to=asmwarrior@gmail.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ir0nh34d@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox