Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8580771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:53:53+00:00 2026-06-11T20:53:53+00:00

In GDB, I can use info line func_name to get the memory address of

  • 0

In GDB, I can use “info line func_name” to get the memory address of func_name, and then use “set $PC=memory_address” to start debugging this function. How do I do the same within lldb? Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:53:54+00:00Added an answer on June 11, 2026 at 8:53 pm

    The command in lldb is “image lookup”. I think an example of “info func” <-> “image lookup” was recently added to the lldb/gdb command page – http://lldb.llvm.org/lldb-gdb.html

    e.g.

    (lldb) im loo -n puts
    1 match found in /usr/lib/system/libsystem_c.dylib:
            Address: libsystem_c.dylib[0x0000000000011d9a] (libsystem_c.dylib.__TEXT.__text + 69850)
            Summary: libsystem_c.dylib`puts
    (lldb) 
    

    although this is only showing you the offset in libsystem_c.dylib here (0x11d9a) — to see the actual load address you would need to use the “-v” option to image lookup which will show the range of addresses that puts covers. Or you could do this more directly with the back tick notation in lldb,

    (lldb) reg read pc
         rip = 0x0000000100000f2b  a.out`main + 11 at a.c:3
    (lldb) reg write pc `(void(*)())puts`
    (lldb) reg read pc
         rip = 0x00007fff99ce1d9a  libsystem_c.dylib`puts
    

    OK I had to cast puts() because lldb needed a function prototype here – not super convenient, but if it’s one of your own functions that isn’t needed:

    (lldb) reg write pc `main`
    (lldb) reg read pc
         rip = 0x0000000100000f20  a.out`main at a.c:2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What gdb frontends can I use with vim for debugging C and C++ code?
With g++ with -g option , I can use gdb for debugging purposes. What's
From this link gdb interpret memory address as an object we know that, if
In gdb, I can use the print command to display a floating point or
How can I get GDB to print all the source files that it recognises?
Every time I start gdb, I immediately do: set print thread-events off It would
I know that we can use several commands to access and read memory: for
I am wondering which debugging tool I can use for an assembly program and
When you debug C/C++ code in gdb, you can for example use list command
To debug chromium using gdb ( LinuxDebugging ) one can use chromium --renderer-cmd-prefix=gdb --args

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.