Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
cl-x86.log
C:\projects\c\poc
λ clang-x86.bat
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.2
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86'
C:\projects\c\poc
λ cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27024.1 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
C:\projects\c\poc
λ cl /Zi /Od main.c
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27024.1 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
main.c
Microsoft (R) Incremental Linker Version 14.16.27024.1
Copyright (C) Microsoft Corporation. All rights reserved.
/out:main.exe
/debug
main.obj
C:\projects\c\poc
λ lldb main.exe
(lldb) target create "main.exe"
Current executable set to 'main.exe' (i686).
(lldb) break set -f main.c -l 13
Breakpoint 1: where = main.exe`_main + 103 at main.c:13, address = 0x00406c57
(lldb) r
Process 17340 launched: 'C:\projects\c\poc\main.exe' (i686)
Process 17340 stopped
* thread #1, stop reason = breakpoint 1.1
frame #0: 0x009e6c57 main.exe`_main(argc=1, argv=0x000fd9d0) at main.c:13
10 int ret = (size * d);
11 printf("ret=%d\n", ret);
12
-> 13 return ret;
14 }
(lldb) p size
(int) $0 = 60
(lldb) p d
(double) $1 = 1.3999999999999999
(lldb) p ret
(int) $2 = 84
(lldb) c
Process 17340 resuming
Process 17340 exited with status = 84 (0x00000054)
(lldb) quit
// Console's output for this scenario is:
// size=60
// double=1.400000
// ret=84
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.