Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » [BUG?] MIValue (Why "String &MIValue::Get(void)" is called ? it should not.)
[BUG?] MIValue [message #44532] Tue, 24 March 2015 17:54 Go to next message
omari is currently offline  omari
Messages: 193
Registered: March 2010
Experienced Member
Hi,

i have added same RLOGs :

Gdb_MI2.cpp,lines 1764 and 1773:
RLOG(">>>============================================");

MICmd("gdb-set disassembly-flavor intel");
MICmd("gdb-set exec-done-display off");
MICmd("gdb-set annotate 1");
MICmd("gdb-set height 0");
MICmd("gdb-set width 0");
MICmd("gdb-set confirm off");
MICmd("gdb-set print asm-demangle");
RLOG("<<<============================================");


MIValue.cpp, line 457: RLOG(string);

MIValue.cpp, line 536: RLOG("String &MIValue::Get(void)");


output :
>>>============================================
String &MIValue::Get(void)
String &MIValue::Get(void)
error:Not a String value type
String &MIValue::Get(void)
String &MIValue::Get(void)
String &MIValue::Get(void)
String &MIValue::Get(void)
error:Not a String value type
String &MIValue::Get(void)
String &MIValue::Get(void)
String &MIValue::Get(void)
String &MIValue::Get(void)
error:Not a String value type
String &MIValue::Get(void)
String &MIValue::Get(void)
String &MIValue::Get(void)
String &MIValue::Get(void)
error:Not a String value type
String &MIValue::Get(void)
String &MIValue::Get(void)
String &MIValue::Get(void)
String &MIValue::Get(void)
error:Not a String value type
String &MIValue::Get(void)
String &MIValue::Get(void)
String &MIValue::Get(void)
String &MIValue::Get(void)
error:Not a String value type
String &MIValue::Get(void)
String &MIValue::Get(void)
String &MIValue::Get(void)
String &MIValue::Get(void)
error:Not a String value type
String &MIValue::Get(void)
String &MIValue::Get(void)
<<<============================================


Question :

Why "String &MIValue::Get(void)" is called ?


regards
omari.
Re: [BUG?] MIValue [message #44534 is a reply to message #44532] Tue, 24 March 2015 18:56 Go to previous messageGo to next message
omari is currently offline  omari
Messages: 193
Registered: March 2010
Experienced Member
this patch resolve this issu:

file Gdb_MI2Gdb.cpp

1 - MIValue Gdb_MI2::ParseGdb(String const &output, bool wait)
replace :

return res;

by
return pick(res);

2 - MIValue Gdb_MI2::ReadGdb(bool wait)

replace
return ParseGdb(output);
by
return pick(ParseGdb(output));

3 - MIValue Gdb_MI2::MICmd(const char *cmdLine)
replace
res = ReadGdb();
by
res = pick(ReadGdb());

and
return res;
by
return pick(res);


with this patch, the output of RLOG is:
>>>============================================
<<<============================================


then "String &MIValue::Get(void)" is not called.

but still an issue:

MIValue v = MICmd("file-list-exec-source-files"); with that , v equal to "error:Not a String value type"

MIValue& v = MICmd("file-list-exec-source-files"); using reference, v get the good value.



regards
omari.

[Updated on: Tue, 24 March 2015 19:03]

Report message to a moderator

Re: [BUG?] MIValue [message #44539 is a reply to message #44534] Wed, 25 March 2015 10:52 Go to previous messageGo to next message
omari is currently offline  omari
Messages: 193
Registered: March 2010
Experienced Member
Hi,

Here is a simple test case, which highlighted the problem (attachment)


MIValue GetTuple()
{
	MIValue r;
	r.Add("a", "b");
	return r;
}

CONSOLE_APP_MAIN
{
	
	MIValue v =  GetTuple();
	
	DUMP(v.Get("a"));
}



the output is:
String &MIValue::Get(void)
error:Not a String value type
String &MIValue::Get(void)
String &MIValue::Get(void)
error:Not a Tuple value type
v.Get("a") = error:Not a Tuple value type



regards
omari.
Re: [BUG?] MIValue [message #44540 is a reply to message #44539] Wed, 25 March 2015 12:35 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
Hi, I run yout testcase both in linux and in windows, and all what I got is

* c:\users\massimo\sources\upp-svn\out\MyApps_Bazaar\MINGW.Deb ug.Debug_Full.Sse2\MiValueTest.exe 25.03.2015 12:32:29, user: Massimo

v.Get("a") = b

so the correct result.
Is it possible that you've got some patches somewhere in your three ?
Re: [BUG?] MIValue [message #44542 is a reply to message #44532] Wed, 25 March 2015 16:27 Go to previous messageGo to next message
omari is currently offline  omari
Messages: 193
Registered: March 2010
Experienced Member
Hi, thank you for the test,
sorry, I did not put my setup:
the problem appears with the following configuration:

MSC10 WinXP 32bit, the latest version Upp 8296

with MinGW, it is OK.


regards
omari.
Re: [BUG?] MIValue [message #44562 is a reply to message #44542] Tue, 31 March 2015 12:52 Go to previous messageGo to next message
omari is currently offline  omari
Messages: 193
Registered: March 2010
Experienced Member
bug catched:

replacing rval_ by const rval_ in

		MIValue(MIValue  rval_ v);
		MIValue &operator=(MIValue  rval_ v);


=>

		MIValue(MIValue const rval_ v);
		MIValue &operator=(MIValue  const rval_ v);




rsolve the probleme with COMPILER_MSC, but create one with others compilers

the origin of the probleme is in Core/Defs.h:


#ifdef COMPILER_MSC
#define pick_
#define rval_ &
#else
#define pick_ const
#define rval_ const &
#endif



Why this difference between COMPILER_MSC and others ?


regards
omari.
Re: [BUG?] MIValue [message #44573 is a reply to message #44562] Thu, 02 April 2015 10:15 Go to previous message
omari is currently offline  omari
Messages: 193
Registered: March 2010
Experienced Member
discussion continues in another thread : http:// www.ultimatepp.org/forums/index.php?t=msg&goto=44571& ;#msg_44571

regards
omari.
Previous Topic: patch Gdb_MI parser
Next Topic: GDB/MINGW interface Bug fix
Goto Forum:
  


Current Time: Thu Nov 21 22:22:35 CET 2019

Total time taken to generate the page: 0.01115 seconds