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

Nothing happens when I click on a source line. Multiple issues in CMake-based build. #20

Open
rerdavies opened this issue Jul 28, 2021 · 1 comment

Comments

@rerdavies
Copy link

Issue #1: I can't get my .s file to synch with the source view. I'm using a CMake build chain.

Issue #1: I'm guessing you don't deal with relative paths in the dissasembly file. Files are generated by a pretty stock CMake build. Note the relative paths: /home/patch/src/piddle/build/../src/main.cpp. Opening the Dissassembly window loads Piddle.s, but no matter what line I click on in main.cpp, the view of Piddle.s remains on line one.

main.cpp:
139: int main(int argc, char *argv[])
140: {
141:    signal(SIGINT,sig_handler);
142:    // Check command line arguments.
143:    if (argc != 2)
...

Piddle.s:
00019e70 <main>:
main():
/home/patch/src/piddle/build/../src/main.cpp:140
   19e70:	e92d43f0 	push	{r4, r5, r6, r7, r8, r9, lr}
   19e74:	e24dde41 	sub	sp, sp, #1040	; 0x410
   19e78:	e1a04000 	mov	r4, r0
   19e7c:	e24dd004 	sub	sp, sp, #4
   19e80:	e1a05001 	mov	r5, r1
/home/patch/src/piddle/build/../src/main.cpp:141
   19e84:	e3a00002 	mov	r0, #2
   19e88:	e59f17a8 	ldr	r1, [pc, #1960]	; 1a638 <main+0x7c8>
   19e8c:	ebfff4f7 	bl	17270 <signal@plt>
/home/patch/src/piddle/build/../src/main.cpp:143
   19e90:	e3540002 	cmp	r4, #2
   19e94:	0a000012 	beq	19ee4 <main+0x74>


settings.json:
  "disasexpl.associations": {
        "**/*.hpp": "/home/patch/src/piddle/build/src/Piddle.s"
        "**/*.cpp": "/home/patch/src/piddle/build/src/Piddle.s"
    }

Issue #2: Editing Piddle.s before launching Dissasembly view causes all tasks to hang.

It seems easy enough to search and replace /build/../src/ with /src/ in Piddle.s. 1) Load Piddle.s; 2) do the appropriate search and replace; 3) save and close.

When I do so, launching the Dissassembly view does nothing. In addition, other task, like CMake Build will not launch until VS code is restarted. Line tags now read "/home/patch/src/piddle/src/main.cpp:141"

Issue #3: Source lines still won't synch.

Convert Piddle.s relative paths to canonical paths. Close VS Code and re-open it. (Run a build to make sure everything is copacetic; or not. Doesn't seem to make a difference). Open main. Click on line 141. Launch dissasembly view. Result: Piddle.s window opens. Piddle.s view remains on line 0.

I also tried converting paths to ~/src/piddle/src/main.cpp, with no improvement.

Issue #4: Reloading Piddle.s.

I am under the strong impression that you don't reload Piddle.s if it changes on disk. You should be subscribing to file change notifications.

The relative source line thing may seem picky; but CMake is a very common toolchain for C/C++ projects. And the problem is not unsolvable. The solution is either: (1) pre-index the .S file, converting paths with ".."s, "."s (and probably "//"s to "/" in non-initial position -- I think linux does that) to canonical form. or (2): search for occurences of ^/(.*)/main.cpp:()$, and then process the captured path to see if it matches.

Environment:

Raspberry Pi-4, running Rasbian (debian). G++ toolchain.

VSCode Environment:
Version: 1.58.2
Commit: c3f126316369cd610563c75b1b1725e0679adfb3
Date: 2021-07-14T22:05:50.884Z
Electron: 12.0.13
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Linux arm 5.10.17-v7l+

@dseight
Copy link
Owner

dseight commented Oct 7, 2021

Thank you for the comprehensive description! Relative paths handling should be fixed with commit e4b2029 (release 0.2.2).

Regarding the reloading of file changes — it should work fine as well. I could not reproduce any issues after manual editing of the .s file. Could you please let me know if it works fine for you on 0.2.2?

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

No branches or pull requests

2 participants