Commit Graph
271 Commits
Author SHA1 Message Date
Atsushi Eno c860fd7dd4 Fix wrapper elements. It should be <TraceData><DataItem>... 2011-04-21 21:08:36 +09:00
Atsushi Eno 38050ff69b XmlWriterTraceListener supports XPathNavigator as non-escaped xml output. 2011-04-21 20:54:40 +09:00
Atsushi Eno 87a97563f6 Flush XmlWriter and TextWriter so that incomplete changes are not lost. 2011-04-15 14:56:11 +09:00
Atsushi Eno 9a69744701 Fix wrong TraceEventType values passed. 2011-04-13 02:21:02 +09:00
Louis Salin 16a5e11037 TraceData and TraceEvent methods must pass a new instance of TraceEventCache 2011-03-31 09:11:41 -04:00
Sebastien Pouliot 4eedff1487 Fix parameter name mismatches between Moonlight and Silverlight 2011-03-10 14:33:31 -05:00
Ankit Jain 77fabf1209 Process.Start: Show native error message in Win32Exception.
mcs/class/System/System.Diagnostics/Process.cs (Start_noshell):
If the process execution fails, then add the error message for
the native error code in the Win32Exception thrown.
2011-01-27 04:03:46 +05:30
Gonzalo Paniagua Javier 827a231ffc Remove arbitrary 1024 limit in GetProcesses
Reallocate the array of PIDs if EnumProcesses used all of it and try
	again.
2010-10-22 00:01:38 -04:00
Jonathan Pryor 9f264b8748 Don't load app.config when we're processing app.config
Fixes #605033.

'cause stack overflow is back, mkay?

  at System.Diagnostics.TraceImpl.InitOnce () <0x0005b>
  at System.Diagnostics.TraceImpl.get_IndentLevel () <0x0000b>
  at System.Diagnostics.TraceListenerCollection.InitializeListener (System.Diagnostics.TraceListener) <0x0000f>
  at System.Diagnostics.TraceListenerCollection.Add (System.Diagnostics.TraceListener) <0x00017>
  at System.Diagnostics.TraceListenerCollection..ctor (bool) <0x0007f>
  at System.Diagnostics.TraceListenerCollection..ctor () <0x00013>
  at System.Diagnostics.DiagnosticsConfigurationHandler.GetSharedListeners (System.Collections.IDictionary) <0x00083>
  at System.Diagnostics.DiagnosticsConfigurationHandler.Create (object,object,System.Xml.XmlNode) <0x003cf>
  at System.Configuration.ConfigurationSection.GetRuntimeObject () <0x0033d>
  at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (string) <0x00041>
  at System.Configuration.ConfigurationManager.GetSection (string) <0x00030>
  at System.Configuration.ConfigurationSettings.GetConfig (string) <0x0000f>
  at System.Diagnostics.DiagnosticsConfiguration.get_Settings () <0x00043>
  at System.Diagnostics.TraceImpl.InitOnce () <0x0005b>

Thus, when we're getting the <sharedListeners/> element, we shouldn't call
the TraceListenerCollection default constructor, as that will attempt to add
the DefaultTraceListener (which isn't needed anyway, as the
DefaultTraceListener is explicitly added by TraceImplSettings).
2010-10-18 16:57:53 -04:00
Miguel de Icaza 0085c16ada Revert 2010-09-15 17:18:18 -04:00
Miguel de Icaza acfdccca84 Make the thread-id field be of the proper size on 64 bit machines.
This error was found by Gonzalo when he was looking at another problem
when thread IDs overflowed ints.

Currently we use gpointers in the io-layer for the threadid, but we were
only exposing the value as an int32.   The good news is that the code is
not really used right now, but could cause problems in the future as we
extend Process.
2010-09-15 14:28:23 -04:00
Jb Evain 9cb87907d7 Enable the System build for monodroid 2010-09-08 18:48:28 +02:00
Raja R Harinath b293948fb7 EOL handling
This set of .gitattributes was automatically generated from the list of files
that GIT tried to normalize when I enabled automatic EOL conversion.

With this set of attributes, we prevent automated EOL conversion on files that
we know will cause trouble down the road.
2010-07-25 20:17:39 +05:30
Gonzalo Paniagua Javier e497bb1b59 2010-07-06 Gonzalo Paniagua Javier <[email protected]>
* Process.cs: allow the exit callback to be used more than once. Fixes
	bug #614909.



svn path=/trunk/mcs/; revision=159980
2010-07-06 18:39:07 +00:00
Gonzalo Paniagua Javier 9b948ac91d 2010-07-04 Gonzalo Paniagua Javier <[email protected]>
* Process.cs: ignore processes that finish while we are looking for
	processes by name. Fixes bug #596779.


