[haiku-bugs] [Haiku] #12916: [Debugger] Handle retrieving image paths for chrooted teams

  • From: "anevilyak" <trac@xxxxxxxxxxxx>
  • Date: Wed, 17 Aug 2016 00:18:41 -0000

#12916: [Debugger] Handle retrieving image paths for chrooted teams
-----------------------------------+------------------------------
 Reporter:  anevilyak              |        Owner:  anevilyak
     Type:  bug                    |       Status:  new
 Priority:  normal                 |    Milestone:  Unscheduled
Component:  Applications/Debugger  |      Version:  R1/Development
 Keywords:                         |   Blocked By:
 Blocking:                         |  Has a Patch:  0
 Platform:  All                    |
-----------------------------------+------------------------------
 Currently, LocalDebuggerInterface uses get_next_image_info() to retrieve
 the list of images for the targetted team. However, if the team is in a
 chroot, the path returned in the image information appears to have the
 path used inside the chroot, rather than the full filesystem path, which
 consequently leads to us being unable to locate the binary in question.

 A few potential solutions present themselves here:

 1) get_*_image_info could detect if the caller is in the same team or not,
 and if not, return the full path rather than the adjusted one. This may or
 may not be easily done depending on the inner workings of the
 corresponding kernel data structures (not yet investigated).

 2) A new system call could be introduced that, given a team_id and a root-
 relative path within that team, maps it to its full filesystem path
 outside the chroot.

 or

 3) Additional calls/messages could be added to the debug API that provides
 similar semantics to get_*_image_info() but always returns the full path,
 thus leaving the former unmodified.

 IMO, the third approach would probably be best, since it minimizes the
 risk of introducing any regressions in the more widely used standard
 calls, and makes it clear that the desired behavior is to return the
 information needed by the debugger. In any case, any such solution also
 needs to adjust the debug kit's image load/unload events to likewise take
 chroots into account if they don't already.

 Thoughts/suggestions?

--
Ticket URL: <https://dev.haiku-os.org/ticket/12916>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: