GDB Api lookup_symbol does not get symbol address - api

This is a question about changing GDB code to add my own CLI to it.
I'm using lookup_symbol("XYZ", ...) to find a global system address in my coredump. The API succeeds - i.e, gets the symbol data struct with symbol name, but no address.
'print XYZ' works fine!
What can I change to get the symbol address correctly.

Related

Compilation of contract with include

I’m currently struggling to compile a contract (on aeternity's Sophia language) with include of a custom library “Library.aes” which resides in a separate file at the same level of the filesystem as the using contract.
The library looks like
namespace Library =
type number = int
function inc(x : number) : number = x + 1
The contract is using it like this
include "Library.aes"
When I compile (locally using compiler node) the contract, I always get
"Couldn't find include file 'Library.aes'\n"
also tried to pass the full path to the include, same result.
Is there a need to define the attribute options.file_system somehow?
let’s use the same example:
~/Quviq/Aeternity/aesophia_http [git:master]: FOO="include \\\"Bar.aes\\\"\\n\\ncontract Foo =\\n entrypoint foo() = Bar.bar()"
~/Quviq/Aeternity/aesophia_http [git:master]: BAR="namespace Bar =\\n function bar() = 42"
~/Quviq/Aeternity/aesophia_http [git:master]: curl -H "Content-Type: application/json" -d "{\"code\":\"$FOO\",\"options\":{\"backend\":\"fate\",\"file_system\":{\"Bar.aes\":\"$BAR\"}}}" -X POST http://localhost:3080/compile
{"bytecode":"cb_+IJGA6AANCB3UsSiP2HGHRML0dG95vNT9JsqZQMjPYAfEG1w6cC4Va3+RNZEHwA3ADcAGg6CPwEDP/5sbA2iAjcABwEDVP64/p9/ADcABwQDEWxsDaKjLwMRRNZEHxFpbml0EWxsDaIhLkJhci5iYXIRuP6ffw1mb2+CLwCFNC4yLjAAfreb3w=="}
Beware the quoting of strings, but apart from that it is rather straightforward.
This post is pretty old but thought on responding anyway.
Did you tried this by using aeproject?
https://github.com/aeternity/aepp-aeproject-js
Try to put your contract code under the file structure and use the deploy script so you can work it out locally first and the deploy to testnet or mainnet.
If you have Erlang installed you may use aesophia_cli instead of hosting a local node. Then it should search for include files in the same directory as your main .aes file.

TurtleCoin fork: how to define addresses prefix for miner?

I forked TurtleCoin and customized some config including addresses pefix. I compiled it on Windows using Visual Studio. Wallet and daemon work fine but miner do not work. When I start miner and add address get this message:
Address is not valid: The address does not have the correct prefix corresponding to this coin - it appears to be an address for another cryptocurrency.
Where can I define addresses pefix for miner?
I followed these steps: https://github.com/turtlecoin/turtlecoin#windows
Interesting, looking over the codebase this error is referred to as ADDRESS_WRONG_PREFIX. Which is returned by an the function validateAddresses which the mining code calls, here.
This function simply checks that the prefix matches WalletConfig::addressPrefix, meaning that as long as you changed the address prefix in the wallet config located here. It should work.. I hope this is helpful.

Bloomberg API: Accessing fields for symbol containing fractions

I am using Bloomberg API C# library, version 3.8.10.1.
I am wondering, what is the rule for formatting/escaping fractions in symbol names?
Instruments service (//blp/instruments) returns symbols like RIOLN 3<3/4> 03/22/2022<corp>, however, querying reference service (//blp/refdata) or market data service (//blp/mktdata) with:
RIOLN 3¾ 06/15/2025 Corp, RIOLN 3<3/4> 06/15/2025 Corp, RIOLN 3 3/4 06/15/2025 Corp gets me Unknown/Invalid security [nid:810] error.
Namely, any modification of such symbol I can think of, gets me this error. Are there any rules for proper formatting of those symbol name fractions?
You can use the "ASCII" ticker: EJ101044 Corp.
You can find it on a terminal by loading the bond and typing FLDS PARSE.
Or you can use a different identifier (such as CUSIP or Bloomberg Unique ID).

Balanced Payments doesn't seem to work with Phonegap

We are not able to call balanced.card.create from a Phonegap application. This is reproduced in a stock Phonegap application here: https://github.com/kevg/phonegap-balanced. Full details are in the README.md on github, but the basic summary is:
For those not familiar with phonegap, the main page that loads is
index.html. This initializes phonegap in index.js. When the device is
ready, we will show a hidden DIV with a button named "Execute
Balanced." When you click this button, app.executeBalanced in index.js
will be called which prompts for the balanced marketplace URI, loads
balanced.js with $.getScript, and then calls balanced.card.create with
a test credit card.
The expected result is that callbackHandler is called or an exception
is caught. Instead, it seems the execution of the Javascript thread
disappears into balanced.card.create, never to return and without any
error.
Alrighty, I found the bug in balanced.js. So, in Phonegap, window.location.href returns something like file:///.../index.html. Balanced.js creates an iframe to something like https://js.balancedpayments.com/proxy#file
var src = proxy + "#" + encodeURIComponent(window.location.href);
https://github.com/balanced/balanced-js/blob/master/src/utils.js#L48
In the script returned in proxy.html (which I can't find on github), it does:
c.parentURL=decodeURIComponent(
window.location.hash.replace(/^#/,"")
).replace(/#.*$/,"")
c.parentDomain=c.parentURL.replace(/([^:]+:\/\/[^\/]+).*/,"$1")
The regex doesn't match because file: has three slashes. Now, at first, I thought I could just convert the regex to:
/([^:]+:\/+[^\/]+).*/
However, then there's another problem, because balanced does a security origin check on the match:
if (d.origin.toLowerCase() !== c.toLowerCase()) return !1;
However, the regex returns file:///firstcomponent, whereas event.origin does not include a host name for the file scheme, so these won't match even with a fixed regex.
I can't change anything in the script returned in the proxy response because if I load that from a domain other than balancedpayments.com, then the AJAX POST fails (return code 0 with a blank body). Therefore, the only thing I can control is the hash passed to the iframe.
However, since this regex is a replace, we can simply pass exactly what we know we need (we don't care that the regex is a no-op).
Therefore, the solution is to change L48 above to:
var src = proxy + "#" + encodeURIComponent("file://");
This works.

MSBuild and IgnoreStandardErrorWarningFormat

I'm trying to write a MSBuild project that will generate html documentation using doxygen. I couldn't find anything about that on the net except for one example, which seems incomplete; it doesn't parse doxygen warnings.
I found that MSBuild's Exec task has parameters like IgnoreStandardErrorWarningFormat and CustomWarningRegularExpression. What is the "Standard Error/Warning Format" and what kind of REs are allowed in these properties?
Edit: ah, "Inside the Microsoft Build Engine" wrongly describes it as property in .NET 3.5, where it is actually from 4. No use for me...
The standard msbuild error/warning format is described here.
In a nutshell, the format is:
MSBuild recognizes error messages and warnings that have been specially formatted by many command line tools that typically write to the console. For instance, take a look at the following error messages - they are all properly formatted to be MSBuild and Visual Studio friendly.
Main.cs(17,20): warning CS0168: The variable 'foo' is declared but never used
C:\dir1\foo.resx(2) : error BC30188: Declaration expected.
cl : Command line warning D4024 : unrecognized source file type 'foo.cs', object file assumed
error CS0006: Metadata file 'System.dll' could not be found.
These messages confirm to special format that is shown below, and comprise 5 parts - the order of these parts are important and should not change:
Origin (Required)
Origin can be blank. If present, the origin is usually a tool name, like 'cl' in one of the examples. But it could also be a file name, like 'Main.cs' shown in another example. If it is a file name, then it must be an absolute or a relative file name, followed by an optional parenthesized line/column information in one of the following forms:
(line) or (line-line) or (line-col) or (line,col-col) or (line,col,line,col)
Subcategory (Optional)
Subcategory is used to classify the category itself further, and should not be localized.
Category (Required)
Category must be either 'error' or 'warning'. Case does not matter. Like origin, category must not be localized.
Code (Required)
Code identifies an application specific error code / warning code. Code must not be localized and it must not contain spaces.
Text (Optional)
User friendly text that explains the error, and must be localized if you cater to multiple locales.
The format is fully documented in the MSBuild source code here.
I can't find docs on it right now, but I think the standard error format is something like
.*(\d+(,\d+(,\d+,\d+)?)?)?: error .*:.*
.*(\d+(,\d+(,\d+,\d+)?)?)?: warning .*:.*
examples:
c:\somefile.txt(10,20,10,30): error CMD1234: blarg
c:\somefile.txt(10,20): error CMD1234: yadda yadda
c:\somefile.txt: warning ARG5678: blah blah