Skip to content

Commit

Permalink
2002-08-23 Martin Baulig <martin@gnome.org>
Browse files Browse the repository at this point in the history
	* codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
	writer the full pathname of the generated assembly.

svn path=/trunk/mcs/; revision=6965
  • Loading branch information
Martin Baulig committed Aug 23, 2002
1 parent c976f20 commit f991383
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
5 changes: 5 additions & 0 deletions mcs/mcs/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2002-08-23 Martin Baulig <martin@gnome.org>

* codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
writer the full pathname of the generated assembly.

2002-08-23 Martin Baulig <martin@gnome.org>

* statements.cs (FlowBranching.UsageVector.MergeChildren):
Expand Down
33 changes: 23 additions & 10 deletions mcs/mcs/codegen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,28 @@ static string TrimExt (string name)
//
// This routine initializes the Mono runtime SymbolWriter.
//
static bool InitMonoSymbolWriter (string basename, string[] debug_args)
static bool InitMonoSymbolWriter (string basename, string output_file,
string[] debug_args)
{
string symbol_output = basename + "-debug.s";

Type itype = SymbolWriter.GetType ();
if (itype == null)
return false;

Type[] arg_types = new Type [2];
Type[] arg_types = new Type [3];
arg_types [0] = typeof (string);
arg_types [1] = typeof (string[]);
arg_types [1] = typeof (string);
arg_types [2] = typeof (string[]);

MethodInfo initialize = itype.GetMethod ("Initialize", arg_types);
if (initialize == null)
return false;

object[] args = new object [2];
args [0] = symbol_output;
args [1] = debug_args;
object[] args = new object [3];
args [0] = output_file;
args [1] = symbol_output;
args [2] = debug_args;

initialize.Invoke (SymbolWriter, args);
return true;
Expand All @@ -92,7 +95,8 @@ static bool InitMonoSymbolWriter (string basename, string[] debug_args)
//
// Initializes the symbol writer
//
static void InitializeSymbolWriter (string basename, string[] args)
static void InitializeSymbolWriter (string basename, string output_file,
string[] args)
{
SymbolWriter = ModuleBuilder.GetSymWriter ();

Expand All @@ -119,7 +123,7 @@ static void InitializeSymbolWriter (string basename, string[] args)

switch (sym_type.Name){
case "MonoSymbolWriter":
if (!InitMonoSymbolWriter (basename, args))
if (!InitMonoSymbolWriter (basename, output_file, args))
Report.Error (
-18, "Cannot initialize the symbol writer");
break;
Expand Down Expand Up @@ -157,8 +161,17 @@ static public void Init (string name, string output, bool want_debugging_support
ModuleBuilder = AssemblyBuilder.DefineDynamicModule (
Basename (name), Basename (output), want_debugging_support);

if (want_debugging_support)
InitializeSymbolWriter (an.Name, debug_args);
if (want_debugging_support) {
int pos = output.LastIndexOf (".");

string basename;
if (pos > 0)
basename = output.Substring (0, pos);
else
basename = output;

InitializeSymbolWriter (basename, output, debug_args);
}
}

static public void Save (string name)
Expand Down

0 comments on commit f991383

Please sign in to comment.