svn path=/trunk/mcs/; revision=159866
2010-07-04 21:31:42 +00:00
Jb Evain e5cb263033 2010-04-06 Jb Evain <[email protected]>
* Debug.cs: make class static.


svn path=/trunk/mcs/; revision=154843
2010-04-06 12:49:51 +00:00
Jb Evain 85f02eb1ed 2010-04-06 Jb Evain <[email protected]>
* Debug.cs (Assert, WriteLine): add net_4_0 overloads.


svn path=/trunk/mcs/; revision=154842
2010-04-06 12:48:27 +00:00
Sebastien Pouliot dd1802b725 In System.Diagnostics:
2010-03-11  Sebastien Pouliot  <[email protected]>

	* Debug_2_1.cs: Change type to static to match SL4

In .:
2010-03-11  Sebastien Pouliot  <[email protected]>

	* net_2_1_raw_System.dll.sources: Add existing files that are 
	part of SL4

In System.Collections.Generic:
2010-03-11  Sebastien Pouliot  <[email protected]>

	* ISet.cs: Add NET_2_1 since this is part of SL4


svn path=/trunk/mcs/; revision=153477
2010-03-11 18:15:05 +00:00
Gonzalo Paniagua Javier bbc13e42bc 2010-01-27 Gonzalo Paniagua Javier <[email protected]>
* Stopwatch.cs: add new Restart().


svn path=/trunk/mcs/; revision=150317
2010-01-27 22:40:18 +00:00
Sebastien Pouliot 300fca4fd3 2009-11-30 Sebastien Pouliot <[email protected]>
* Debug_2_1.cs: Change type to sealed to match SL2/3


svn path=/trunk/mcs/; revision=147153
2009-12-01 01:14:35 +00:00
Zoltan Varga bcd2356726 2009-10-12 Zoltan Varga <[email protected]>
* Process.cs (Dispose): Close the async output/error readers. Fixes #545429.

svn path=/trunk/mcs/; revision=143985
2009-10-12 21:28:49 +00:00
Jb Evain 44d5cd6772 2009-07-22 Jb Evain <[email protected]>
* ProcessStartInfo.cs: force no-verb on MONOTOUCH.


svn path=/trunk/mcs/; revision=138407
2009-07-22 14:19:51 +00:00
Gonzalo Paniagua Javier fbdb064a75 2009-07-10 Gonzalo Paniagua Javier <[email protected]>
* ProcessStartInfo.cs: HaveEnvVars is enabled by just using the
	EnvironmentVariables property. Bug #520650 fixed.


svn path=/trunk/mcs/; revision=137730
2009-07-10 20:54:29 +00:00
Jonathan Pryor 3b6088ff92 * System.Diagnostics/DiagnosticsConfigurationHandler.cs: Use the new
TraceSourceInfo(string, SourceLevels, TraceImplSettings) constructor.
	* System.Diagnostics/TraceSourceInfo.cs: Add a new constructor, 
	  TraceSourceInfo(string, SourceLevels, TraceImplSettings), which adds
	  the DefaultTraceListener w/o depending upon (the possibly still
	  initializing) TraceImpl members.  Fixes #502944.
	* Test/test-config-file: Add a /configuration/system.diagnostics/source
	  section to elicit the buggy behavior found in #502944.

svn path=/trunk/mcs/; revision=133981
2009-05-12 18:53:16 +00:00
Jonathan Pryor f80c179df7 * DiagnosticsConfigurationHandler.cs: Don't refer to TraceImpl member
while reading the .config file, instead cache the values and refer
	  to the cached values during initialization.  This prevents recursive
	  initialization calls (Trace.OnInit() ... Trace.Listeners.Add() ...
	  Trace.OnInit() ...), and associated duplicate parsing of .config file
	  sections.  Fixes bnc#499442.
	* TraceImpl.cs: Cope with DiagnosticsConfigurationHandler changes.
	* TraceListenerCollection.cs: Add internal 
	  Add(TraceListener,TraceImplSettings) method for adding
	  TraceListeners during DiagnosticsConfigurationHandler initialization
	  (which can't access TraceImpl, as we may still be reading the
	  .config file to determine the TraceImpl values).

svn path=/trunk/mcs/; revision=133291
2009-05-01 20:21:50 +00:00
Gonzalo Paniagua Javier e4d01de353 2009-04-28 Gonzalo Paniagua Javier <[email protected]>
* ConsoleTraceListener.cs: add an internal constructor that takes a
	string argument. Used when 'initializeData' is set.
	* DiagnosticsConfigurationHandler.cs: try internal constructors when
	the assembly is System.
	Fixes bug #498853.


