Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mismatching .PDB-Files? #23

Open
OzzyL opened this issue Nov 24, 2016 · 6 comments
Open

Mismatching .PDB-Files? #23

OzzyL opened this issue Nov 24, 2016 · 6 comments

Comments

@OzzyL
Copy link

OzzyL commented Nov 24, 2016

I seem to be unable to load debug information for projects where I use DLLExport v1.5.1.
I have seen the issue in both Visual Studio 2013 and 2015.

image

image

I can load .pdb-files when using DLLExport 1.4.0, without problem.
I have also uploaded a simple sample project, which reproduce the issue.

DLLExportPdbTest.zip

@3F
Copy link
Owner

3F commented Nov 24, 2016

"Binary was not built with debug information"

try with original coreclr:

<DllExportOurILAsm>false</DllExportOurILAsm>

later I will look this in details when I'll have new time for this :(
Source code of my ILAsm here if you need: https://github.com/3F/coreclr

By the way, for your sample, feel free with Conari engine:

using(var l = new ConariL("DllExportLib.dll")) {
    l.DLR.Hello(); // that's all what you need in your `DLLExportPdbTest`
}

full control via lambda expressions like this:

bool v = l.bind<Func<int, string, bool>>("set")(-1, "Hello from Conari !");
// DLR:
bool v = l.DLR.set(-1, "Hello from Conari !");

etc.

@OzzyL
Copy link
Author

OzzyL commented Nov 24, 2016

It works when I set accordingly:
<DllExportOurILAsm>false</DllExportOurILAsm>

image

First time I hear of Conair.
Holy.. This changes everything!

@3F
Copy link
Owner

3F commented Nov 24, 2016

First time I hear of Conair.
Holy.. This changes everything!

just follow me.
You can also find other "Holy.." products from me :)

It works when I set accordingly:

well yes, this problem only from ILAsm. Thanks for reply.

@3F
Copy link
Owner

3F commented Nov 30, 2016

just details for this issue

I don't see .line directives if used our ILDasm:

il_line_directive

dis.cpp:943:

strcpy_s(szVarPrefix,MAX_PREFIX_SIZE,"V0");
if(g_pSymReader)  // <<<<<<<<<<<<<<<< should be NULL /ISymUnmanagedReader*
{
    g_pSymReader->GetMethod(FuncToken,&pSymMethod);
    ...
        pSymMethod->GetSequencePoints(ulLines,&actualCount, offsets,docs,lines,columns, endlines, endcolumns);
        for(ULONG i = 0; i < ulLines; i++)
        {
            pLCD->Line = lines[i];
            pLCD->Column = columns[i];
            pLCD->LineEnd = endlines[i];
            pLCD->ColumnEnd = endcolumns[i];
            pLCD->PC = offsets[i];
            pLCD->FileToken = (ULONG_PTR)docs[i];
            ulActualLines++;
            pLCD++;
        }
        ...

dasm.cpp:599:

#ifndef FEATURE_CORECLR
...
hr = CoCreateInstance(CLSID_CorSymBinder_SxS, NULL,
                              CLSCTX_INPROC_SERVER,
                              IID_ISymUnmanagedBinder,
                              (void**)&binder);

if (SUCCEEDED(hr))
{
    hr = binder->GetReaderForFile(g_pPubImport,
                                  wzInputFileName,
                                  NULL,
                                  &g_pSymReader);
...

and this is a hard limitation, I mean simply def with CMake:

project(ildasm)
add_definitions(-DFEATURE_CORECLR)

+ilasm, +mscorpe

I found this commit:

SHA-1: 1b6658714821566dd9ab78dcf1fe96fcb0f8772a
...
This ILDASM now depends on CoreCLR targeting cross-platform and thus 
I dropped some features like GUI/PDB -- default output is console.

well yes...

the .line directives is unavailable at all + source code already is not valid (dead code) without FEATURE_CORECLR for latest changes.
Thus we need to restore this: to implement support for latest changes or try with older rev.

Any pull requests are welcome, or wait of my time /after the rain on thursday :)
-_-

@nabnaj
Copy link

nabnaj commented Apr 13, 2020

Hello,
I was testing a [C# DLL] in C++ with mixed debugging mode , VS community 2019.
Why does it reload the same DLL, then it just unloads its symbols?
image

image

Thanks

@3F
Copy link
Owner

3F commented Apr 13, 2020

@nabnaj, What about a thrown exception in KernelBase? :) Seems like this is it. Look for related issues on the current tracker, or please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants