Commit Graph

4547 Commits

Author SHA1 Message Date
Ingo Weinhold 0dc4d1e5ca Reverted r27685, r27676, r27665, and r27664, the changes related to
letting the boot loader provide full paths for the pre-loaded images.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27753 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-27 00:28:10 +00:00
Ingo Weinhold 6075e354ab * Call module_init_post_boot_device() right after the boot volume has
been mounted, before anyone could try to load any modules from it.
  Also pass it a flag whether the boot volume is where the boot loader
  pre-loaded the modules from.
* module_init_post_boot_device() changes the pre-loaded module image
  paths to normalized boot volume paths, now. Got rid of the code in
  register_preloaded_module_image() which tried something like this.
* Changed module image ref counting. A referenced module has single
  reference to its image, which is released when the module becomes
  unreferenced.
* get_module() for a reference module will not try to re-get and re-set
  the module's image anymore. That could lead to a similar module (from
  different paths) being loaded at the same time. A module from a new
  file can only be loaded when the old one has been put completely.
* Simplified B_KEEP_ALIVE module handling a bit. When the module is
  initialized, we add another reference, which we'll never free. Thus
  the module remains loaded without special handling. Removed
  module_image::keep_loaded. A B_KEEP_ALIVE module remains referenced
  and thus its image remains referenced, too.
* Removed module::file, a cached path to the module's image. An
  optimization that wouldn't work with multiple root directories for
  modules (/boot/beos/..., /boot/common/...) or when module files were
  moved. get_module() does now always search the image file, when the
  module is still unreferenced. This should be a bit slower than before,
  but I didn't notice any difference in VMware at least. If it turns out
  to be a problem we could introduce a more intelligent cache that stays
  up to date by using node monitoring.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27752 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-26 23:59:53 +00:00
Ingo Weinhold e8d3eff968 * vfs_normalize_path() and _user_normalize_path() use a common helper
function (normalize_path()), now. There was some code duplication
  before.
* Added "bool traverseLink" parameter to vfs_normalize_path(). When
  true and the leaf component is a symlink, it will be resolved.
* KPath:
  - Added similar leaf link traversal parameter to SetTo() and
    SetPath().
  - Added Normalize().
  - Added DetachBuffer(), which returns the object's current buffer and
    unsets itself.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27751 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-26 23:30:28 +00:00
Ingo Weinhold c3c841e223 Added <asm_defs.h> as a build header.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27747 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-26 13:35:20 +00:00
Ingo Weinhold 8a85be4636 Register the commpage as an image and its entries as symbols.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27722 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-24 14:41:42 +00:00
Ingo Weinhold fec47a5702 Added functions elf_create_memory_image() and
elf_add_memory_image_symbol(). The former creates and registers a new
image that has not been loaded from a file. The latter adds a symbol to
its symbol table. This is mainly a debug feature, allowing to name code
or data in memory regions that aren't associated with loaded ELF
objects.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27721 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-24 14:40:24 +00:00
Ingo Weinhold 4069a00744 Header containing macro definitions used in various assembly sources.
I'm not happy with the location, but I didn't see any better one in the
header tree.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27717 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-23 22:46:07 +00:00
Ingo Weinhold 5181b35bee Introduced a separate flag for indicating that disable_debugger() had
been called for a team, and fail installing the default debugger if it
is set. This makes disable_debugger() actually work. Fixes bug #2763.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27713 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-23 20:17:58 +00:00
Ingo Weinhold 0135e2e324 * Increased the maximum profiling caller stack depth significantly.
* Extended the profiling API by an option to record a variable number of
  samples per tick. The stack depth is used as a maximum.
* Added new option "-f" to the "profile" tool. When specified it
  increments the hit counts of all symbols in the full available caller
  stack. I.e. the resulting hit counts will approximate the total time
  spent in each function or any function directly or indirectly called
  by it. Thus "_start" and "main" will usually get 100% and leaf
  functions only what time has actually been spent in them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27699 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-23 01:08:27 +00:00
