Git Product home page Git Product logo

Comments (1)

skoocda avatar skoocda commented on June 4, 2024

I observed this behavior as well. In my case, the assembler code varied slightly but led to the same effect

(gdb) disassemble /m
Dump of assembler code for function _ZN12led_roulette18__cortex_m_rt_main17h327bbe3f14bd160dE:
8       fn main() -> ! {
   0x080001ea <+0>:     sub     sp, #8
   0x080001ec <+2>:     movs    r0, #42 @ 0x2a

9           let _y;
10          let x = 42;
=> 0x080001ee <+4>:     str     r0, [sp, #0]
   0x080001f0 <+6>:     str     r0, [sp, #4]

The register is initialized with the value 42 (0x2a) and then the variables are initialized to that value, leading to the inspection sequence:

(gdb) stepi      
halted: PC: 0x080001ec
0x080001ec      8       fn main() -> ! {

(gdb) info locals
No locals.

(gdb) stepi      
halted: PC: 0x080001ee
10          let x = 42;

(gdb) info locals
x = 42
_y = 42

I also tried building and running with inline-threshold=0 and opt-level=0 but that didn't change the assembly code.

from discovery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.