Commit Graph

2242 Commits

Author SHA1 Message Date
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
08f3210dcf Added empty implementations of tc{get,set}pgrp().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11615 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-07 22:07:26 +00:00
Ingo Weinhold
5141596a69 Added ffs().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11614 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-07 22:02:50 +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
Ingo Weinhold
8b737816c4 Added KERNEL_C++_SUPPORT_LIBS to the libs the kernel links against. Required under Linux.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11605 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-06 16:50:24 +00:00
Axel Dörfler
6f5d035e3a Temporarily fixed the build by commenting the two new files. They need
non-POSIX functions that we have disabled from the build. Not sure if
we really want to change that (ie making those functions public).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11579 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-05 14:13:55 +00:00
Jérôme Duval
f95d0b421a added a setpgrp impl
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11574 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-04 13:56:49 +00:00
Jérôme Duval
a15b332e3b added an implementation for strptime from FreeBSD (1.35, 1.25, 1.11)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11560 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-03 15:51:05 +00:00
Axel Dörfler
cc8aae32ee We're using now Ingo's new doubly linked list implementation.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11557 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-03 06:15:16 +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
Jérôme Duval
d4fe9d12d0 added missing posix error messages
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11537 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-02 16:46:24 +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
Ingo Weinhold
5d2536d2af * Added functions for clearing/destroying the arch-specific thread debug
info.
* Implemented arch_set_cpu_state() (Axel, please check, what registers
  the debugger should actually be allowed to modify).
* Fixed arch_get_cpu_state(). We now explicitly copy the registers
  manually instead of using memcpy(). Added support for extended
  registers (FPU,...).
* Completed break- and watchpoint support.
* Implemented handling of debug and breakpoint exceptions.

The x86 specific part of the userland debugging support should be complete
now. That is in theory the entire debugging interface is available on x86
machines now. It's almost completely untested yet, though.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11526 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-02 00:14:38 +00:00
Ingo Weinhold
edd0aaeaee * Stop user debugging when entering the kernel and init it when leaving
it.
* Handle debug and breakpoint exceptions.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11524 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-01 23:59:23 +00:00
Ingo Weinhold
98b14f8a6a * Made i386_get_current_iframe() static again, since it wasn't what was
needed to get the topmost user iframe. Added i386_get_user_iframe() for
  exactly that purpose.
* Added reinitialization of user debugging for the new thread when
  switching the context.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11523 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-01 23:56:52 +00:00
Ingo Weinhold
c8d7534e5d * Made C++ save.
* Made the parameter for restoring the FPU state const.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11522 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-01 23:52:09 +00:00
Ingo Weinhold
ae7c619aae * Added architecture specific structure to thread_debug_info.
* Added event callbacks for break- and watchpoints and single stepping.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11520 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-01 23:47:59 +00:00
François Revol
b1bfc5c69f if you want to return something at least be consistent with the version of usleep which returns an int... (return -1 and set errno)
see http://www.die.net/doc/linux/man/man3/usleep.3.html


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11510 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-28 11:41:39 +00:00
Ingo Weinhold
feeee8dff5 Added function for setting the CPU state (not implemented yet) and
functions for setting break-/watchpoints (implemented).
Break-/watchpoints don't work yet, though. Missing is still the setting
of the debug control register DR7 somewhere in the interrupt code and
the handling of debug exceptions.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11509 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-28 00:48:31 +00:00
Ingo Weinhold
336b15cf0f Added musings about where to deal with debug registers.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11506 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-28 00:42:01 +00:00
Ingo Weinhold
d906f5fc4b * Atomic access to team debug flags.
* thread_exit_args::teamID -> original_team_id.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11505 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-28 00:39:51 +00:00
Ingo Weinhold
9707863cc9 * Changes due to new team debug info locking strategy.
* In team_delete_team() we no longer explicitly destroy the team debug
  info. It is not necessary, since the terminating debug nub thread will
  do that anyway. Moreover we access the debugger port in a safer manner
  now.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11504 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-28 00:37:16 +00:00
Ingo Weinhold
a7ad39fe09 * New locking strategy for the team debug info. It's no longer protected
by the team lock, but by a lock in the structure. This is necessary
  since we can't acquire the team lock while thread switching, for then the
  thread lock is already held.
* Added support for single stepping and break-/watchpoints.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11503 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-28 00:34:06 +00:00
Ingo Weinhold
bd3b16ee7b Fixed warning.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11501 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-28 00:21:59 +00:00
Axel Dörfler
a2634a4246 Actually, ports do support both, B_RELATIVE_TIMEOUT and B_ABSOLUTE_TIMEOUT -
thanks to Ingo for the hint.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11500 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-27 16:18:07 +00:00
Ingo Weinhold
6d3794c0a1 * Correctly set debug_origin::nub_port in all concerned functions.
* Now a debugged thread and the debug nub thread are not longer blocking
  on ports when they receive a SIGKILL[THR] (we couldn't kill a debugged
  team before).