Ingo Weinhold 114c07e6e2 Overdue copyright update.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27698 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-22 23:17:48 +00:00
Ingo Weinhold ab30ce0e84 * Removed obsolete B_DEBUG_MAX_PROFILE_FUNCTIONS.
* Relaxed the stack depth and profiling interval limits a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27697 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-22 23:03:25 +00:00
Axel Dörfler 4a47b14ea4 * Enlarged a single kernel_args chunk to 32 KB (was 16 KB).
* Reduced the kernel_args array size from 32 to 16 (7 are used on a normal
  build).
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27690 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-22 15:36:46 +00:00
Ingo Weinhold 65a9d40a9d * Added hash_dump_table() function, dumping the whole table.
* Fixed hash_remove_current(): It didn't update "lastElement" and thus
  always also removed all elements in the same bucket preceding the one
  to be removed. Also got rid of the useless "for" loop.
  Fixes #2757.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27689 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-22 14:58:40 +00:00
Ingo Weinhold 8839d592bc Added syscall _kern_read_kernel_image_symbols() for reading a kernel
image's symbol and string tables.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27687 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-22 11:13:38 +00:00
Rene Gollent 90b7764dc3 Move WidthBuffer and TextGapBuffer into BPrivate and use them from there in BPoseView and BTextView. This (correctly) fixes the previous gcc4 build issues.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27675 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-21 20:47:16 +00:00
Rene Gollent 40ca6c57ee Declare BPoseView as a friend of BTextView. This allows it to use the private width buffer classes, and fixes the gcc4 build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27673 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-21 18:03:17 +00:00
Stephan Aßmus 8864334702 * First steps towards making BTextView behave well within the layout management.
* The class calculates a minimum width now, which is based on the line height,
  this may also fix the bug with the small text inputs in the Pe Find window.
* Added TODOs about implementing GetHeightForWidth(), which may be a good idea
  when a BTextView is used as non-editable informative text in an interface,
  and one wants to make sure that the entire text is shown.
* Replaced the call to _Refresh() in Draw(), which recalculates all the line
  breaks for no reason with _DrawLines() again. The TODO mentioned that text
  will be drawn without drawing the background first, but maybe this is a
  relict from times where Draw() was invoked directly? At least I cannot see
  any negative consequences, and this should be much more efficient.
  (Other than that, this patch should hopefully have no potential negative
  side effects...<crosses fingers>)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27670 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-21 15:36:44 +00:00
Ingo Weinhold 6aa2c9ecf1 * Directory stores its parent directory (if any), now.
* Adjusted used files systems accordingly.
* BFS::Stream::GetName() was broken. It accessed the small data region
  which wasn't loaded, since BFS::Stream derived from bfs_inode, which
  is a variably-sized structure with the small data region at the end.
  Changed that to a ref-counted, shared member instead.
* Implemented RootFileSystem::GetName().
* Added Directory::GetPath() to get a full path of the directory or an
  entry.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27664 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-21 12:55:41 +00:00
Stephan Aßmus e6378518c4 Fixed typo.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27662 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-21 09:15:35 +00:00
Stephan Aßmus 6168332c35 Sorry, should have been part of r27660. Moved BTextView::UndoBuffer derivatives
into BTextView class as well, hopefully fixing the GCC4 build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27661 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-21 08:43:06 +00:00
Ingo Weinhold ecfad924e0 Solution for the potential deadlock when needing to flush the profiling
buffer during a timer event that interrupted a kernel function: We do
now flush the buffer as soon as it is 70% full, *if* we didn't interrupt
a kernel function. When the buffer runs full and we still haven't hit a
user function, we drop the tick. The number of dropped ticks is recorded
and sent to the debugger with the next update message.
Reverted the previous partial solution (the temporary disabling of
profiling while in debugger support code).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27658 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-20 22:04:03 +00:00
Ingo Weinhold eba9a4c3ee * Introduced a per-team counter that is incremented whenever an image
is created or deleted (or exec*() has been invoked). The counter is
  sent with several debugger messages.
* Track the image event counter that is used when samples are added to
  the profiling buffer. If the current team counter differs, we flush
  the buffer first (sending an update message to the debugger), so that
  the debugger has a chance to match the addresses to the correct images.
* Disable profiling for a thread while it runs in the debugger support
  code. This fixes potential deadlocks which could occur when a
  profiling timer event occurred that would require the buffer to be
  flushed while the thread was just sending something to the debugger or
  waiting for a command. As it turns out, this is not sufficient either,
  since we should never try to flush the buffer when the timer event
  occurred in the kernel, since the thread might hold a lock that the
  debugger thread could try to acquire. Will implement a more general
  solution later.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27656 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-20 20:37:10 +00:00
Stephan Aßmus a682d9819f Quite a cleanup action to avoid polluting the global namespace with private
BTextView classes:

