public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/15979] New: current_directory not updated if chdir done from python
@ 2013-09-25 23:33 dje at google dot com
  2013-09-25 23:53 ` [Bug gdb/15979] " dje at google dot com
  2013-10-01 15:47 ` palves at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: dje at google dot com @ 2013-09-25 23:33 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=15979

            Bug ID: 15979
           Summary: current_directory not updated if chdir done from
                    python
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: dje at google dot com

gdb keeps cwd in global current_directory, and the "cd" command updates it.
Who updates it if the user does chdir from python?

Do we still need this global?
Or do we have to watch for this in every callout to python (blech).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug gdb/15979] current_directory not updated if chdir done from python
  2013-09-25 23:33 [Bug gdb/15979] New: current_directory not updated if chdir done from python dje at google dot com
@ 2013-09-25 23:53 ` dje at google dot com
  2013-10-01 15:47 ` palves at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: dje at google dot com @ 2013-09-25 23:53 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=15979

--- Comment #1 from dje at google dot com ---
More things to look into:

1) cd_command has code to canonicalize out "." and ".." in paths but it doesn't
handle symlinks (whether it should or not is debatable, so this could be a
non-bug, depending on how wants to define things).

2) There is also gdb_dirbuf.
This can lead to things like:

bash$ gdb
(gdb) pwd
Working directory /home/dje/src/play/subdir.
(gdb) cd ..
Working directory /home/dje/src/play.
(gdb) python os.chdir ("..")
(gdb) pwd
Working directory /home/dje/src/play
 (canonically /home/dje/src).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug gdb/15979] current_directory not updated if chdir done from python
  2013-09-25 23:33 [Bug gdb/15979] New: current_directory not updated if chdir done from python dje at google dot com
  2013-09-25 23:53 ` [Bug gdb/15979] " dje at google dot com
@ 2013-10-01 15:47 ` palves at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: palves at redhat dot com @ 2013-10-01 15:47 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=15979

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |palves at redhat dot com

--- Comment #2 from Pedro Alves <palves at redhat dot com> ---
> 1) it doesn't handle symlinks (whether it should or not is debatable, so this > could be a non-bug, depending on how wants to define things).

IMO, "cd" should follow continue not resolving symlinks by default, like sh and
bash.  See <http://pubs.opengroup.org/onlinepubs/009695399/utilities/cd.html>:

> The following options shall be supported by the implementation:
> 
> -L
>     Handle the operand dot-dot logically; symbolic link components shall not 
> be resolved before dot-dot components are processed (see steps 8. and 9. in 
> the DESCRIPTION).
> -P
>     Handle the operand dot-dot physically; symbolic link components shall be 
> resolved before dot-dot components are processed (see step 7. in the 
> DESCRIPTION). 

If people want gdb's "cd" to resolve symlinks, we could add -P/-L for that.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-01 15:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-25 23:33 [Bug gdb/15979] New: current_directory not updated if chdir done from python dje at google dot com
2013-09-25 23:53 ` [Bug gdb/15979] " dje at google dot com
2013-10-01 15:47 ` palves at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).