Commit Graph

1300 Commits

Author SHA1 Message Date
Ingo Weinhold
c650ac05fd Added user debug initialization call.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11994 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-25 18:29:12 +00:00
Ingo Weinhold
4f43c96006 * Dealt with a race condition on team exit. The death semaphore and
the thread count need to be accessed atomically.
* Made debugging through exec*() work.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11993 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-25 18:28:24 +00:00
Ingo Weinhold
edc2a86662 More debug output and a new ToDo item.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11991 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-25 18:22:27 +00:00
Axel Dörfler
6557584901 Made some kernel tests build again (that didn't work anymore since I moved
some pieces around). There might be more left, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11939 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-21 17:38:22 +00:00
Ingo Weinhold
2efc846c8a * Added delete_select_sync_pool().
* A new select sync pool entry wasn't really added to the pool.
* More debug output.
* The semaphore created in common_{select,poll}() needs to be created
  with count 0, otherwise we won't block.
* A serious race condition remains in common_{select,poll)(). When a
  selected FD is closed we can't deselect select events anymore, so
  that subsequent notify_select_events() issued by the FS/driver might
  write into already free()d memory. A solution would be to get_fd()
  the involved FDs and operate directly on them instead of using the
  indices. I'm just too lazy to do that now.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11929 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-20 22:15:33 +00:00
Axel Dörfler
b55be0692f Fixed a copy&paste error that prevented _user_close() from working
correctly (it would have closed kernel file descriptors instead...).
Updated/improved docs a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11917 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-19 03:22:34 +00:00
Axel Dörfler
15e795e9ff Implemented vm_translation_map::protect() for x86. vm_set_area_protection()
now uses this one instead of using map() for every single page - this should
be faster in most cases, and also, more importantly, does not mess up the
map_count counter anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11916 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-19 03:07:33 +00:00
Axel Dörfler
1ff0923db6 Removed the old (and nowadays unused) addons directory and related headers.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11915 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-19 02:35:40 +00:00
Axel Dörfler
52fe8bf7a8 Minor header cleanup: moved some headers to better matching directories,
removed unused headers. Adapted sources to still compile with the new
header locations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11913 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-19 01:58:05 +00:00
Axel Dörfler
f22f934cd8 Moved KMessage.cpp from util/ to messaging/.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11903 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-18 16:31:40 +00:00
Axel Dörfler
9f7112f72e Moved debugger related files to debug/, moved utility files into util/.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11898 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-18 02:13:09 +00:00
Axel Dörfler
1e5006ddc3 A bit more debugging output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11897 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-18 02:10:19 +00:00
Axel Dörfler
7860b7bfe7 Added support for the B_CHECK_PERMISSION flag - this one should really
be private, as it serves no useful purpose outside of the kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11893 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-18 01:26:05 +00:00
Axel Dörfler
9391dd214d Fixed broken handling of the new file_descriptor::open_count across
team boundaries; if you didn't actually call close() from within the
application, the close-hook of the file system was never called.
Also, you could close files of other teams (ie. invoke close on a
shared file descriptor).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11892 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-18 01:24:11 +00:00
Axel Dörfler
e5fb71cba9 Removed the executable property that was accidently set on these files.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11890 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-17 23:01:11 +00:00
Axel Dörfler
4fe6ab6b05 Removed executable property these files accidently had set.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11889 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-17 22:58:04 +00:00
Axel Dörfler
0a99f533c2 Fixed the race condition in acquire_advisory_lock() by using the new switch_sem() function.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11888 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-17 22:55:20 +00:00
Axel Dörfler
34e92cad76 Added and implemented new system calls switch_sem() and switch_sem_etc(); even if
they are public now, they might become private later on.
It's almost the same as acquire_sem() but allows you to release another semaphore
atomically. This makes condvar implementations and the like very simple to do.
Added B_CHECK_PERMISSION flags to the user calls, although it's not honored yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11887 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-17 22:35:00 +00:00
Ingo Weinhold
63531836b9 * Added a small private API (<fs/select_sync_pool.h>) to support FSs
and drivers that need to provide special select() support with
  managing select notification information.
* Renamed vfs_select.c to *.cpp and fixed the resulting C++ compiler
  errors. Added tracing macros.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11886 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-17 21:27:01 +00:00
Ingo Weinhold
cbc6d404f9 Added missing select()/deselect() Hooks to the file system interface
and made sure they are called by the VFS, if existent.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11884 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-17 21:04:25 +00:00
Ingo Weinhold
d49f1b87a0 We were handling closing of file descriptors incorrectly. The close_*()
and free_*_cookie() hooks of the underlying FS were always called
together when the reference count of the FD dropped to zero. When
blocking operations (reading/writing) on the FD were still in progress
this would never happen, though. Now we additionally maintain an open
count and call the close_*() hook when it drops to zero.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11882 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-17 20:25:07 +00:00
Axel Dörfler
a36a94da37 Added the missing clear_caches() function and syscall. Does not yet do anything (which
is perfectly okay on x86 anyway, but should be moved into the arch stuff).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11869 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-17 17:06:56 +00:00
Axel Dörfler
6d1ec1085b Implemented advisory file locking, POSIX style (ie. accessible via fcntl()).
Should work correctly, although there is a big race condition left when you're
using F_SETLKW. Will be fixed next.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11868 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-17 13:18:29 +00:00
Axel Dörfler
a4a54fa8ad read/write() return type was still wrong (ssize_t instead of status_t).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11753 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-15 05:09:56 +00:00
Axel Dörfler
9191c9ddc8 Enabled read-only -> read/write direction for set_area_protection() for the
simple cases - it might not work properly though, since we don't know yet if
a cache has children; therefore it will print out a warning as a constant
reminder if used in that way. It will still not work if we would need to
insert a new cache inbetween (in case the cache has children or only read-only
areas (even if there is no way yet to specify how exactly the VM should behave
in this case yet).
Added a comment to vm_map_file() about what we still need to do there.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11751 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-15 02:35:32 +00:00
Axel Dörfler
4e08f1474d Fixed the get_vnode()/new_vnode() race condition by introducing a new
function publish_vnode(). When calling new_vnode(), the node is only
reserved, but not yet accessible for others. Only when you call
publish_vnode(), it will become available. That simplifies new node
handling/locking considerably.
Note, you don't have to call new_vnode() before publish_vnode(); ie.
publish_vnode() acts exactly like new_vnode() did before if used that
way.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11719 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-14 01:15:31 +00:00
Ingo Weinhold
b24684af25 There are now two different callbacks for break- and watchpoints.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11715 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-13 23:58:36 +00:00
Ingo Weinhold
823f4c5bf4 * Various modifications needed due to the changes in <debugger.h>.
* user_debug_break_or_watchpoint_hit() into separate functions for
  break- and watchpoints. The one for breakpoints gets another parameter
  which indicates whether the breakpoint was a soft- or hardware
  breakpoint. This info is also sent to the debugger.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11714 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-13 23:57:34 +00:00
Ingo Weinhold
d00bf1778d * user_debug_fault_occurred() -> user_debug_exception_occurred().
* No longer kill the time when a page fault occurs, but rather send a
  SIGSEGV.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11705 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-12 21:47:21 +00:00
Ingo Weinhold
20b656f066 * Check the thread debug signal ignore masks before notifying the debugger
of a signal.
* Added sigaction_etc(). It's just a sigaction() for which the thread
  in question can be specified.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11704 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-12 21:45:49 +00:00
Ingo Weinhold
293a59b0e9 * The debug_thread_info records now, which signals the debugger wishes
not to be notified.
* Added debugger commands for setting/getting of thread signal ignore
  masks and signal handlers.
* Renamed user_debug_fault_occurred() to a more correct
  user_debug_exception_occurred(). It no longer sends a `stopped' message,
  but the new one dedicated to exceptions. Additionally the number of the
  signal is supplied that will be sent, when the thread continues (without
  indicating to ignore the event).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11703 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-12 21:43:35 +00:00
Ingo Weinhold
0b5637ed3a Argh! This change should have been checked in two days ago!
* Added support for debugger handover. The current debugger need to send
  a B_DEBUG_MESSAGE_HANDED_OVER message. The rest is completely
  transparent to the new debugger. It simply calls install_team_debugger().
* Implemented _user_wait_for_debugger().
* Reworked a few bits to ensure that after a remove_team_debugger() or
  after requesting a debugger handover the debugger doesn't get any more
  messages.
* When the debugger is removed or dies, the debugged threads should now
  cleanup their debug info and continue, instead of waiting at their
  debug port forever.
All the new features are not tested. Will happen, when gdb will be
debugged.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11697 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-12 15:22:28 +00:00
Ingo Weinhold
4d5289b7f0 load_team_etc() now optionally waits for the new team to be loaded
(new `flags' parameter, flag B_WAIT_TILL_LOADED). This is the default
behaviour for load_image(), so it behaves like R5's implementation now,
i.e. errors while loading are reported to the caller.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11696 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-12 15:13:51 +00:00
Ingo Weinhold
0e83032441 * Added _user_image_relocated() and _user_loading_app_failed().
* We no longer notify the debugger about a new image when it is registered,
  but when it has been relocated.
* When the application image has been relocated, we notify the one who
  initiated its loading.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11694 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-12 15:09:09 +00:00
Axel Dörfler
983d4534bc get_team_info() now also fill in the info about the debug nub thread.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11674 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-10 23:19:25 +00:00
Axel Dörfler
14ddef038a Removed setenv()/getenv() syscalls - they are no longer needed.
Also removed team::user_env_base: environment variables are now changed on the app's heap.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11672 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-10 23:06:51 +00:00
Ingo Weinhold
836d23b08e * Added empty _user_wait_for_debugger() implementation.
* Added some musings about what is missing, when a debugger is removed and
  how _user_wait_for_debugger() shall be supported.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11636 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-09 22:49:13 +00:00
Ingo Weinhold
2562e5185c Command B_DEBUG_MESSAGE_GET_WHY_STOPPED supports a reply port now.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11633 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-09 22:05:43 +00:00
Axel Dörfler
3820698290 Renamed threadIDEnd to lastThreadID as I think it's clearer.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11630 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-09 02:05:18 +00:00
Axel Dörfler
4eadd9005b Made sure that B_SYSTEM_TEAM is never used as a thread ID - the previous code didn't
look correct and was a bit expensive.
Some cleanups.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11629 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-09 01:59:44 +00:00
Axel Dörfler
3db7e2cf8b Some cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11628 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-09 01:43:56 +00:00
Ingo Weinhold
bd5d59c4cc Support partial reads from memory.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11625 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-08 23:10:55 +00:00
Ingo Weinhold
fe99e18c3c spawn_kernel_thread_etc() has one more argument now.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11623 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-08 18:18:55 +00:00
Ingo Weinhold
6c2560b50e team_ids are now aligned with the team main thread IDs.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11622 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-08 18:18:10 +00:00
Ingo Weinhold
5939c4d7a9 Added functions allocate_thread_id() and peek_next_thread_id() and a
threadID parameter to spawn_kernel_thread_etc(). It's now possible to
set the ID of a new thread. Used in team.c to make team ID and the ID of
the main thread equal.

Fascinatingly the two added functions prompt my compiler to issue
`missing prototype' warnings, although those are obviously there. It would
be nice if someone could solve that riddle.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11621 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-08 18:16:16 +00:00
Ingo Weinhold
a8e00c29fe Add the newly introduced src/build/cpp_support.cpp to the sources when building under Linux.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11606 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-06 16:51:58 +00:00
Axel Dörfler
0cbd4edc72 Fixed warning in the real time stuff. Added empty user debugger functions
to keep things building.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11554 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-03 06:04:59 +00:00
Axel Dörfler
1f6dcd134f write_cached_block() would write the wrong block in case there was
a previous and unfinished transaction. It should now work correctly.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11553 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-03 01:10:16 +00:00
Ingo Weinhold
121f7fb374 Allow setting a couple of EFLAGS bits.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11534 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-02 14:53:11 +00:00
Ingo Weinhold
59ad83d0d9 Don't allow changing the segment registers.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11531 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-02 11:52:53 +00:00