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

Support non-contiguous functions #71

Merged

Conversation

Marc-Aldorasi-Imprivata
Copy link
Contributor

This changes CV2PDB::addDWARFProc to take a sequence of address ranges. The first address range (which starts at the function entry point) still emits a S_GPROC_V3 block, but the additional ranges emit S_SEPCODE_V3 blocks which reference the S_GPROC_V3 block, so when the debugger displays an address in one of these ranges it will display as correct_function_name+large_offset_from_entry_address instead of unrelated_symbol+small_offset.

This fixes issue #52.

Copy link
Owner

@rainers rainers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution and sorry for the delay.
LGTM, though I don't have the expertise to actually judge.

Can you add a test similar to the existing few: https://github.com/rainers/cv2pdb/blob/master/.github/workflows/build-and-test.yml#L44

@@ -34,7 +34,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this works in VS2017, that is still used by the Appveyor build of Visual D that includes cv2pdb. Can you add defaulting DefaultPlatformToolset to v120_xp if it is not yet set?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I changed this is because the program no longer compiles with the v120 tools, since those don't support constexpr

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this is supposed to work according to #69 (comment) , maybe depends on the exact version of the compiler.
It builds on appveyor with cl 14.16.27023: https://ci.appveyor.com/project/rainers/visuald/builds/42205296

Adding something like

<DefaultPlatformToolset Condition="'$(DefaultPlatformToolset)' == ''">v120_xp</DefaultPlatformToolset>

to the property group a couple of lines above should do the trick to use the default on newer VS versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It builds because the Makefile explicitly overrides PlatformToolset to v141, which is Visual Studio 2017: https://github.com/dlang/visuald/blob/9c90ff0e9f1e93962324486375426892665926d9/Makefile#L170

v120 is Visual Studio 2013, which doesn't support constexpr, and was disabled in 2019: dlang/visuald@15216ca

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, indeed. Sorry for the noise. So yes. let's get rid of v120_xp.

@rainers rainers merged commit c99df6c into rainers:master Jan 24, 2022
@rainers
Copy link
Owner

rainers commented Jan 24, 2022

Thanks and sorry for the delay, somehow fell off the radar.

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

Successfully merging this pull request may close these issues.

2 participants