* Declared the directly used BTextView helper classes as private BTextView
  classes and changed all affected files.
* Realized that Tracker's BPoseView was (accidentally?) using what used to
  be _BWidthBuffer_. It had declared it's own class with the same name and
  same members/size in headers/private/tracker/TextViewSupport.h, but the
  implementation was nowhere to be found. I can only explain this that
  the BTextView implementation was then actually linked and used. But the big
  problem was that it was used without locking (unlike in BTextView)! When
  many Tracker windows opened during system startup or later and they happened
  to each request characters not yet in the cache, I imagine things could have
  gone bad and corrupted memory. Anyways, since I can see the usefulness of
  the cache, BPoseView uses BTextView::WidthBuffer on purpose now. And I moved
  the locking inside BTextView::WidthBuffer::StringWidth().
* Adjusted InterfaceDefs.cpp accordingly.
* TODO: Move subsequent classes into BTextView namespace as well, ie derived
  classes that BTextView doesn't directly know about. All stuff in src/kits/
   inteface/textview_support/
* Added preliminary and not yet implemented layout friendly BTextView
  constructors.
* I will try to handle the insets imposed by BTextView::fTextRect a bit
  differently when used inside the new layout management framework. For this,
  I added BTextView::SetInsets() and GetInsets(). SetInsets() doesn't do
  anything yet.

So far, everything seems to work still... ;-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27654 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-20 15:08:40 +00:00
Ingo Weinhold 4ed8088f9a Added new debugger message B_DEBUGGER_MESSAGE_TEAM_EXEC, sent when
exec*() has been called.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27650 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-20 13:59:41 +00:00
Ingo Weinhold 78b13af677 The handling of a full profiling buffer couldn't work for two reasons:
* We can't enable interrupts in an interrupt handler. Instead we use the
  newly introduced callback feature, which notifies the debugger right
  before returning from the interrupt.
* We didn't indicate that the profiling buffer was full and that the
  thread shouldn't be profiled ATM. Therefore it could happen that it
  was profiled while trying to notify the debugger that the profiling
  buffer was full, resulting in a deadlock. Introduce a respective flag
  in the thread debug structure.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27649 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-20 12:44:41 +00:00
Ingo Weinhold 23884ae025 Introduced a callback field in the thread structure. It can be set in an
interrupt handler and will be executed right before returning from the
interrupt.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27648 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-20 12:38:27 +00:00
Stephan Aßmus 37b9874302 Update header indentation style.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27643 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-20 10:09:32 +00:00
Ingo Weinhold 424f833bc9 * Changed the profiling API: Instead of sending all functions that shall
be tracked to the kernel, which then counts the hits, an area is
  passed to kernel in which the hits are recorded. When the area is
  full, the debugger is notified. For some reason that part doesn't work
  yet -- the whole system freezes when waiting for a reply.
* Reorganized the profile tool code a bit. For one with respect to the
  changed API, but also to prepare tracking of image creation/deletion.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27640 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-20 00:34:03 +00:00
Axel Dörfler 491da20dbf * Added a is_timer_running() function.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27631 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-19 09:11:12 +00:00
Axel Dörfler 8f3c0d9fcc * wait_for_timer() now returns a status code.
* wait_for_timer() now detects if it has been called from within the timer
  execution thread, and will return in error instead of waiting for itself
  forever. This fixes bug #2682.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27620 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-18 12:45:43 +00:00
Axel Dörfler ca7cb625b9 * Implemented a (private for now) get_system_info_etc() call, that can retrieve
various system information.
* Implemented retrieving some VM stats via this call.
* The VM now maintains a page fault counter, and sets system_info::page_faults
  accordingly.
* Added a (pretty simple) "vmstat" command line app.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27597 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-17 16:27:17 +00:00
Stefano Ceccherini 6dcce65687 port the changes made to the libbe counterpart (r27297 and r27485)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27594 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-17 09:15:48 +00:00
Jérôme Duval bacba30b6f white space cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27590 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-16 21:31:47 +00:00
Stephan Aßmus 43f8c6143a * Updated the coding style.
* The layout friendly constructors don't need to mess with the control size.
* The layout friendly constructors can use the respective BControl constructor.
* Refactored some duplicated code.
* Removed duplicated GetFontHeight() calls.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27585 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-16 15:08:02 +00:00
Stephan Aßmus 349c911ee9 * Implemented a lot of layout related methods and resolved a few TODOs by
doing a lot of these things the same way as BMenuField are already doing.
  Perhaps a private helper class could be refactored from these two controls
  to avoid duplicating a lot of this code, although there are a few subtle
  differences here and there.

