* Fixes#4698 - font preference changes were not applied
on the next message;
* The source of problem is resetting of the text run array after
applying new font with SetFontAndColor function. Proposed solution
updates the text run array items fonts directly without resetting
it them and without loosing any styling and color quiting
information;
* This is result of completing GCI 2011 task.
Signed-off-by: Siarzhuk Zharski <zharik@gmx.li>
* Glibc declares and uses its own version of mbstate_t, which is
incompatibly with our own. Mix our own fields into glibc's
mbstate_t, such that the two structs are compatible.
* Record external clock frequency (aka, DP non-pll)
* Add function to control DIG transmitter
* Cleanup duplicated is external code in encoder mode set
- Architecture::CreateStackTrace() now uses the last frame's
PreviousCpuState() as the basis to continue unwinding when passed
a partial trace to continue from, rather than the (incorrect) actual
cpu state of that frame, which would have resulted in the last frame
being duplicated in the trace.
- Renamed variables to be more clear.
Used to store the unwound state of the CPU from this frame,
which will form the actual state of the following frame. Needed
in order to properly support continuation of unwinding from a
partial stack trace.
* Add color space to BPP function
* Pass display_mode to DP lane count function
* Get BPP in DP lane count
* Move some DPInfo population out of DP link training
as other things need them sooner.
* Fill out DP code in external encoder setup
* Support for bitmap and vector icons added;
* Attribute type representation is improved;
* Fixed problem with current attributes loading;
* sniffer rule checking fixed;
* supress useless lines in -dumpIcons and -dumpSniffRules for MIME types
without icons and sniffer rules correspondently.
Signed-off-by: Siarzhuk Zharski <zharik@gmx.li>
* make room in mbstate_t for containing an ICU-converter's state
(well, in fact the whole converter object)
* adjust libroot's locale add-on to clone converters into a given
mbstate_t directly
* adjust ICUThreadLocalStorageValue to contain the converter pointer
instead of a converter-ID (if the converter is related to an
mbstate_t, it points into the mbstate_t).
* adjust users of converters to directly use converter pointers
instead of ICUConverterRef
* drop now unused ICUConverterManager and ICUConverterRef
* update gcc4 optional package
This brings our multibyte implementation into a fully working state,
both non-ascii and non-8-bit characters can now be handled normally
in the Terminal, i.e. this finally fixes#6276.
N.B.: Since the size of mbstate_t has changed, everything (including
the compiler!) needs to be rebuilt.
- Limit invocations of CreateStackTrace() in ThreadHandler to
only unwind the topmost frame since that's all it actually
cares about anyways. Also adjust Step Over to use this
functionality in order to work with the correct frame addresses,
since the CPU frame pointer register isn't entirely what we want
here.
CreateStackTrace() can now optionally be asked to limit the maximum
number of frames it tries to unwind. In conjunction, it can also be
passed an already existing partial stack trace, and be asked to
unwind more frames from it.
* Lots of new DisplayPort functions
* Call DP link training during mode set
* Rename dp_info variables to be less redundant
* Make encoder_pick_dig accept connector ID and
then check parent display
* Encode/Decode DP link speed functions
* Calculate DP lanes
* Rewrite encoder_dig_setup
* Correct bitsPerChannel to bitsPerColor
* My TRAVIS DisplayPort -> LVDS bridge now works
* I'd rather this be common code, but I don't have access
to the DisplayPort specifications. If I added it as common
code I would want to be 100% it was complete and variables
were named properly.
* For now putting in radeon_hd private headers
When stepping over, check to ensure that we're in the same call
frame that we started in. If not, reinstate the temporary breakpoint
and continue running.
* Move existing displayport functions to new source file
* Move was done due to large amount of DP code
* Style fixes
* Stub out new DP link training function
* Things in drm are a bit tangled, but it looks as though
the backlight controls only need to be called on <= DCE 4
* Add analog dac video device support
* Provide more information on connectors
* Provide more information on detected attributes
* Remove some no longer needed debug output
* Provide connector ID on display debug output
Will be used later in order to determine if a given call obeys the
standard calling convention, in order to determine if we can safely
attempt to retrieve its return value.
* the reference to MB_CUR_MAX requires stdlib.h
* if an conversion error occurs, the returned src pointer must point to
the character that triggered the error
* src was sometimes accessed incorrectly (needs double dereference)
* the source pointers may only be adjusted in case there is the
destination pointer is not NULL
* add gnulib test for wcsrtombs()
* add gnulib tests for mbsnrtowcs() and wcsnrtombs(), both inactive
as the respective functions are not publically available (they are
part of the [CX] extended ISO-C standard which we do not yet support)
* Our mbstate_t just references a corresponding ICU converter, but
does not actually contain its state. So a mere copying of the mbstate
won't duplicate the converter's intrinsic state, which means that
restarting with the copied state won't work.
If have experimented with cloning the converter into the mbstate_t,
but I was unable to get that to work, either. Apparently, the state
of the converter isn't cloned (but just the converter's settings
and data).
* add MultibyteStringToWchar() to ICU locale backend
* implement mbsrtowcs() and mbsnrtowcs() on top of
MultibyteStringToWchar()
* drop respective glibc files
When asked to step out, we now store the frame pointer of the current
stack frame. Upon hitting our temporary breakpoint, we then verify that
the current frame pointer is in fact in the previous frame. If not, we
reinstate the breakpoint and continue running.
Calling SetIcon(NULL) calls MakeEmpty() that tries to delete all
manipulators on fState. So we may only delete fState after that call.
Also reported as CID 10856.
- Add accessor for return type.
- Implement DW_AT_artificial parsing.
- Store the subprogram's template parameters and provide accessors
for them as well. Not used yet but will be handy later if/when we
want to expose the instantiated types somewhere in the user
interface when stepping into such a function.
When forking a team, copy on write areas (and therefore caches) are
created for all the areas in the parent team, but they were always
created as swappable. If the parent team had some B_FULL_LOCK areas,
which aren't swappable, the wrong type of cache would be created which
lead to them not being mergeable later on (causing a panic).
Comments about a possibly cleaner way to figure out the cache type
would be welcome.
* Define a MEMALIGN macro that is either just defined to malloc() or
to the actual memalign() depending on where KMessage is used. We only
use memalign() inside the kernel and libroot.
* Add a comment to the macro explaining that this allows the use of
special heap implementations that might return unaligned buffers for
debugging purposes.
- If multiple nested namespaces were involved in a name,
GetFullyQualifiedDIEName() would erroneously wipe out each one
as it walked up, leaving you with only the top level namespace.
- Don't touch the output parameter unless we're certain we succeeded.
- Use the artificial attribute to more intelligently determine when to omit
parameters. Fixes the first parameter on static class functions being
skipped incorrectly.
- Correctly handle varargs functions.
* Yet more nice way to fix Coverity issues fixed by hrev43460.
Thanks Rene Gollent for pointing it out!
* Potential Coverity issues fixed for sis19x driver too.
The change in hrev43405 wasn't correct, as it put the reference
object definition after the one of the corresponding locker, causing
the reference to be released before the unlock would happen.
Finally fixes#8187. Thanks Ingo for pointing that out.
* The call to _TeamDied() causes the team that the iterator points to
be removed from the map. Therefore the iterator becomes invalid and
may not be accessed anymore (including incrementing it). As we've had
to unlock, anything might have happened to to map, so take the safe
route and just start over.
* For each dead team that was found the AppManager was unlocked, but
there were no balancing lock calls, therefore causing the lock count
to get corrupted.
While this isn't really correct, it works for the use case it is
intended and doesn't open the can of worms we get when trying to do
memalign() across platforms (due to build tools use of KMessage).
* If we cloned the buffer due to misalignment, only free the old buffer
if we actually own it (i.e. if it was allocated by us).
* Set the KMESSAGE_OWNS_BUFFER flag after cloning the buffer. Previously
the buffer was leaked in the clone case.
* If there is an alignment requirement then better use memalign() to
make sure that it is met.
* Since the BMessageAdapter possibly sets a buffer directly, make a
properly aligned copy of the buffer if it happens to be misaligned.
* Not including malloc.h caused the memalign() signature to not be a C
signature, therefore leading to linking errors. Fix the missing
include and explicitly add extern "C" as well.
* Some remaining asterisk style cleanup.
At least as far as I can tell, the template parameters are actually exported
as part of the DIESubprogram name itself, and don't need to be separately
retrieved.
* add DPBridge encoder flag and set during connector detection
* if external bridge found, do external DDC setup
* pass connectorIndex vs displayIndex to encoder_*_setup
* some of the DP AUX channel stuff should go into accelerant
common code some day like i2c.
* remove posix return
* pass GPIO hwLine through vs connector index
* variable scope cleanup
* make lowest level dp aux AtomBIOS call static, non-public
as it is always called by connector code
When retrieving modifiers, we're actually pulling them off the type
in reverse order. Consequently we need to build the type's modifier string
similarly.
If the first modifier is a const, prepend it to type name instead.
The fModes array is realloc'ed as needed when adding modes. Therefore
the fModes pointer handed in to AddModes() becomes invalid once
_MakeSpace() returns in that function causing a freed memory block to
be used as input.
To avoid that we make a copy of the base mode list and then use that to
add the modes for each color space.
The file content isn't normally 0 terminated, so making a string out of
it would usually result in reading beyond the allocated buffer to find
the string length, possibly leading to a crash.
* clean up previously changed error returns in 8c01b4. For
some reason I thought B_ERROR was the only non-positive
status.
* add VESA DisplayPort defines. Only a subset so it's local
to radeon_hd for now.
* this completes basic AUX transaction code, still untested
When asked for a fully qualified DIE name, we now add the parameters
of functions as well. This allows them to show up in, e.g. the function
list view. Still needs some work but basically functional.
In the case of variables that refer to static members of compound types,
the specification will be a reference to a DIEMember rather than a
DIEVariable in DWARF3. Relax our restrictions accordingly.
It turns out,this is an old method added by Be, and is not really related to BView::InvalidateLayout(bool). In fact BMenu::InvalidateLayout() does something separate, but related to the BView method. I was wrong to delete this method, since it needs to have action taken each time it is called, so moving these actions into LayoutInvalidated() only worked sometimes (when the BView was considered to have a valid layout).
I have added a comment for future hackers so that they don't delete this method.
* this will help break apart some of the sources
* display bus communications really don't belong with GPU operations
* rename functions to better describe their actions
- Add accesor to CompoundType to expose the particular compound kind.
- Implement aforementioned accessor in DwarfCompoundType, and ensure
DwarfTypeFactory populates it appropriately.
- Modify GlobalTypeLookup to make use of the address and compound
subtype kinds when trying to match a type.
Due to the lack of matching against the subtype, we would previously wind
up matching anonymous compound types against those of their parents, resulting
in the wrong type getting assigned to their value nodes.
Fixes#8190.
The operator const char*() automatically converts to the needed type
so the explicit BString::String() call isn't needed here. Thanks to
Clemens for pointing that out.
The previous solution had various issues where argv pointed to stack-based
objects that had potentially been destroyed/overwritten already. Fixes
#8173.
- Modify _SetupGDBArguments() to return an error code and check for it
accordingly.
The guarded heap uses mprotect() to protect freed/unallocated pages so
that any access to such a page results in a segfault. It also installs
a segfault handler that in such an event prints some info about the
accessed page and then calls the debugger with a meaningful message.
It implements the same interface as the debug heap so it can simply be
swapped out by changing the Jamfile. As it doesn't support most of the
extra debug features (wall checking is obviously superfluous, but it
also doesn't help in leak checking) and as it is hugely space
inefficient I left it disabled for now.
The BString is destroyed when the function returns and takes the
storage pointed to by BString::String() with it, so returning such a
pointer is bogus. Instead the return type is now a BString which takes
over ownership of the string.
* This tool was created and implemented in draft during GCI 2011
by Aleksas Pantechovskis, <alexp.frl@gmail.com>;
* Later it was heavily refactored and optimized to Haiku Coding
Standards by Siarzhuk Zharski;
* Icons support still missing;
* Thank you for the contribution, Aleksas!
Signed-off-by: Siarzhuk Zharski <zharik@gmx.li>
* We may get non-terminated strings so we need to use the
UTF8NextCharLen() version that works with a length. Previously we may
have read beyond buffers, possibly leading to crashes.
* Also the length parameter is used as an actual length and not as
buffer size. The length check was wrong before, which resulted in the
function returning too early if an offset was supplied.
* Added a comment about the guaranteed 0 termination in one case.
* Minor cleanup.
The string that is built for hashing the escapements for missing
chars was not 0 terminated, leading to accesses past the string.
Depending on what followed an allocation that could lead to too long
strings being sent to the app_server for evaluation (where, due to
defensive, programming nothing bad would actually happen). In the
unfortunate case that nothing followed the allocation (i.e. end of
heap area), it could also lead to an application crash.
Therefore ensure 0 termination of the string, check for allocation
failure and use memcpy() instead of a for loop to copy the bytes from
one string to the other.
When setting memory protection, only ensure/wait for the range that
needs to be protected to not be wired instead of requiering the whole
area to be non-wired. The memory protection is done page wise and
having some parts of the area wired shouldn't preclude other parts to
be protected.
* Avoid needless adding of the death entry if the sem is gone already.
* Delete objects as soon as they aren't needed anymore and return
early where possible.
* Contain the thread == NULL case in its block and return from there as
well instead of non-obviously figuring out what happened later.
* Pull out the return code asignment.
* Minor cleanup.
While it was detected that the thread is in the destruction phase
and that it was necessary to wait and then have a valid status code
in the death entry, that status code wasn't actually returned. This
lead to uninitialized values for the return code even though
wait_for_thread[_etc]() would return B_OK.
* GLTeapot 3D model data moved from the text file "teapot.data" into
Application resources;
* Fixes#4934 and completes GCI 2011 task made by Aleksas Pantechovskis.
Thanks for contribution!!!
Signed-off-by: Siarzhuk Zharski <zharik@gmx.li>
For full- and lowspeed devices the unused ping status bit works as an
additional error bit (albeit it's so generic that it isn't really
useful). Include that bit when the error counter counts down to zero.
Also ensure that an error is returned if the error counter reaches
zero, but print a warning if none of the describing bits are set.
As a last fall-back, try to launch the test_registrar from the same
directory as run_test_registrar. This makes launching the app_server
test environment from a volume without Query support work.
Removing the team from the group may have released the last reference
to the group and freed it. Since we still have a locker on that group
it would later crash on unlock, therefore we need a reference to the
old group before removing the team from it.
Depending on the use case the grow size may be too large to fit into
address space holes. Instead of failing try with smaller sizes until
it either worked or doesn't make sense anymore (< 1MB).
Pages that are freed are added to the tail of the list while allocation
candidates are taken from the head. Therefore pages that have been free
the longest are preferred, making immediate re-use less likely.
Also avoid looking for pages if the free count already tells that the
allocation can't be fulfilled.
This allows to use the debug features of the guarded heap also on
allocations made through the object cache API. This is obivously
horrible for performance and uses up huge amounts of memory, so the
initial and grow sizes are adjusted accordingly.
Note that this is a rather simple hack, using the object_cache pointer
to transport the allocation size. The alignment is neglected completely.
The buffer may have been freed if its data was added to the queue, but
later the buffer size was still read from the object. A spurious
acknowledge may have been sent, or one would have gone missing,
depending on what happened with the allocation after it was freed.
The call to _MakeSpace() may move the extent data from the indirect
array (kept in a heap allocation) to the direct one kept inside the
class. In that case the lastExtent pointer would become stale and
further use of it would've lead to suboptimal extents in the best case
to reading/writing at the wrong point in files and possibly corruption
of another allocation in the worst (both unlikely though).
To mitigate that we now re-initialize the pointer to the correct location
if we hit the cache limit.
Also made the use of the start variable more understandable. Instaed of
decrementing it (possibly wrapping) when an extent wasn't going to be
used and later adding the vector index again, just increment whenever
we actually move to the next extent.
For bad things to happen a few conditions needed to come together though:
1. There needed to be multiple vectors that could be combined with the
existing last extent.
2. There first needed to be more extents than the cache limit and that
number then had to decrease below the cache limit again.
3. The memory needed to stay intact after being freed up until after the
evaluation (or similar enough data had to be written to it).
At least the last one was guaranteed to not be true anymore since we
re-introduced overwritting freed memory with 0xdeadbeef in the slab,
therefore nastily hiding this. I'm not sure that the first condition is
ever met either (probably the vectors are combined beforehand so that
there never are multiple adjacent ones) at least for the normal use case
(the page writer writing back pages). I was at least unable to reproduce
an actual file corruption in my testing.
Just the out of bounds access to the stale pointer happened rather easily
though and is now at least fixed.
Further in the process the flat argument size is rounded up, but the
actual allocation was done with the unaligned size causing an access
beyond the allocation when later copying the flat arguments. It didn't
do any actual harm as the block sizes of our allocator(s) use elements
that have at least such an alignment.
The device is added to the root devices list when initializing, but was
not removed from there again when the root device was removed and freed,
causing the list to have a stale entry. Probably fixes#3305.
The list is populated once for the _fbsd_init_hardware iteration and, if
a device was found, again for _fbsd_init_drivers. The only thing I don't
understand is why it didn't just always crash, as there should have been
a stale list entry in any case when a supported device actually was found...
This is a very simple heap implementation that allocates memory so that
the end of each allocation always coincides with a page end and is
followed by a guard page which is marked non-present. Out of bounds
access (both read and write) therefore cause a crash (unhandled page
fault).
Note that this allocator is neither speed nor space efficient, indeed it
wastes huge amounts of pages and address space so it is quite easy to
hit limits. It is intended as a pure debug feature.
* Fixes#7986 - behavior of Print command fixed to be consistent
with other application, like StyledEdit. This change
display the print job settings dialog instead of "Printing
was cancelled" alert;
* Fixes#6998 - the path to storing windows settings changed from
~/config/settings/Terminal_windows to ~/c/s/Terminal/Windows;
This patch was created during GCI 2011 by doctorkohaku.
Thanks for the contribution!
This adds a pair of functions vm_prepare_kernel_area_debug_protection()
and vm_set_kernel_area_debug_protection() to set a kernel area up for
page wise protection and to actually protect individual pages
respectively.
It was already possible to read and write protect full areas via area
protection flags and not mapping any actual pages. For areas that
actually have mapped pages this doesn't work however as no fault, at
which the permissions could be checked, is generated on access.
These new functions use the debug helpers of the translation map to mark
individual pages as non-present without unmapping them. This allows them
to be "protected", i.e. causing a fault on read and write access. As they
aren't actually unmapped they can later be marked present again.
Note that these are debug helpers and have quite a few restrictions as
described in the comment above the function and is only useful for some
very specific and constrained use cases.
They can be used to mark pages as present/non-present without actually
unmapping them. Marking pages as non-present causes every access to
fault. We can use that for debugging as it allows us to "read protect"
individual kernel pages.
* rename encoder_isexternal to encoder_is_external
* add encoder_is_dp_bridge call for special DP cases
* add initial get_dp_link_clock, hard code a guess for now
* take external DP encoders into consideration when making
pixel clock adjustments
The change to this initial index for safemode was brought in with the
flat import of the package manager branch in 323b654 where presumably
more paths were used. With this value selecting either just safe mode
or disable user add-ons would lead to no input_server add-ons being
loaded at all, leading to a system without input.
Once again, the BObjectList removal behaviour leads to a null dereference. It's my fault of course, but there you have it. Comments have been included for future devs.
* Apply reworked version of the patch from "RQ" in #8156 that adds a "live in the deskbar" menu item.
* Also added a "Remove replicant" menu item for the replicant case.
* The about-like screen saver info has bold styling of heading part
of the information string string. Localizing this string has
provoked partial styling and visual "corruption-looking" glitches.
Getting the object slab does a hash lookup which needs to be protected
by the cache lock. Otherwise the hash table may be resized or otherwise
modified while we do the lookup, leading to errors.
* The comparaison couldn't ever not match. Based on the comment above the
function, I made it so that flags must contain at least one of B_WATCH_NAME,
B_WATCH_STAT or B_WATCH_ATTR
CID 2586
* Use the std::nothrow behaviour of operator new
* Avoid to compare the CurrentDecorator at every iteration
* Avoid possible NULL dereference
Fix CID 10947 and CID 10889
* if an edid request for LVDS panel is detected, we now
return true and the VESA edid info.
* add #if 0'ed function to pull prefered timing info from atombios
on LVDS panels, still need to generate a fake EDID with this.
* not sure which method above is better... maybe a combination of both
* add HD 6480G PCI ID
* graphics memory is stored in bytes on IGP / APU evergreen+
* add an error and a fallback to PCI FB Bar size if we cannot
find full card memory size