* Small fixes. More correct cleanup when the debug nub thread terminates.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11491 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-25 14:30:16 +00:00
Ingo Weinhold
3b28d367cb Implemented get_why_stopped_string().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11490 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-25 14:25:10 +00:00
Ingo Weinhold
f75dc555fd * handle_signals(): If a SIGKILL[THR] is pending, ignore other signal.
* Added is_kill_signal_pending(). Can anyone tell me why the compiler
  complains about a missing previous prototype for it? <ksignal.h> is
  included, and when only preprocessing the file, the prototype is clearly
  there. I'm clueless.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11488 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-25 14:20:47 +00:00
Ingo Weinhold
8c37e2348e Added support for new flag B_KILL_CAN_INTERRUPT. (Do ports really not support absolute timeouts?)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11486 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-25 14:13:00 +00:00
Ingo Weinhold
013d79a1b9 Added support for new flag B_KILL_CAN_INTERRUPT.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11485 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-25 14:11:52 +00:00
Ingo Weinhold
433e1959ae Introduced a debug_origin structure consisting of thread and team ID of the concerned thread, and being first member of all messages sent to the debugger. This simplifies handling of messages in the debugger a good deal.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11482 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-24 18:47:04 +00:00
Ingo Weinhold
013765b30a Added ToDo regarding the handling of search paths like PATH.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11481 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-24 16:34:00 +00:00
Ingo Weinhold
71a2d54820 In case of a page fault we now notify the debugger.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11479 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-24 16:30:17 +00:00
Ingo Weinhold
260ba6fdd3 * Dealt with two debugging related ToDos:
- If the thread's B_THREAD_DEBUG_STOP flag is set, it is now always
    stopped before handling the signals. Unless a SIGKILL[THR] signal is
    pending.
  - Also notify the debugger, when a signal is ignored.
* The signal's sigaction structure is additionally passed to the debugger
  now.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11478 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-24 16:28:45 +00:00
Ingo Weinhold
9c448e2414 * Added debugger notifications for thread creation/deletion events.
* Now we deal correctly with thread debug flags (child threads inherit
  the parent ones, save for syscall tracing in which case it needs to
  be specified explicitly).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11477 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-24 16:14:18 +00:00
Ingo Weinhold
2ee487c82a Added debugger notifications for team creation/deletion events.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11476 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-24 16:11:25 +00:00
Ingo Weinhold
43ad09219b Added debugger notifications when images are registered/unregistered.
In the first case this is probably too early, since the image is not
really loaded at that time by the loader. We should probably introduce
a syscall the loader can invoke for that purpose.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11475 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-24 16:10:24 +00:00
Ingo Weinhold
e988d66022 * Added B_TEAM_DEBUG_DEFAULT_FLAGS and B_THREAD_DEBUG_DEFAULT_FLAGS for
convenience.
* Added/implemented callbacks for almost all missing debug events (team,
  thread, image creation/deletion, exceptions/faults, signals).
* The debugger can now specify how to deal with the event that stopped an
  event (ignore or handle signals, exceptions/faults).
* Implemented B_DEBUGGED_THREAD_GET_WHY_STOPPED debugger message.
* The cpu_state is now passed to the debugger with
  B_DEBUGGER_MESSAGE_THREAD_STOPPED notifications.
* Completed _user_debugger() implementation.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11474 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-24 16:07:19 +00:00
Ingo Weinhold
05916979f9 Export i386_get_current_iframe() so it can be used in arch_user_debugger.cpp.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11472 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-24 15:49:41 +00:00
Ingo Weinhold
08fd6d69aa Beginning of the x86 debugging support.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11470 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-24 15:46:20 +00:00
Jérôme Duval
abd010bc61 Moved mbstate to wchar.h
Restored glibc/wcsmbs/wchar.h


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11451 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-22 18:06:35 +00:00
Jérôme Duval
834f7878aa FindString is better than FindData (thanks axeld)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11412 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-18 17:27:34 +00:00
Jérôme Duval
997aa9ac18 error handling
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11410 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-18 11:05:33 +00:00
Axel Dörfler
db5fbf2a6b Fixed a possible crashing bug in case of a corrupt inode: the vnode was
removed twice from its mount's list.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11409 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-18 03:57:08 +00:00
Jérôme Duval
76fa831165 fixes sscanf for decimal values, enables keymap to actually load source keymaps
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11407 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-17 16:57:12 +00:00
Axel Dörfler
4b72e95292 getcwd() is actually implemented like elsewhere, and not strictly after
POSIX demands: if you pass in a NULL pointer, a buffer will now be
allocated for you.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11388 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-16 03:51:34 +00:00
Axel Dörfler
86e404324f Fixed the build of the boot floppy and removed all input_server headers
when USE_INPUT_SERVER is not defined.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11387 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-16 03:22:12 +00:00