svn path=/trunk/mcs/; revision=132868
2009-04-28 17:47:15 +00:00
Miguel de Icaza 401337e297 2009-04-19 Miguel de Icaza <[email protected]>
* Process.cs: Do not crash if GetProcesses_internal returns null
	This happens on operating systems where we have not implemented

svn path=/trunk/mcs/; revision=132110
2009-04-20 03:57:44 +00:00
Andrés G. Aragoneses eeb713067a changelog..
svn path=/trunk/mcs/; revision=127933
2009-02-25 02:33:30 +00:00
Andrés G. Aragoneses 5bb70a1030 * Test/System.Diagnostics/ProcessTest.cs: New tests for bug 477943.
* System.Diagnostics/Process.cs: Throw IOEs instead of normal
exceptions. Fixes bug 477943.

svn path=/trunk/mcs/; revision=127932
2009-02-25 02:28:14 +00:00
Zoltan Varga c1b14152d3 2009-01-22 Zoltan Varga <[email protected]>
* Stopwatch.cs: Reorder the calculations in Elapsed and ElapsedMilliseconds
	to avoid overflow. Fixes #468570. Patch by Yoni Shalom <[email protected]>.

svn path=/trunk/mcs/; revision=124260
2009-01-22 22:13:31 +00:00
Zoltan Varga 10cabfadcc 2009-01-18 Zoltan Varga <[email protected]>
* Process.cs: Avoid closing the duplicated process handle in
	ProcessWaitHandle, it is done automatically by the WaitHandle.Dispose ().
	Fixes #464628.

svn path=/trunk/mcs/; revision=123738
2009-01-18 16:00:11 +00:00
Miguel de Icaza 1755003275 A bug fix for 459450
2008-12-25  Miguel de Icaza  <[email protected]>

	* ProcessTest.cs: Created a test case from bug 459450.

2008-12-25   Leszek Ciesielski <[email protected]>

	* System.Diagnostics/Process.cs: Raise the
	Process.OutputDataReceived and Process.ErrorDataReceived with null
	arguments at the end.   This is the documented behavior:

	http://msdn.microsoft.com/en-us/library/system.diagnostics.datareceivedeventargs.data.aspx

	And CruiseControl.NET depended on this.   Bug #459450.
	
	* Microsoft.CSharp/CSharpCodeCompiler.cs: Fix the code, as it
	depened on the previous broken behavior.



svn path=/trunk/mcs/; revision=122125
2008-12-25 17:44:52 +00:00
Christian Hergert 79be0ac6d8 2008-12-09 Christian Hergert <[email protected]>
* System/Test/System.Diagnostics/CounterCreationDataTest.cs: Test to verify CounterHelp defaults to String.Empty.
	* System/System.Diagnostics/CounterCreationData.cs: Default CounterHelp to String.Empty.


svn path=/trunk/mcs/; revision=121172
2008-12-09 23:32:18 +00:00
Gonzalo Paniagua Javier adcaff89cc 2008-11-20 Gonzalo Paniagua Javier <[email protected]>
* PerformanceCounter.cs: add 2 workarounds for known problems. I will
	add the corresponding test cases later.


svn path=/trunk/mcs/; revision=119506
2008-11-20 20:40:55 +00:00
Bill Holmes 18e193acd5 2008-11-13 Bill Holmes <[email protected]>
* process.h : Adding method declaration for
	  ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.

	* process.c : Adding implementation for
	  ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.

	* icall-def.h : Registering ICALL Processs.WaitForInputIdle_internal
	  to ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.

	* wait.h : Adding method declaration for WaitForInputIdle.

	* wait.c : Adding implementation for WaitForInputIdle.

	* Process.cs : Adding an implementation for WaitForInputIdle
	  to call the an internal call.  The internal call is only
	  implemented properly on Windows.

	Code is contributed under MIT/X11 license.


svn path=/trunk/mcs/; revision=118724
2008-11-13 16:03:48 +00:00
Jonathan Chambers 84ec87d71b 2008-11-06 Jonathan Chambers <[email protected]>
* MonoIO.cs : Add DuplicateHandle.

2008-11-06  Jonathan Chambers  <[email protected]>

        * Process.cs : Use DuplicateHandle when redirecting
        StdInput and StdOutput. Fixes bug #436291.