These changes make a BTextControl behave properly in the layout management
frame work, in case CreateLabelLayoutItem() and CreateTextViewLayoutItem()
are _not_ used to layout the BTextControl.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27584 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-16 10:50:31 +00:00
Stephan Aßmus 08edea662b * Don't set an explicit max size, instead calculate a proper max size in
MaxSize(). This makes sure that MaxSize() returns a proper size when the
  user "unsets" the explicite max size.
* minimum label height is 0 if there is no label.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27583 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-16 10:45:27 +00:00
Stephan Aßmus 93ba577c3e * Updated header indentation
* Removed unused fClean member
* Got rid of fSkipSetFlags member by simply calling the BView::SetFlags()
  directly where fSkipSetFlags was supposed to prevent the custom
  implementation.
* Added some debugging facilities.
* Used the layout friendly constructors of BControl where appropriate.
* Used B_FOLLOW_ALL for the child text input, it should be more correct.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27576 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-15 19:43:18 +00:00
Ingo Weinhold 127f6d39ef Decreased minimum profiling sampling interval to 100 us. At least in
VMware this doesn't produce very good results though. In my tests I only
got twice as many hits as with 1 ms, although it should be roughly ten
times as many. Might work better on real hardware.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27572 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-15 15:02:40 +00:00
Ingo Weinhold cbcebd3330 * Extended the debugger API by sampling-based profiling support. This is
still pretty much work in progress.
* Introduced init_thread_debug_info() which is used instead of
  clear_thread_debug_info() when the thread is created. The latter
  requires former initialization.
* user_debug_thread_deleted() is now already invoked in thread_exit(),
  not in the undertaker.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27531 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-15 13:36:31 +00:00
Ingo Weinhold e670fc6f63 Added new parameter "skipIframes" to arch_debug_get_stack_trace(). That
many iframes are supposed to be skipped before recording the stack
trace. Currently implemented for x86 only.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27529 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-15 13:09:14 +00:00
Ingo Weinhold b4ec7b8ee5 Added (kernel private) B_PEEK_PORT_MESSAGE flag for read_port_etc().
When specified, the message is read but not removed from the port.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27527 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-15 12:59:49 +00:00
Ingo Weinhold 68e6763b07 Added functionality for iterating through the symbols of a debugged
team's image to libdebug.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27526 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-15 12:47:59 +00:00
Stephan Aßmus 14f6345690 Several fixes to BMenuField layout calculations.
* The most important fix is that in BMenuField::_ValidateLayoutData(),
  divider was calculated, but then never used. If the menu field was not
  using the layout management, it should take the existing fDivider into
  account, but never did. This caused #2728.
* Added some tracing that helped me debug this.
* Fixed a bunch of layouting inconsistencies. It will also improve some
  unnecessary resizing of the menu bar.

Will test all of this some more. But in the test app I do have, the BMenuField
works more like in BeOS now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27508 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-14 19:01:54 +00:00
Stephan Aßmus 0ce571055a This class helps me with tracing function enter/leave output. It is passed
a static integer that it uses for indentation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27506 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-14 18:46:26 +00:00
Stephan Aßmus 21bb6bd22b * Update header indentation.
* Added BScrollBar::SetOrientation().
* Improved _DrawArrowButton() to have a good visual result even when the
  scroll bar does not have the standard width or height.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27494 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 19:20:18 +00:00
Fredrik Modeen 2d9f1f59b3 fixes pointed by Axel and some stile changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27464 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 18:29:30 +00:00
Jérôme Duval 53e8a878e6 isnan and isfinite are macros
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27424 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-11 22:45:17 +00:00
Jérôme Duval 645fa87a21 added lsearch and lfind
remove unknown infnanf and strtcopy functions


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27423 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-11 22:27:55 +00:00
Salvatore Benedetto 40dae3708f * Adding msg{rcv,snd,get,ctl} syscalls to the system
* Add message queue init function call to main.cpp


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27417 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-11 15:03:01 +00:00
Salvatore Benedetto f22e1421a4 * Adding sys/msg.h header and relative syscalls
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27416 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-11 14:52:35 +00:00