svn path=/trunk/mcs/; revision=118134
2008-11-06 18:48:08 +00:00
Paolo Molaro bd23e8ade8 Changes to follow PlatformID corlib changes.
svn path=/trunk/mcs/; revision=115659
2008-10-13 15:04:34 +00:00
Paolo Molaro 43c05dda29 Mon Oct 13 14:39:52 CEST 2008 Paolo Molaro <[email protected]>
* Process.cs: added icall and implementation of many memory-related
	query methods (bug #434473).


svn path=/trunk/mcs/; revision=115653
2008-10-13 12:42:08 +00:00
Gert Driesen 4e89905665 * PerformanceCounter.cs:
* Stopwatch.cs:
* TraceImpl.cs: Fixed line endings.

svn path=/trunk/mcs/; revision=113630
2008-09-20 11:44:57 +00:00
Gert Driesen a21deeae6a * DiagnosticsConfigurationHandler.cs (AddTraceAttributes): Avoid
wrapping configuration errors thrown during initialization of
TraceImpl. Fixed line endings.

svn path=/trunk/mcs/; revision=113629
2008-09-20 11:41:12 +00:00
Paolo Molaro 9136ca99bd Thu Sep 18 18:14:25 CEST 2008 Paolo Molaro <[email protected]>
* CounterSampleCalculator.cs: added more calculated types.
	* PerformanceCounter.cs: NextValue() works as well as RawValue.


svn path=/trunk/mcs/; revision=113435
2008-09-18 16:16:20 +00:00
Bill Holmes 017eaee375 2008-09-10 Bill Holmes <[email protected]>
* Socket.cs : Adding a comment to provide locations where
	  changes to MonoSocketAsyncResult need to be synced.

	* Process.cs : Update the fields of ProcessAsyncReader to
	  match MonoSocketAsyncResult metadata/socket-io.h

	Code is contributed under MIT/X11 license.


svn path=/trunk/mcs/; revision=112681
2008-09-10 15:20:35 +00:00
Jonathan Pryor 6f6b608851 * TraceImpl.cs:
- Remove the "lock-free" code, which (come to think of it) would be 
	    faulty in a multithreaded environment anyway because the "other"
	    threads won't wait (block) until initialization is complete...
	  - Add InitOnce() calls to all public properties, so that
	    `Debug.AutoFlush=true' will cause InitOnce() to be loaded, lest
	    a `Debug.AutoFlush=true; Debug.Listeners.Add(...)` sequence cause
	    .AutoFlush=true to be ignored as the InitOnce implied by .Add() 
	    will "overwrite" the .AutoFlush.
	  - Split up TraceListenerCollection creation from DefaultTraceListener 
	    addition, as TraceListenerCollection.Add() calls back into 
	    TraceImpl, so if these aren't separate we get an infinite loop
	    and never actually initialize anything.
	  - Fixes #424370.
	* TraceListenerCollection.cs: Add a TraceListenerCollection(bool)
	  constructor, which provides a way to NOT add the
	  DefaultTraceListener (needed by TraceImpl; see above).

svn path=/trunk/mcs/; revision=112596
2008-09-09 15:08:29 +00:00
Marek Safar 18c2b0eaaa Warnings cleanup.
svn path=/trunk/mcs/; revision=111796
2008-08-28 10:14:05 +00:00
Marek Safar 225f1c9198 Warnings cleanup
svn path=/trunk/mcs/; revision=111790
2008-08-28 09:12:00 +00:00
Sebastien Pouliot 7fb5fe021f 2008-08-06 Sebastien Pouliot <[email protected]>
* Debug_2_1.cs: Add missing [Conditional] attributes.


svn path=/trunk/mcs/; revision=109803
2008-08-06 23:52:01 +00:00
Gert Driesen 0b2a27db70 * TraceListenerTest.cs: Added test for GetSupportedAttributes.
* DelimitedTraceListener.cs: Changed accessibility of
GetSupportedAttributes to protected internal.
* DiagnosticsConfigurationHandler.cs: Use GetSupportedAttributes to
allow custom attributes on tracelisteners. Fixes bug #413203.
* TraceListener.cs: Changed accessibility of GetSupportedAttributes
to protected internal. Removed MonoTODO on GetSupportedAttributes and
Attributes. Fixed line endings.

svn path=/trunk/mcs/; revision=109500
2008-08-02 20:06:21 +00:00
Paolo Molaro b73eaaf930 Fri Aug 1 16:09:31 CEST 2008 Paolo Molaro <[email protected]>
* CounterCreationData.cs, PerformanceCounterCategory.cs: more
	checks and default type fix.


svn path=/trunk/mcs/; revision=109426
2008-08-01 14:11:15 +00:00
Dick Porter 941ac90384 2008-07-28 Dick Porter <[email protected]>
* Process.cs: When passing handle references around, it needs to
	be duplicated and freed so the OS doesn't close it.  Makes the
	testcase in 410743 work again now the underlying bug has been
	fixed.



svn path=/trunk/mcs/; revision=109048
2008-07-28 16:30:37 +00:00
Zoltan Varga eff019542d 2008-07-27 Zoltan Varga <[email protected]>
* Process.cs (SetExitCallbackIfNeeded): Avoid a race condition by not
	checking for HashExited.

svn path=/trunk/mcs/; revision=108887
2008-07-27 00:08:08 +00:00